(command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <-e>)} {<-o>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <--empty>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<rm>} {<-f>} {<hdd.img>}) (C {<truncate>} {<-s>} {<20M>} {<hdd.img>}) (C {<echo>} {(DQ <'Created new hard disk image file \'hdd.img\' with 20MB size.'>)}) ] spids: [8 38] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <-f>)} {<-o>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <--folder>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<id>} {<-u>}) ) ) } {<Id.Lit_Equals '='>} {(DQ <0>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {(DQ <'Using option \'-f\' (or \'--folder\') requires root permissions.'>)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [100 124] ) ] ) (C {<rm>} {<-f>} {<hdd.img>}) (C {<truncate>} {<-s>} {<20M>} {<hdd.img>}) (C {<echo>} {(DQ <'Created new hard disk image file \'hdd.img\' with 20MB size.'>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LOOP_DEVICE) op: assign_op.Equal rhs: {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<losetup>} {<-f>}))} spids: [169] ) ] ) (C {<losetup>} {($ Id.VSub_DollarName '$LOOP_DEVICE')} {<hdd.img>}) (C {<echo>} {(DQ <'Attached hard disk image file to loop device.'>)}) (C {<mkfs.ext2>} {($ Id.VSub_DollarName '$LOOP_DEVICE')}) (C {<echo>} {(DQ <'Hard disk image file has been formatted with Ext2 filesystem.'>)}) (C {<mkdir>} {<folder>}) (C {<mount>} {<hdd.img>} {<folder>}) (C {<echo>} {(DQ <'Mounted hard disk image file to temporary folder.'>)}) (C {<mkdir>} {<-p>} {<'folder/minimal/rootfs'>}) (C {<mkdir>} {<-p>} {<'folder/minimal/work'>}) (C {<echo>} {(DQ <'Overlay structure has been created.'>)}) (command.Simple words: [{<echo>} {(DQ <'This file is on external hard disk.'>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'folder/minimal/rootfs/overlay.txt'>} ) ] do_fork: T ) (C {<echo>} {(DQ <'Created sample text file.'>)}) (C {<umount>} {<folder>}) (C {<rm>} {<-rf>} {<folder>}) (C {<echo>} {(DQ <'Unmounted hard disk image file.'>)}) (C {<losetup>} {<-d>} {($ Id.VSub_DollarName '$LOOP_DEVICE')}) (C {<echo>} {(DQ <'Detached hard disk image file from loop device.'>)}) (C {<chown>} {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<logname>}))} {<hdd.img>} ) (C {<echo>} {(DQ <'Applied original ownership to hard disk image file.'>)}) ] spids: [67 97] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <-s>)} {<-o>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <--sparse>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<id>} {<-u>}) ) ) } {<Id.Lit_Equals '='>} {(DQ <0>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {(DQ <'Using option \'-s\' (or \'--sparse\') requires root permissions.'>)}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [356 380] ) ] ) (C {<rm>} {<-f>} {<hdd.img>}) (C {<truncate>} {<-s>} {<20M>} {<hdd.img>}) (C {<echo>} {(DQ <'Created new hard disk image file \'hdd.img\' with 20MB size.'>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LOOP_DEVICE_HDD) op: assign_op.Equal rhs: {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<losetup>} {<-f>}))} spids: [425] ) ] ) (C {<losetup>} {($ Id.VSub_DollarName '$LOOP_DEVICE_HDD')} {<hdd.img>}) (C {<echo>} {(DQ <'Attached hard disk image file to loop device.'>)}) (C {<mkfs.vfat>} {($ Id.VSub_DollarName '$LOOP_DEVICE_HDD')}) (C {<echo>} {(DQ <'Hard disk image file has been formatted with FAT filesystem.'>)}) (C {<mkdir>} {<sparse>}) (C {<mount>} {<hdd.img>} {<sparse>}) (C {<echo>} {(DQ <'Mounted hard disk image file to temporary folder.'>)}) (C {<rm>} {<-f>} {<'sparse/minimal.img'>}) (C {<truncate>} {<-s>} {<1M>} {<'sparse/minimal.img'>}) (C {<echo>} {(DQ <'Created new overlay image file with 1MB size.'>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LOOP_DEVICE_OVL) op: assign_op.Equal rhs: {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<losetup>} {<-f>}))} spids: [508] ) ] ) (C {<losetup>} {($ Id.VSub_DollarName '$LOOP_DEVICE_OVL')} {<'sparse/minimal.img'>}) (C {<echo>} {(DQ <'Attached overlay image file to loop device.'>)}) (C {<mkfs.ext2>} {($ Id.VSub_DollarName '$LOOP_DEVICE_OVL')}) (C {<echo>} {(DQ <'Overlay image file has been formatted with Ext2 filesystem.'>)}) (C {<mkdir>} {<ovl>}) (C {<mount>} {<'sparse/minimal.img'>} {<ovl>}) (C {<echo>} {(DQ <'Mounted overlay image file to temporary folder.'>)}) (C {<mkdir>} {<-p>} {<'ovl/rootfs'>}) (C {<mkdir>} {<-p>} {<'ovl/work'>}) (C {<echo>} {(DQ <'Overlay structure has been created.'>)}) (C {<echo>} {(DQ <'Create sample text file.'>)}) (command.Simple words: [{<echo>} {(DQ <'This file is on external hard disk.'>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'ovl/rootfs/overlay.txt'>} ) ] do_fork: T ) (C {<chown>} {<-R>} {<root> <Id.Lit_Colon ':'> <root>} {<ovl>}) (C {<echo>} {(DQ <'Applied root ownership to overlay content.'>)}) (C {<umount>} {<ovl>}) (C {<sleep>} {<1>}) (C {<rm>} {<-rf>} {<ovl>}) (C {<echo>} {(DQ <'Unmounted overlay image file.'>)}) (C {<losetup>} {<-d>} {($ Id.VSub_DollarName '$LOOP_DEVICE_OVL')}) (C {<sleep>} {<1>}) (C {<echo>} {(DQ <'Overlay image file has been detached from loop device.'>)}) (C {<umount>} {<sparse>}) (C {<sleep>} {<1>}) (C {<rm>} {<-rf>} {<sparse>}) (C {<echo>} {(DQ <'Unmounted hard disk image file.'>)}) (C {<losetup>} {<-d>} {($ Id.VSub_DollarName '$LOOP_DEVICE_HDD')}) (C {<sleep>} {<1>}) (C {<echo>} {(DQ <'Hard disk image file has been detached from loop device.'>)}) (C {<chown>} {(command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<logname>}))} {<hdd.img>} ) (C {<echo>} {(DQ <'Applied original ownership to hard disk image file.'>)}) ] spids: [323 353] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <-h>)} {<-o>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ <--help>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [{<cat>}] redirects: [ (redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {<CEOF>} here_end_span_id: 787 stdin_parts: [ <' Usage: '> ($ Id.VSub_Number '$0') <' [OPTION]\n'> < ' This utility generates 20MB sparse file \'hdd.img\' which can be used as QEMU\n' > < ' disk image where all filesystem changes from the live session are persisted.\n' > <' \n'> <' -e, --empty Create empty sparse image file which is not formatted.\n'> < ' -f, --folder Create sparse image file formatted with Ext2 filesystem which\n' > <' contains compatible overlay folder structure.\n'> <' -h, --help Prints this help information.\n'> < ' -s, --sparse Create sparse image file formatted with FAT filesystem which\n' > < ' contains sparse image file \'minimal.img\' (1MB) formatted with\n' > < ' Ext2 filesystem which contains the actual overlay structure.\n' > ] ) ) ] do_fork: T ) ] spids: [734 764] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<echo>} {(DQ <'No option specified. Use \'-h\' or \'--help\' for more info.'>)})] spids: [789 806] ) ] else_action: [ (C {<echo>} { (DQ <'Option \''> ($ Id.VSub_Number '$1') <'\' is not recognized. Use \'-h\' or \'--help\' for more info.'> ) } ) ] )