--- trunk/create-clonezilla-sysresccd/files/ocs-iso 2010/05/20 12:12:53 47 +++ trunk/create-clonezilla-sysresccd/files/ocs-iso 2010/08/13 08:30:37 93 @@ -23,7 +23,7 @@ # We will create it like this: # -x $DEBIAN_ISO_TMP/isolinux -x $DEBIAN_ISO_TMP/md5sum.txt -x $DEBIAN_ISO_TMP/casper/memtest # "home" should also be excluded since if it exists, it will conflict with the real home later we will merge. Ref: https://sourceforge.net/forum/message.php?msg_id=7599463 Thanks to Andrew Bloxom for this idea. -mkiso_exclude_list_1="isolinux md5sum.txt doc live etc pkg ocs-live.d utils" +mkiso_exclude_list_1="isolinux syslinux md5sum.txt doc live etc pkg ocs-live.d utils" mkiso_exclude_list_2="home" # This should not be a duplicated count. mkiso_exclude_list="$mkiso_exclude_list_1 $mkiso_exclude_list_2" @@ -77,17 +77,26 @@ check_file_size_in_ocs_image() { local img_path="$1" local size_t - for ifile in $img_path $img_path/*; do + for ifile in $img_path/*; do size_t="$(du -Lms $ifile | awk -F" " '{print $1}')" if [ "$size_t" -gt "$FILE_LIMIT" ]; then ################################################################################ # Section edited by S. Georgaras -# [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE -# echo "$ifile size ($size_t MB) is too large! $msg_mkisofs_unable_process_that" -# echo "$msg_unable_to_create_clonezilla_img_iso" -# [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL -# exit 1 +# [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING +# echo "$ifile size ($size_t MB) is too large! $msg_mkisofs_unable_process_that" +# [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL +# echo "$msg_are_u_sure_u_want_to_continue" +# echo -n "[y/N] " +# read cont_ans +# case "$cont_ans" in +# y|Y|[yY][eE][sS]) +# echo $msg_ok_let_do_it +# ;; +# *) +# echo "Abort!" +# exit 2 +# esac whiptail --backtitle Clonezilla-SysRescCD --title ' Excessive Image Size ' --yesno "The image file \"$(basename ${ifile%/})\" is too large ($size_t MB) and cannot be processed!!! Do you want to create a 8GB DVD instead?" 0 60 @@ -103,9 +112,9 @@ # clean_tmp_dir() { - [ -d "$ISOLNX_TMP" -a -n "$ISOLNX_TMP" ] && rm -rf $ISOLNX_TMP - [ -d "$WD_TMP" -a -n "$WD_TMP" ] && rm -rf $WD_TMP - [ -d "$DEBIAN_ISO_TMP" ] && umount $DEBIAN_ISO_TMP &>/dev/null && rm -rf $DEBIAN_ISO_TMP + [ -d "$ISOSYSLNX_TMP" -a -n "$(echo $ISOSYSLNX_TMP | grep "ocs_isosyslnx")" ] && rm -rf $ISOSYSLNX_TMP + [ -d "$WD_TMP" -a -n "$(echo $WD_TMP | grep "ocs_iso_wd")" ] && rm -rf $WD_TMP + [ -d "$DEBIAN_ISO_TMP" ] && umount $DEBIAN_ISO_TMP &>/dev/null && rmdir $DEBIAN_ISO_TMP } # End of clean_tmp_dir # @@ -201,6 +210,13 @@ ;; -s|--skip-image) insert_mode="prog_only" + # + # Section inserted by S. Georgaras + # Variable to know that -s was actually used + # + ORIGINAL_INSERT_MODE='-o' + # + ################################################## shift ;; -t|--ocs-live-batch) ocs_live_batch="yes" @@ -329,14 +345,14 @@ # Some temp dirs # Thanks to Orgad Shaneh. Since the temp files from Clonezilla live won't take too much space, we just use /tmp/ to store these temp files. #if [ -w ./ ]; then -# ISOLNX_TMP="$(mktemp -d ./isolnx.XXXXXX)" +# ISOSYSLNX_TMP="$(mktemp -d ./isolnx.XXXXXX)" # WD_TMP="$(mktemp -d ./iso_wd.XXXXXX)" #else -# ISOLNX_TMP="$(mktemp -d /tmp/isolnx.XXXXXX)" +# ISOSYSLNX_TMP="$(mktemp -d /tmp/isolnx.XXXXXX)" # WD_TMP="$(mktemp -d /tmp/iso_wd.XXXXXX)" #fi -ISOLNX_TMP="$(mktemp -d /tmp/isolnx.XXXXXX)" -WD_TMP="$(mktemp -d /tmp/iso_wd.XXXXXX)" +ISOSYSLNX_TMP="$(mktemp -d /tmp/ocs_isosyslnx.XXXXXX)" +WD_TMP="$(mktemp -d /tmp/ocs_iso_wd.XXXXXX)" # trap clean_tmp_dir HUP INT QUIT TERM EXIT @@ -454,32 +470,6 @@ fi # -if [ "$template_mode" = "from-booting-live-media" ]; then - # From boot media, DEBIAN_ISO_TMP is LIVE_MEDIA - # Here we use -Lks to make it more accurate. - template_iso_size="$(LC_ALL=C du -Lks $LIVE_MEDIA | awk -F" " '{print $1}')" - # Exclude those dirs - exclude_dir_size="0" - for i in $mkiso_exclude_list_2; do - [ ! -d "$LIVE_MEDIA/$i" ] && continue - exclude_dir_size="$(($exclude_dir_size + $(LC_ALL=C du -Lks "$LIVE_MEDIA/$i" | awk -F" " '{print $1}')))" - done - template_iso_size="$(LC_ALL=C echo "scale=0; ($template_iso_size - $exclude_dir_size)/1024" | bc -l)" # converted as MB. -else - # From iso file - # Here we use -Lks to make it more accurate. - template_iso_size="$(LC_ALL=C du -Lks $DEBIAN_ISO | awk -F" " '{print $1}')" - # Exclude those dirs - exclude_dir_size="0" - for i in $mkiso_exclude_list_2; do - [ ! -d "$DEBIAN_ISO/$i" ] && continue - exclude_dir_size="$(($exclude_dir_size + $(LC_ALL=C du -Lks "$DEBIAN_ISO/$i" | awk -F" " '{print $1}')))" - done - template_iso_size="$(LC_ALL=C echo "scale=0; ($template_iso_size - $exclude_dir_size)/1024" | bc -l)" # converted as MB. -fi -target_iso_size="$(($template_iso_size + $img_size_sum))" - -# # Possible kernel/initrd paths are /casper (created by casper) or /live (created by live-initramfs) # Find the kernel and initrd in $DEBIAN_ISO_TMP/casper or $DEBIAN_ISO_TMP/live # Ex: $DEBIAN_ISO_TMP/casper/vmlinuz1, /$DEBIAN_ISO_TMP/casper/initrd1.img @@ -514,11 +504,34 @@ exit 1 fi +if [ "$template_mode" = "from-booting-live-media" ]; then + # From boot media (clonezilla live), DEBIAN_ISO_TMP is LIVE_MEDIA + # The dirs/files in Clonezilla live: + # -r--r--r-- 1 root root 117 2010-05-21 21:17 Clonezilla-Live-Version + # -r--r--r-- 1 root root 18K 2010-05-21 21:05 COPYING + # dr-xr-xr-x 2 root root 2.0K 2010-05-21 21:17 isolinux/ + # dr-xr-xr-x 2 root root 2.0K 2010-05-21 21:17 live/ + # dr-xr-xr-x 2 root root 2.0K 2010-05-21 21:17 syslinux/ + # dr-xr-xr-x 5 root root 2.0K 2010-05-21 21:17 utils/ + # We need all of them. + template_iso_size="$(LC_ALL=C du -Lmsc $LIVE_MEDIA/{Clonezilla-Live-Version,COPYING,isolinux,$sys_files_dir,syslinux,utils} | tail -n 1 | awk -F" " '{print $1}')" +else + # From iso file (debian-live-for-ocs.iso) + # The dirs/files in Debian live for OCS: + # dr-xr-xr-x 3 root root 4.0K 2010-05-28 18:03 doc/ + # dr-xr-xr-x 2 root root 4.0K 2010-05-28 18:03 isolinux/ + # dr-xr-xr-x 2 root root 2.0K 2010-05-28 18:03 live/ + # -r--r--r-- 1 root root 3.7K 2010-05-28 18:03 md5sum.txt + # We only need dirs isolinux and live only + template_iso_size="$(LC_ALL=C du -Lmsc $DEBIAN_ISO_TMP/{isolinux,$sys_files_dir} | tail -n 1 | awk -F" " '{print $1}')" +fi +target_iso_size="$(($template_iso_size + $img_size_sum))" + # -BOOT_ITEM_DIR=$ISOLNX_TMP/$sys_files_dir +BOOT_ITEM_DIR=$ISOSYSLNX_TMP/$sys_files_dir [ ! -d $BOOT_ITEM_DIR ] && mkdir $BOOT_ITEM_DIR echo -n "Copying the system files to working dir... This might take a few minutes... " -cp -af $DEBIAN_ISO_TMP/$sys_files_dir $ISOLNX_TMP/ +cp -af $DEBIAN_ISO_TMP/$sys_files_dir $ISOSYSLNX_TMP/ RC=$? if [ "$RC" -ne 0 ]; then [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE @@ -588,10 +601,13 @@ # Create the iso image file # isolinux should be rw, so we have to copy it, and exclude the one in iso image. -mkdir -p $ISOLNX_TMP/isolinux/ -# rsync -a --exclude f*.txt --exclude boot.cat --exclude isolinux.txt --exclude isolinux.bin --exclude splash.rle --exclude doc $DRBL_SCRIPT_PATH/pkg/syslinux/* $ISOLNX_TMP/isolinux/ +mkdir -p $ISOSYSLNX_TMP/isolinux/ $ISOSYSLNX_TMP/syslinux/ +# rsync -a --exclude f*.txt --exclude boot.cat --exclude isolinux.txt --exclude isolinux.bin --exclude splash.rle --exclude doc $DRBL_SCRIPT_PATH/pkg/syslinux/* $ISOSYSLNX_TMP/isolinux/ # we have to overwrite isolinux.bin since vesamenu.c32 should be same version with that. -cp -af $isolinux_file $pxelinux_simple_vesamenu $pxelinux_simple_menu $pxelinux_memdisk_file $pxelinux_bg_img $ocs_logo_img_syslinux $pxelinux_chain_file $ISOLNX_TMP/isolinux/ +# For isolinux +cp -af $isolinux_file $pxelinux_simple_vesamenu $pxelinux_simple_menu $pxelinux_memdisk_file $pxelinux_bg_img $ocs_logo_img_syslinux $pxelinux_chain_file $ISOSYSLNX_TMP/isolinux/ +# For syslinux +cp -af $pxelinux_simple_vesamenu $pxelinux_simple_menu $pxelinux_memdisk_file $pxelinux_bg_img $ocs_logo_img_syslinux $pxelinux_chain_file $ISOSYSLNX_TMP/syslinux/ etherboot_zlilo="$($query_pkglist_cmd drbl-etherboot 2>/dev/null | grep -E "eb-.*-etherboot-pci.zlilo$")" # we have to force it name as etherboot.zdsk, since isolinux only uses the "plain" ISO 9660 filenames, i.e. it does not support Rock Ridge or Joliet filenames. @@ -672,45 +688,55 @@ # if [ -n "$ocs_image" ]; then - ocs-live-boot-menu $ocs_live_boot_menu_option -l $lang_answer -f $VGA_MODE_DEF -b $bg_mode -k /$sys_files_dir/$krnfile -i /$sys_files_dir/$irdfile -m $ocs_logo_img_syslinux $boot_menu_opt --boot-param "$boot_param $live_extra_boot_param noswap nolocales ocs_live_run=\"$ocs_live_run\" ocs_live_extra_param=\"$ocs_live_extra_param\" ocs_live_keymap=\"$ocs_live_keymap\" ocs_live_batch=\"$ocs_live_batch\" ocs_lang=\"$ocs_lang\"" --title "clonezilla live with img $ocs_image" isolinux $ISOLNX_TMP/isolinux/ + # For isolinux + ocs-live-boot-menu $ocs_live_boot_menu_option -l $lang_answer -f $VGA_MODE_DEF -b $bg_mode -k /$sys_files_dir/$krnfile -i /$sys_files_dir/$irdfile -m $ocs_logo_img_syslinux $boot_menu_opt --boot-param "$boot_param $live_extra_boot_param $supp_boot_param_ocs_live_iso ocs_live_run=\"$ocs_live_run\" ocs_live_extra_param=\"$ocs_live_extra_param\" ocs_live_keymap=\"$ocs_live_keymap\" ocs_live_batch=\"$ocs_live_batch\" ocs_lang=\"$ocs_lang\"" --title "clonezilla live with img $ocs_image" isolinux $ISOSYSLNX_TMP/isolinux/ + # For syslinux + ocs-live-boot-menu $ocs_live_boot_menu_option -l $lang_answer -f $VGA_MODE_DEF -b $bg_mode -k /$sys_files_dir/$krnfile -i /$sys_files_dir/$irdfile -m $ocs_logo_img_syslinux $boot_menu_opt --boot-param "$boot_param $live_extra_boot_param $supp_boot_param_ocs_live_dev ocs_live_run=\"$ocs_live_run\" ocs_live_extra_param=\"$ocs_live_extra_param\" ocs_live_keymap=\"$ocs_live_keymap\" ocs_live_batch=\"$ocs_live_batch\" ocs_lang=\"$ocs_lang\"" --title "clonezilla live with img $ocs_image" syslinux $ISOSYSLNX_TMP/syslinux/ else - ocs-live-boot-menu $ocs_live_boot_menu_option -l $lang_answer -f $VGA_MODE_DEF -b $bg_mode -k /$sys_files_dir/$krnfile -i /$sys_files_dir/$irdfile -m $ocs_logo_img_syslinux $boot_menu_opt --boot-param "$boot_param $live_extra_boot_param noswap nolocales ocs_live_run=\"$ocs_live_run\" ocs_live_extra_param=\"$ocs_live_extra_param\" ocs_live_keymap=\"$ocs_live_keymap\" ocs_live_batch=\"$ocs_live_batch\" ocs_lang=\"$ocs_lang\"" isolinux $ISOLNX_TMP/isolinux/ + # For isolinux + ocs-live-boot-menu $ocs_live_boot_menu_option -l $lang_answer -f $VGA_MODE_DEF -b $bg_mode -k /$sys_files_dir/$krnfile -i /$sys_files_dir/$irdfile -m $ocs_logo_img_syslinux $boot_menu_opt --boot-param "$boot_param $live_extra_boot_param $supp_boot_param_ocs_live_iso ocs_live_run=\"$ocs_live_run\" ocs_live_extra_param=\"$ocs_live_extra_param\" ocs_live_keymap=\"$ocs_live_keymap\" ocs_live_batch=\"$ocs_live_batch\" ocs_lang=\"$ocs_lang\"" isolinux $ISOSYSLNX_TMP/isolinux/ + # For syslinux + ocs-live-boot-menu $ocs_live_boot_menu_option -l $lang_answer -f $VGA_MODE_DEF -b $bg_mode -k /$sys_files_dir/$krnfile -i /$sys_files_dir/$irdfile -m $ocs_logo_img_syslinux $boot_menu_opt --boot-param "$boot_param $live_extra_boot_param $supp_boot_param_ocs_live_dev ocs_live_run=\"$ocs_live_run\" ocs_live_extra_param=\"$ocs_live_extra_param\" ocs_live_keymap=\"$ocs_live_keymap\" ocs_live_batch=\"$ocs_live_batch\" ocs_lang=\"$ocs_lang\"" syslinux $ISOSYSLNX_TMP/syslinux/ fi # -echo "Preparing syslinux.exe, syslinux, makeboot.bat and makeboot.sh in dir utils... " +echo "Preparing syslinux, syslinux.exe, makeboot.sh, and makeboot.bat in dir utils... " # If it's in Clonezilla live environment, we have those files if [ -e "$LIVE_MEDIA/utils/linux/syslinux" -a \ -e "$LIVE_MEDIA/utils/mbr/mbr.bin" -a \ -e "$LIVE_MEDIA/utils/win32/syslinux.exe" ]; then - cp -rf $LIVE_MEDIA/utils $ISOLNX_TMP + cp -rf $LIVE_MEDIA/utils $ISOSYSLNX_TMP else - put_syslinux_makeboot_for_usb_flash $ISOLNX_TMP + put_syslinux_makeboot_for_usb_flash $ISOSYSLNX_TMP fi -if [ -d "$ISOLNX_TMP/utils" ]; then - utils_files_dir_graft_point="/utils/=$ISOLNX_TMP/utils/" +if [ -d "$ISOSYSLNX_TMP/utils" ]; then + utils_files_dir_graft_point="/utils/=$ISOSYSLNX_TMP/utils/" fi # put version tag # The content is like clonezilla-live-20070308 -echo "clonezilla-live-${iso_label_tag}" > $ISOLNX_TMP/Clonezilla-Live-Version -echo "This Clonezilla live iso file was created by this command:" >> $ISOLNX_TMP/Clonezilla-Live-Version -echo "$prog $prog_option" >> $ISOLNX_TMP/Clonezilla-Live-Version +echo "clonezilla-live-${iso_label_tag}" > $ISOSYSLNX_TMP/Clonezilla-Live-Version +echo "This Clonezilla live iso file was created by this command:" >> $ISOSYSLNX_TMP/Clonezilla-Live-Version +echo "$prog $prog_option" >> $ISOSYSLNX_TMP/Clonezilla-Live-Version # $sys_files_dir maybe /casper, /live or /isolinux. If it is isolinux, we can not list them twice otherwise mkisofs will go wrong. if [ "$sys_files_dir" != "isolinux" ]; then - sys_files_dir_graft_point="/isolinux/=$ISOLNX_TMP/isolinux/ /$sys_files_dir/=$ISOLNX_TMP/$sys_files_dir/" + sys_files_dir_graft_point="/isolinux/=$ISOSYSLNX_TMP/isolinux/ /syslinux/=$ISOSYSLNX_TMP/syslinux/ /$sys_files_dir/=$ISOSYSLNX_TMP/$sys_files_dir/" else - sys_files_dir_graft_point="/isolinux/=$ISOLNX_TMP/isolinux/" + sys_files_dir_graft_point="/isolinux/=$ISOSYSLNX_TMP/isolinux/ /syslinux/=$ISOSYSLNX_TMP/syslinux/" fi # If template_mode="from-booting-live-media", then there is /COPYING and /Clonezilla-Live-Version, then we should not assign that. doc_insert_in_root="" -if [ ! -e "$DEBIAN_ISO_TMP/COPYING" ]; then +if [ -e "$DEBIAN_ISO_TMP/COPYING" ]; then + doc_insert_in_root="/COPYING=$DEBIAN_ISO_TMP/COPYING" +else doc_insert_in_root="/COPYING=$DRBL_SCRIPT_PATH/doc/COPYING" fi -if [ ! -e "$DEBIAN_ISO_TMP/Clonezilla-Live-Version" ]; then - doc_insert_in_root="$doc_insert_in_root /Clonezilla-Live-Version=$ISOLNX_TMP/Clonezilla-Live-Version" +if [ -e "$DEBIAN_ISO_TMP/Clonezilla-Live-Version" ]; then + doc_insert_in_root="$doc_insert_in_root /Clonezilla-Live-Version=$DEBIAN_ISO_TMP/Clonezilla-Live-Version" +else + doc_insert_in_root="$doc_insert_in_root /Clonezilla-Live-Version=$ISOSYSLNX_TMP/Clonezilla-Live-Version" fi # @@ -730,7 +756,7 @@ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ $mkiso_exclude_opt \ - -graft-points $DEBIAN_ISO_TMP \ + -graft-points \ $sys_files_dir_graft_point \ $utils_files_dir_graft_point \ $doc_insert_in_root \ @@ -740,20 +766,48 @@ " echo "DEBIAN_ISO_TMP=$DEBIAN_ISO_TMP" -echo "sys_files_dir_graft_point=$sys_files_dir_graft_point" -echo "utils_files_dir_graft_point=$utils_files_dir_graft_point" -echo "doc_insert_in_root=$doc_insert_in_root" -echo "ocs_imgs_with_abs_path=$ocs_imgs_with_abs_path" -echo "custom_ocs_opt=$custom_ocs_opt" -echo "include_dir_graft_point=$include_dir_graft_point" +echo "mkiso_exclude_opt = $mkiso_exclude_opt" +echo "allow_limited_size_opt = $allow_limited_size_opt" +echo "sys_files_dir_graft_point = $sys_files_dir_graft_point" +echo "utils_files_dir_graft_point = $utils_files_dir_graft_point" +echo "doc_insert_in_root = $doc_insert_in_root" +echo "ocs_imgs_with_abs_path = $ocs_imgs_with_abs_path" +echo "custom_ocs_opt = $custom_ocs_opt" +echo "include_dir_graft_point = $include_dir_graft_point" echo echo "ocs_image=$ocs_image" echo "image_path=$image_path" -#read +read + +# if [ -z "$ORIGINAL_INSERT_MODE" ];then +# A_LINE=`grep 'append initrd=/live/initrd.img'/tmp/ocs_isos*/isolinux/isolinux.cfg | sed '2,$d'` +# PARAM=`echo "$A_LINE" | sed 's/.*ocs_live_extra_param="\([^"]*\)".*/\1/'` +# KEYMAP=`echo "$A_LINE" | sed 's/.*ocs_live_keymap="\([^"]*\)".*/\1/'` +# LANG=`echo "$A_LINE" | sed 's/.*ocs_lang="\([^"]*\)".*/\1/'` +# if [ -z "$going2RAM" ];then +# #cp /restorecd/isolinux-restore-cd.cfg /tmp/ocs_isos*/isolinux/isolinux.cfg +# cfg_orig=/restorecd/isolinux-restore-cd.cfg +# else +# #cp /restorecd/isolinux-restore-cd-ram.cfg /tmp/ocs_isos*/isolinux/isolinux.cfg +# cfg_orig=/restorecd/isolinux-restore-cd-ram.cfg +# fi +# # replace with current values +# sed "s|ocs_live_extra_param=\"[^\"]*\"|ocs_live_extra_param=\"$PARAM\"| +# s|ocs_live_keymap=\"[^\"]*\"|ocs_live_keymap=\"$KEYMAP\"| +# s|ocs_lang=\"[^\"]*\"|ocs_lang=\"$LANG\"| +# " "$cfg_orig" > /tmp/ocs_isos*/isolinux/isolinux.cfg -cust-menu -publisher "DRBL/Clonezilla http://drbl.name http://clonezilla.org" -V "$iso_label_tag" "$going2RAM" + cust-menu -publisher "DRBL/Clonezilla http://drbl.name http://clonezilla.org" -V "$iso_label_tag" "$ORIGINAL_INSERT_MODE" "$going2RAM" +# fi +# Fix missing "boot=live" +for n in /tmp/ocs_isos*/isolinux/isolinux.cfg /tmp/ocs_isos*/syslinux/syslinux.cfg;do +if [ -e "$n" ];then +sed 's/boot=[^ ]* // +s{initrd=/live/initrd.img{initrd=/live/initrd.img boot=live {' "$n" > "$n".tmp && mv "$n".tmp "$n" +fi +done if [ -n "$going2RAM" ];then ocs_imgs_with_abs_path='' @@ -774,7 +828,7 @@ -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ $mkiso_exclude_opt \ - -graft-points $DEBIAN_ISO_TMP \ + -graft-points \ $sys_files_dir_graft_point \ $utils_files_dir_graft_point \ $doc_insert_in_root \ @@ -799,12 +853,7 @@ [ "$BOOTUP" = "color" ] && $SETCOLOR_FAILURE echo "Something went wrong!" [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL - umount $DEBIAN_ISO_TMP &>/dev/null - if [ ! -z "$DEBIAN_ISO_TMP" -a \ - "$template_mode" = "from-downloaded-live-media" ]; then - # We put some tmp file when template_mode is from-downloaded-live-media - rm -rf $DEBIAN_ISO_TMP - fi + clean_tmp_dir [ -n "$target_iso" -a -f "$target_iso" ] && rm -fv $target_iso [ -n "$ISOLNX_TMP" -a -d "$ISOLNX_TMP" ] && rm -rf $ISOLNX_TMP [ -n "$WD_TMP" -a -d "$WD_TMP" ] && rm -rf $WD_TMP @@ -817,13 +866,7 @@ # Clean the tmp working directory echo "Cleaning tmp dirs..." -if [ ! -z "$DEBIAN_ISO_TMP" -a \ - "$template_mode" = "from-downloaded-live-media" ]; then - # We put some tmp file when template_mode is from-downloaded-live-media - rm -rf $DEBIAN_ISO_TMP -fi -[ -n "$ISOLNX_TMP" -a -d "$ISOLNX_TMP" ] && rm -rf $ISOLNX_TMP -[ -n "$WD_TMP" -a -d "$WD_TMP" ] && rm -rf $WD_TMP +clean_tmp_dir # if [ -e "$target_iso" ]; then