@@ -444,7 +444,8 @@ fn mount_image(embed: &Embed, image: &Image, mount_dir: PathBuf) {
444
444
if image. is_dwar {
445
445
#[ cfg( feature = "dwarfs" ) ]
446
446
{
447
- embed. dwarfs ( vec ! [ "-f" . into( ) ,
447
+ let mut exec_args = vec ! [
448
+ image_path, mount_dir, "-f" . into( ) ,
448
449
"-o" . into( ) , "ro,nodev,noatime,clone_fd" . into( ) ,
449
450
"-o" . into( ) , "cache_files,no_cache_image" . into( ) ,
450
451
"-o" . into( ) , format!( "cachesize={}" , get_dwfs_option( "DWARFS_CACHESIZE" , DWARFS_CACHESIZE ) ) ,
@@ -453,20 +454,28 @@ fn mount_image(embed: &Embed, image: &Image, mount_dir: PathBuf) {
453
454
"-o" . into( ) , "tidy_strategy=time,tidy_interval=1s,tidy_max_age=2s,seq_detector=1" . into( ) ,
454
455
"-o" . into( ) , format!( "workers={}" , get_dwfs_option( "DWARFS_WORKERS" , & num_cpus:: get( ) . to_string( ) ) ) ,
455
456
"-o" . into( ) , format!( "uid={uid},gid={gid}" ) ,
456
- "-o" . into( ) , format!( "offset={}" , image. offset) ,
457
- "-o" . into( ) , "debuglevel=error" . into( ) ,
458
- image_path, mount_dir
459
- ] )
457
+ "-o" . into( ) , format!( "offset={}" , image. offset)
458
+ ] ;
459
+ if get_env_var ( "ENABLE_FUSE_DEBUG" ) == "1" {
460
+ exec_args. append ( & mut vec ! [ "-o" . into( ) , "debuglevel=debug" . into( ) ] ) ;
461
+ } else {
462
+ exec_args. append ( & mut vec ! [ "-o" . into( ) , "debuglevel=error" . into( ) ] ) ;
463
+ }
464
+ embed. dwarfs ( exec_args)
460
465
}
461
466
} else {
462
467
#[ cfg( feature = "squashfs" ) ]
463
468
{
464
- embed. squashfuse ( vec ! [ "-f" . into( ) ,
469
+ let mut exec_args = vec ! [
470
+ image_path, mount_dir, "-f" . into( ) ,
465
471
"-o" . into( ) , "ro,nodev,noatime" . into( ) ,
466
472
"-o" . into( ) , format!( "uid={uid},gid={gid}" ) ,
467
- "-o" . into( ) , format!( "offset={}" , image. offset) ,
468
- image_path, mount_dir
469
- ] )
473
+ "-o" . into( ) , format!( "offset={}" , image. offset)
474
+ ] ;
475
+ if get_env_var ( "ENABLE_FUSE_DEBUG" ) == "1" {
476
+ exec_args. append ( & mut vec ! [ "-o" . into( ) , "debug" . into( ) ] ) ;
477
+ }
478
+ embed. squashfuse ( exec_args)
470
479
}
471
480
}
472
481
}
@@ -717,6 +726,7 @@ fn print_usage(portable_home: &PathBuf, portable_config: &PathBuf) {
717
726
for reuse mount point
718
727
TMPDIR=/path Specifies a custom path for mounting or extracting the image
719
728
FUSERMOUNT_PROG=/path Specifies a custom path for fusermount
729
+ ENABLE_FUSE_DEBUG=1 Enables debug mode for the mounted filesystem
720
730
TARGET_{}=/path Operate on a target {SELF_NAME} rather than this file itself" ,
721
731
ARG_PFX . to_uppercase( ) , SELF_NAME . to_uppercase( ) ) ;
722
732
#[ cfg( feature = "dwarfs" ) ]
0 commit comments