(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_FILE) op: Equal rhs: {(raspbian-stretch-lite.zip)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:TODAY_EXT) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(date)} {(Lit_Other '+') (DQ ('%Y-%m-%d-%H-%M'))})] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:BUILD_ID) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(hexdump)} {(-n)} {(4)} {(-e)} {(SQ <'4/4 "%X" 1 "\\n"'>)} {(/dev/random)}) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_FILE_CUSTOMIZED) op: Equal rhs: { (braced_var_sub token: <VSub_Name IMAGE> suffix_op: (suffix_op.Unary op_id: VTest_ColonHyphen arg_word: {(DQ (crankshaft-) (${ VSub_Name TODAY_EXT) (-) (${ VSub_Name BUILD_ID) (.img))} ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_URL) op: Equal rhs: {(https) (Lit_Other ':') (//downloads.raspberrypi.org/raspbian_lite_latest)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:TEMP_CHROOT_DIR) op: Equal rhs: {(/mnt/raspbian-temp)} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:DROP_IN) op: Equal rhs: { (braced_var_sub token: <VSub_Name DROP_IN> suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(0)}) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:CUSTOM_SCRIPT) op: Equal rhs: { (braced_var_sub token: <VSub_Name CUSTOM_SCRIPT> suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(DQ )}) ) } ) ] ) (C {(clear)}) (C {(echo)} {(DQ ('###########################################################################'))}) (C {(echo)} {(DQ )}) (C {(echo)} {(DQ (' Welcome to the Crankshaft build script!'))}) (C {(echo)} {(DQ )}) (C {(echo)} {(DQ ('###########################################################################'))}) (command.ShFunction name: bail_and_cleanup body: (command.BraceGroup children:[(C {(kpartx)} {(-d)} {($ VSub_Number '$1')})]) ) (command.ShFunction name: check_command_ok body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(Lit_LBracket '[')} {(-x)} { (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(command)} {(-v)} {($ VSub_Number '$1')})] ) ) ) } {(Lit_RBracket ']')} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (C {(echo)} {(DQ )}) (command.Simple words: [ {(echo)} { (DQ ('Error: ') ($ VSub_Number '$1') (' is not installed. Please install it.') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (C {(echo)} {(DQ )}) (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) ] ) ) (command.ShFunction name: check_root body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$EUID'))} {(-ne)} {(0)} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (C {(echo)} {(DQ )}) (C {(echo)} { (DQ ( "Please run this script as using sudo/as root, otherwise it can't continue. " ) ) } ) (C {(echo)} {(DQ )}) (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) ] ) ) (command.ShFunction name: check_dependencies body: (command.BraceGroup children: [ (C {(check_command_ok)} {(kpartx)}) (C {(check_command_ok)} {(qemu-arm-static)}) (C {(check_command_ok)} {(chroot)}) (C {(check_command_ok)} {(pv)}) (C {(check_command_ok)} {(zipinfo)}) (C {(check_command_ok)} {(zerofree)}) ] ) ) (command.ShFunction name: get_unzip_image body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(-f)} {(${ VSub_Name IMAGE_FILE)} {(Lit_RBracket ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:remotesize) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [ {(wget)} {(https) (Lit_Other ':') (//downloads.raspberrypi.org/raspbian_lite_latest) } {(--spider)} {(--server-response)} {(-O)} {(-)} ] redirects: [ (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) (C {(sed)} {(-ne)} {(SQ <'/Content-Length/{s/.*: //;p}'>)}) ] negated: F ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:localsize) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(wc)} {(-c)} {(${ VSub_Name IMAGE_FILE)}) (C {(awk)} {(SQ <'{print $1}'>)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} { (braced_var_sub token: <VSub_Name remotesize> prefix_op: VSub_Pound ) } {(KW_Bang '!') (Lit_Equals '=')} {(braced_var_sub token:<VSub_Name localsize> prefix_op:VSub_Pound)} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:remotesize) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [ {(wget)} {(https) (Lit_Other ':') ( //downloads.raspberrypi.org/raspbian_lite_latest ) } {(--spider)} {(--server-response)} {(-O)} {(-)} ] redirects: [ (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) (C {(sed)} {(-ne)} {(SQ <'/Content-Length/{s/.*: //;p}'>)} ) ] negated: F ) ] ) ) } ) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$remotesize'))} {(Lit_Equals '=')} {(DQ ($ VSub_DollarName '$localsize'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} { (DQ ('Image file ') (${ VSub_Name IMAGE_FILE) (' is already the same, skipping download.') ) } ) (C {(echo)} {(DQ ('It will be re-downloaded if remote file has changed.'))}) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) ] ) ] else_action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(DQ ('Downloading new version of raspbian image from server...'))}) (C {(wget)} {(-q)} {(--show-progress)} {(-O) (${ VSub_Name IMAGE_FILE)} {(${ VSub_Name IMAGE_URL)} ) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) ] ) ] ) ] else_action: [ (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Downloading raspbian image from server...'))}) (C {(wget)} {(-q)} {(--show-progress)} {(-O) (${ VSub_Name IMAGE_FILE)} {(${ VSub_Name IMAGE_URL)} ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_FILE_UNZIPPED) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [(C {(zipinfo)} {(-1)} {(${ VSub_Name IMAGE_FILE)})] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_FILE_UNZIPPED_SIZE) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(zipinfo)} {(-l)} {(${ VSub_Name IMAGE_FILE)}) (C {(tail)} {(-1)}) (C {(xargs)}) (C {(cut)} {(-d) (SQ <' '>)} {(-f3)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(Lit_LBracket '[')} {(-f)} {(${ VSub_Name IMAGE_FILE_UNZIPPED)} {(Lit_RBracket ']')} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(DQ ('Unpacking raspbian image...'))}) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (command.Pipeline children: [ (C {(unzip)} {(-o)} {(-p)} {(${ VSub_Name IMAGE_FILE)}) (command.Simple words: [ {(pv)} {(-p)} {(-s)} {(${ VSub_Name IMAGE_FILE_UNZIPPED_SIZE)} {(-w)} {(80)} ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(${ VSub_Name IMAGE_FILE_UNZIPPED)} ) ] ) ] negated: F ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(Lit_LBracket '[')} {(-f)} {(${ VSub_Name IMAGE_FILE_CUSTOMIZED)} {(Lit_RBracket ']')} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(DQ ('Copying a big file...'))}) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(cp)} {(${ VSub_Name IMAGE_FILE_UNZIPPED)} {(${ VSub_Name IMAGE_FILE_CUSTOMIZED)} ) ] ) ] else_action: [ (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} { (DQ ('Skipping creation of ') (${ VSub_Name IMAGE_FILE_CUSTOMIZED) (", it's already there. To re-create, delete it.") ) } ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) ] ) ] ) ) (command.ShFunction name: resize_raw_image body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_SIZE_RAW) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [{(wc)} {(-c)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ (${ VSub_Name IMAGE_FILE_UNZIPPED))} ) ] ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_SIZE_ACTUAL) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Simple words: [{(wc)} {(-c)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {(DQ (${ VSub_Name IMAGE_FILE_CUSTOMIZED))} ) ] ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:IMAGE_ROOTPART_START) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(parted)} {(${ VSub_Name IMAGE_FILE_UNZIPPED)} {(unit)} {(s)} {(print)} {(-sm)} ) (C {(tail)} {(-1)}) (C {(cut)} {(-d) (Lit_Other ':')} {(-f2)}) (C {(sed)} {(SQ <s/s//>)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(${ VSub_Name IMAGE_SIZE_ACTUAL)} {(-gt)} {(${ VSub_Name IMAGE_SIZE_RAW)} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(DQ ('Image seems already resized, or something is wrong.'))}) (C {(echo)} {(DQ ("If the image doesn't work, try removing the .img and try again."))} ) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Resizing image...'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (command.Simple words: [ {(dd)} {(Lit_VarLike 'if=') (/dev/zero)} {(Lit_VarLike 'bs=') (1M)} {(Lit_VarLike 'count=') (512)} ] redirects: [ (redir.Redir op: <Redir_DGreat '>>'> fd: 16777215 arg_word: {(${ VSub_Name IMAGE_FILE_CUSTOMIZED)} ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:PART_NUM) op:Equal rhs:{(2)})] ) (command.Simple words: [{(fdisk)} {(${ VSub_Name IMAGE_FILE_CUSTOMIZED)}] redirects: [ (redir.HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 1048 stdin_parts: [ ('p\n') ('d\n') ($ VSub_DollarName '$PART_NUM') ('\n') ('n\n') ('p\n') ($ VSub_DollarName '$PART_NUM') ('\n') ($ VSub_DollarName '$IMAGE_ROOTPART_START') ('\n') ('\n') ('p\n') ('w\n') ] ) ] ) ] ) ) (command.ShFunction name: set_up_loopdevs body: (command.BraceGroup children: [ (command.Pipeline children: [ (C {(kpartx)} {(-v)} {(-a)} {(${ VSub_Name IMAGE_FILE_CUSTOMIZED)}) (C {(tee)} {(/tmp/kpartx-output.txt)}) ] negated: F ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LOOPPARTSID) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(cat)} {(/tmp/kpartx-output.txt)}) (C {(head)} {(-n1)}) (C {(sed)} {(SQ <'s/add map //'>)}) (C {(cut)} {(-f1)} {(-d) (SQ <' '>)}) (C {(sed)} {(SQ <'s/p1$//'>)}) ] negated: F ) ] ) ) } ) ] ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('The loop device is ') (${ VSub_Name LOOPPARTSID))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(sync)}) (C {(sleep)} {(2)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(Lit_LBracket '[')} {(-L)} {(/dev/mapper/) (${ VSub_Name LOOPPARTSID) (p1)} {(Lit_RBracket ']')} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (C {(echo)} { (DQ ( ' ' ) ) } ) (C {(echo)} { (DQ ("Couldn't find the loopdev partitions at /dev/mapper/") (${ VSub_Name LOOPPARTSID) ('p1!') ) } ) (C {(echo)} { (DQ ( ' ' ) ) } ) (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (C {(bail_and_cleanup)} {(/dev/) (${ VSub_Name LOOPPARTSID)} {(${ VSub_Name IMAGE_FILE_CUSTOMIZED)} ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Found the loopdev partitions at /dev/mapper/') (${ VSub_Name LOOPPARTSID) ('!'))} ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:LOOPDEVPARTS) op: Equal rhs: {(/dev/mapper/) (${ VSub_Name LOOPPARTSID)} ) ] ) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Check rootfs before resize...'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(e2fsck)} {(-f)} {(${ VSub_Name LOOPDEVPARTS) (p2)}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Resize rootfs...'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(resize2fs)} {(-p)} {(${ VSub_Name LOOPDEVPARTS) (p2)}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Check rootfs afer resize...'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(e2fsck)} {(-f)} {(${ VSub_Name LOOPDEVPARTS) (p2)}) (C {(mount_chroot_dirs)} {(${ VSub_Name LOOPDEVPARTS)} {(${ VSub_Name LOOPPARTSID)}) (C {(sed)} {(-i)} {(SQ <'s/^/#CHROOT /g'>)} {(${ VSub_Name TEMP_CHROOT_DIR) (/etc/ld.so.preload)} ) (C {(cp)} { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children:[(C {(which)} {(qemu-arm-static)})]) ) } {(${ VSub_Name TEMP_CHROOT_DIR) (/usr/bin/)} ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_ne left: {(${ VSub_Name DROP_IN)} right: {(0)} ) ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(-e)} {(DQ ('Dropping you in the chroot shell.'))}) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(chroot)} {(${ VSub_Name TEMP_CHROOT_DIR)} {(/bin/bash)}) ] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: BoolUnary_n child: {(DQ (${ VSub_Name CUSTOM_SCRIPT))} ) ) terminator: <Op_Semi ';'> ) ] action: [(C {(eval)} {(${ VSub_Name CUSTOM_SCRIPT)})] ) ] else_action: [ (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(DQ ('Unpacking qt5 libraries...'))}) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (command.Pipeline children: [ (C {(pv)} {(-p)} {(-w)} {(80)} {(prebuilt/libQt5_OpenGLES2.tar.xz)}) (C {(tar)} {(-xf)} {(-)} {(-C)} {(${ VSub_Name TEMP_CHROOT_DIR) (/)}) ] negated: F ) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(echo)} {(DQ ('Copy crankshaft files to root...'))}) (C {(echo)} { (DQ ( --------------------------------------------------------------------------- ) ) } ) (C {(cp)} {(-a)} {(crankshaft/.)} {(${ VSub_Name TEMP_CHROOT_DIR) (/root/)}) (C {(sync)}) (C {(sleep)} {(1)}) (C {(chroot)} {(${ VSub_Name TEMP_CHROOT_DIR)} {(/bin/bash)} {(/root/scripts/customize-image-pi.sh)} ) (C {(chroot)} {(${ VSub_Name TEMP_CHROOT_DIR)} {(/bin/bash)} {(/root/scripts/read-only-fs.sh)} ) ] ) ] ) (C {(sed)} {(-i)} {(SQ <'s/^#CHROOT //g'>)} {(${ VSub_Name TEMP_CHROOT_DIR) (/etc/ld.so.preload)} ) (C {(umount_chroot_dirs)}) (C {(zerofree)} {(${ VSub_Name LOOPDEVPARTS) (p2)}) (C {(umount_loop_dev)} {(/dev/) (${ VSub_Name LOOPPARTSID)}) (C {(echo)} {(DQ ('###########################################################################'))} ) (C {(echo)} {(DQ (' '))} ) (C {(echo)} {(DQ ('If you reach here, it means the image is ready. :)'))}) (C {(echo)} {(DQ (' '))} ) (C {(echo)} {(DQ ('###########################################################################'))} ) ] ) ) (command.ShFunction name: mount_chroot_dirs body: (command.BraceGroup children: [ (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Mounting CHROOT directories'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(mkdir)} {(-p)} {(${ VSub_Name TEMP_CHROOT_DIR)}) (C {(mount)} {(-o)} {(rw)} {(${ VSub_Number 1) (p2)} {(${ VSub_Name TEMP_CHROOT_DIR)}) (C {(mount)} {(-o)} {(rw)} {(${ VSub_Number 1) (p1)} {(${ VSub_Name TEMP_CHROOT_DIR) (/boot)}) (C {(mount)} {(--bind)} {(/dev)} {(${ VSub_Name TEMP_CHROOT_DIR) (/dev/)}) (C {(mount)} {(--bind)} {(/sys)} {(${ VSub_Name TEMP_CHROOT_DIR) (/sys/)}) (C {(mount)} {(--bind)} {(/proc)} {(${ VSub_Name TEMP_CHROOT_DIR) (/proc/)}) (C {(mount)} {(--bind)} {(/dev/pts)} {(${ VSub_Name TEMP_CHROOT_DIR) (/dev/pts)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(Lit_LBracket '[')} {(-f)} {(${ VSub_Name TEMP_CHROOT_DIR) (/etc/ld.so.preload)} {(Lit_RBracket ']')} ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (C {(echo)} { (DQ ( ' ' ) ) } ) (C {(echo)} { (DQ ("I didn't see ") (${ VSub_Name TEMP_CHROOT_DIR) ('/etc/ folder. Bailing!')) } ) (C {(echo)} { (DQ ( ' ' ) ) } ) (C {(echo)} { (DQ ( '###########################################################################' ) ) } ) (C {(umount_chroot_dirs)}) (C {(umount_loop_dev)} {($ VSub_Number '$2')}) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) ] ) ) (command.ShFunction name: umount_chroot_dirs body: (command.BraceGroup children: [ (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Unmount chroot dirs...'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(sync)}) (C {(umount)} (word.BracedTree parts: [ (${ VSub_Name TEMP_CHROOT_DIR) (/) (word_part.BracedTuple words: [{(dev/pts)} {(dev)} {(sys)} {(KW_Proc proc)} {(boot)} {}] ) ] ) ) ] ) ) (command.ShFunction name: umount_loop_dev body: (command.BraceGroup children: [ (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (C {(echo)} {(DQ ('Unmount loop devices...'))}) (C {(echo)} {(DQ (---------------------------------------------------------------------------))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:loopdev) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ VSub_Number '$1')}) (C {(cut)} {(-d) (DQ (/))} {(-f3)}) ] negated: F ) ] ) ) } ) ] ) (C {(dmsetup)} {(remove)} {(-f)} {($ VSub_DollarName '$loopdev') (DQ (p1))}) (C {(dmsetup)} {(remove)} {(-f)} {($ VSub_DollarName '$loopdev') (DQ (p2))}) (C {(kpartx)} {(-d)} {($ VSub_Number '$1')}) ] ) ) (C {(check_dependencies)}) (C {(check_root)}) (C {(get_unzip_image)}) (C {(resize_raw_image)}) (C {(set_up_loopdevs)}) ] )