(If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (-e))} {(-o)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--empty))} {(Lit_Other ']')} ) terminator: <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: [16777215 38] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (-f))} {(-o)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--folder))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(id)} {(-u)})]) left_token: <Left_CommandSub '$('> spids: [107 111] ) ) } {(Lit_Other '=')} {(DQ (0))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ("Using option '-f' (or '--folder') requires root permissions."))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 124] ) ] spids: [16777215 139] ) (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."))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LOOP_DEVICE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(losetup)} {(-f)})]) left_token: <Left_CommandSub '$('> spids: [170 174] ) } spids: [169] ) ] spids: [169] ) (C {(losetup)} {($ VSub_Name '$LOOP_DEVICE')} {(hdd.img)}) (C {(echo)} {(DQ ('Attached hard disk image file to loop device.'))}) (C {(mkfs.ext2)} {($ VSub_Name '$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.'))}) (SimpleCommand words: [{(echo)} {(DQ ('This file is on external hard disk.'))}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(folder/minimal/rootfs/overlay.txt)} ) ] ) (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)} {($ VSub_Name '$LOOP_DEVICE')}) (C {(echo)} {(DQ ('Detached hard disk image file from loop device.'))}) (C {(chown)} { (CommandSubPart command_list: (CommandList children:[(C {(logname)})]) left_token: <Left_CommandSub '$('> spids: [310 312] ) } {(hdd.img)} ) (C {(echo)} {(DQ ('Applied original ownership to hard disk image file.'))}) ] spids: [67 97] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (-s))} {(-o)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--sparse))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(id)} {(-u)})]) left_token: <Left_CommandSub '$('> spids: [363 367] ) ) } {(Lit_Other '=')} {(DQ (0))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ("Using option '-s' (or '--sparse') requires root permissions."))}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 380] ) ] spids: [16777215 395] ) (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."))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LOOP_DEVICE_HDD) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(losetup)} {(-f)})]) left_token: <Left_CommandSub '$('> spids: [426 430] ) } spids: [425] ) ] spids: [425] ) (C {(losetup)} {($ VSub_Name '$LOOP_DEVICE_HDD')} {(hdd.img)}) (C {(echo)} {(DQ ('Attached hard disk image file to loop device.'))}) (C {(mkfs.vfat)} {($ VSub_Name '$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.'))}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:LOOP_DEVICE_OVL) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(losetup)} {(-f)})]) left_token: <Left_CommandSub '$('> spids: [509 513] ) } spids: [508] ) ] spids: [508] ) (C {(losetup)} {($ VSub_Name '$LOOP_DEVICE_OVL')} {(sparse/minimal.img)}) (C {(echo)} {(DQ ('Attached overlay image file to loop device.'))}) (C {(mkfs.ext2)} {($ VSub_Name '$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.'))}) (SimpleCommand words: [{(echo)} {(DQ ('This file is on external hard disk.'))}] redirects: [(Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(ovl/rootfs/overlay.txt)})] ) (C {(chown)} {(-R)} {(root) (Lit_Other ':') (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)} {($ VSub_Name '$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)} {($ VSub_Name '$LOOP_DEVICE_HDD')}) (C {(sleep)} {(1)}) (C {(echo)} {(DQ ('Hard disk image file has been detached from loop device.'))}) (C {(chown)} { (CommandSubPart command_list: (CommandList children:[(C {(logname)})]) left_token: <Left_CommandSub '$('> spids: [721 723] ) } {(hdd.img)} ) (C {(echo)} {(DQ ('Applied original ownership to hard disk image file.'))}) ] spids: [323 353] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (-h))} {(-o)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ (--help))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(CEOF)} here_end_span_id: 787 stdin_parts: [ (' Usage: ') ($ 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' ) ] ) ] ) ] spids: [734 764] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Other '=')} {(DQ )} {(Lit_Other ']')}) terminator: <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 '") ($ VSub_Number '$1') ("' is not recognized. Use '-h' or '--help' for more info.") ) } ) ] spids: [815 826] )