116 |
|
|
117 |
# |
# |
118 |
clean_tmp_dir() { |
clean_tmp_dir() { |
119 |
[ -d "$ISOSYSLNX_TMP" -a -n "$(echo $ISOSYSLNX_TMP | grep "ocs_isosyslnx")" ] && rm -rf $ISOSYSLNX_TMP |
if [ -d "$DEBIAN_ISO_TMP" -a -n "$DEBIAN_ISO_TMP" ]; then |
120 |
[ -d "$WD_TMP" -a -n "$(echo $WD_TMP | grep "ocs_iso_wd")" ] && rm -rf $WD_TMP |
# Force to unmount, althouth it might have beed unmounted, or maybe not (ctrl-c interrupt). |
121 |
[ -d "$DEBIAN_ISO_TMP" ] && umount $DEBIAN_ISO_TMP &>/dev/null && rmdir $DEBIAN_ISO_TMP |
umount $DEBIAN_ISO_TMP &>/dev/null |
122 |
|
rmdir $DEBIAN_ISO_TMP &>/dev/null |
123 |
|
fi |
124 |
|
if [ -d "$ISOSYSLNX_TMP" -a -n "$(echo $ISOSYSLNX_TMP | grep "ocs_isosyslnx")" ]; then |
125 |
|
rm -rf $ISOSYSLNX_TMP |
126 |
|
fi |
127 |
|
if [ -d "$WD_TMP" -a -n "$(echo $WD_TMP | grep "ocs_iso_wd")" ]; then |
128 |
|
rm -rf $WD_TMP |
129 |
|
fi |
130 |
} # End of clean_tmp_dir |
} # End of clean_tmp_dir |
131 |
|
|
132 |
# |
# |
617 |
# 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/ |
# 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/ |
618 |
# we have to overwrite isolinux.bin since vesamenu.c32 should be same version with that. |
# we have to overwrite isolinux.bin since vesamenu.c32 should be same version with that. |
619 |
# For isolinux |
# For isolinux |
620 |
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/ |
cp -af $isolinux_file $pxelinux_simple_vesamenu $pxelinux_simple_menu $pxelinux_memdisk_file $pxelinux_bg_img $ocs_logo_img_png $pxelinux_chain_file $ISOSYSLNX_TMP/isolinux/ |
621 |
# For syslinux |
# For syslinux |
622 |
cp -af $pxelinux_simple_vesamenu $pxelinux_simple_menu $pxelinux_memdisk_file $pxelinux_bg_img $ocs_logo_img_syslinux $pxelinux_chain_file $ISOSYSLNX_TMP/syslinux/ |
cp -af $pxelinux_simple_vesamenu $pxelinux_simple_menu $pxelinux_memdisk_file $pxelinux_bg_img $ocs_logo_img_png $pxelinux_chain_file $ISOSYSLNX_TMP/syslinux/ |
623 |
|
# Copy the EFI boot files |
624 |
|
if [ -e "$DEBIAN_ISO_TMP/EFI/boot/bootia32.efi" -a -e "$DEBIAN_ISO_TMP/EFI/boot/bootx64.efi" ]; then |
625 |
|
cp -af $DEBIAN_ISO_TMP/EFI $ISOSYSLNX_TMP/ |
626 |
|
fi |
627 |
|
|
628 |
etherboot_zlilo="$($query_pkglist_cmd drbl-etherboot 2>/dev/null | grep -E "eb-.*-etherboot-pci.zlilo$")" |
etherboot_zlilo="$($query_pkglist_cmd drbl-etherboot 2>/dev/null | grep -E "eb-.*-etherboot-pci.zlilo$")" |
629 |
# 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. |
# 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. |
643 |
done |
done |
644 |
fi |
fi |
645 |
# same reason, we have to use different name in isolinux |
# same reason, we have to use different name in isolinux |
646 |
|
# gPXE is deprecated, we will use iPXE. We keep this gpxe part for ref only. |
647 |
gpxe_lkn="$($query_pkglist_cmd gpxe 2>/dev/null | grep -E "gpxe.lkrn$")" |
gpxe_lkn="$($query_pkglist_cmd gpxe 2>/dev/null | grep -E "gpxe.lkrn$")" |
648 |
if [ -n "$gpxe_lkn" ]; then |
if [ -n "$gpxe_lkn" ]; then |
649 |
# This is run in DRBL server |
# This is run in DRBL server |
658 |
done |
done |
659 |
fi |
fi |
660 |
# same reason, we have to use different name in isolinux |
# same reason, we have to use different name in isolinux |
661 |
|
ipxe_lkn="$($query_pkglist_cmd ipxe 2>/dev/null | grep -E "ipxe.lkrn$")" |
662 |
|
if [ -n "$ipxe_lkn" ]; then |
663 |
|
# This is run in DRBL server |
664 |
|
cp -af $ipxe_lkn $BOOT_ITEM_DIR/ipxe.lkn |
665 |
|
else |
666 |
|
# This is run in Clonezilla live with casper or live mechanism |
667 |
|
for i in $live_sys_files_dir_list; do |
668 |
|
if [ -e "$LIVE_MEDIA/$i/ipxe.lkn" ]; then |
669 |
|
cp -af $LIVE_MEDIA/$i/ipxe.lkn $BOOT_ITEM_DIR/ipxe.lkn |
670 |
|
break |
671 |
|
fi |
672 |
|
done |
673 |
|
fi |
674 |
|
# same reason, we have to use different name in isolinux |
675 |
if [ -e "$fdos_img_src" ] ; then |
if [ -e "$fdos_img_src" ] ; then |
676 |
cp -af $fdos_img_src $BOOT_ITEM_DIR/freedos.img |
cp -af $fdos_img_src $BOOT_ITEM_DIR/freedos.img |
677 |
else |
else |
719 |
|
|
720 |
# |
# |
721 |
if [ -n "$ocs_image" ]; then |
if [ -n "$ocs_image" ]; then |
722 |
|
# Image is included |
723 |
# For isolinux |
# For isolinux |
724 |
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/ |
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_png $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/ |
725 |
# For syslinux |
# For syslinux |
726 |
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/ |
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_png $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/ |
727 |
|
# For grub2 efi |
728 |
|
if [ -e "$ISOSYSLNX_TMP/EFI/boot/bootia32.efi" -a -e "$ISOSYSLNX_TMP/EFI/boot/bootx64.efi" ]; then |
729 |
|
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_png $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" grub2-efi $ISOSYSLNX_TMP/EFI/boot/ |
730 |
|
fi |
731 |
else |
else |
732 |
|
# No image is included |
733 |
# For isolinux |
# For isolinux |
734 |
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/ |
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_png $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/ |
735 |
# For syslinux |
# For syslinux |
736 |
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/ |
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_png $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/ |
737 |
|
# For grub2 efi |
738 |
|
if [ -e "$ISOSYSLNX_TMP/EFI/boot/bootia32.efi" -a -e "$ISOSYSLNX_TMP/EFI/boot/bootx64.efi" ]; then |
739 |
|
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_png $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\"" grub2-efi $ISOSYSLNX_TMP/EFI/boot/ |
740 |
|
fi |
741 |
fi |
fi |
742 |
|
|
743 |
# |
# |
748 |
-e "$LIVE_MEDIA/utils/win32/syslinux.exe" ]; then |
-e "$LIVE_MEDIA/utils/win32/syslinux.exe" ]; then |
749 |
cp -rf $LIVE_MEDIA/utils $ISOSYSLNX_TMP |
cp -rf $LIVE_MEDIA/utils $ISOSYSLNX_TMP |
750 |
else |
else |
751 |
put_syslinux_makeboot_for_usb_flash $ISOSYSLNX_TMP |
isolinux_ver="$(LC_ALL=C strings $ISOSYSLNX_TMP/isolinux/isolinux.bin | grep "^ISOLINUX" | awk -F" " '{print $2}')" |
752 |
|
put_syslinux_makeboot_for_usb_flash $ISOSYSLNX_TMP $isolinux_ver |
753 |
fi |
fi |
754 |
if [ -d "$ISOSYSLNX_TMP/utils" ]; then |
if [ -d "$ISOSYSLNX_TMP/utils" ]; then |
755 |
utils_files_dir_graft_point="/utils/=$ISOSYSLNX_TMP/utils/" |
utils_files_dir_graft_point="/utils/=$ISOSYSLNX_TMP/utils/" |
768 |
sys_files_dir_graft_point="/isolinux/=$ISOSYSLNX_TMP/isolinux/ /syslinux/=$ISOSYSLNX_TMP/syslinux/" |
sys_files_dir_graft_point="/isolinux/=$ISOSYSLNX_TMP/isolinux/ /syslinux/=$ISOSYSLNX_TMP/syslinux/" |
769 |
fi |
fi |
770 |
|
|
771 |
|
# |
772 |
|
if [ -d "$ISOSYSLNX_TMP/EFI" ]; then |
773 |
|
sys_files_dir_graft_point="$sys_files_dir_graft_point /EFI/=$ISOSYSLNX_TMP/EFI" |
774 |
|
fi |
775 |
|
|
776 |
# If template_mode="from-booting-live-media", then there is /COPYING and /Clonezilla-Live-Version, then we should not assign that. |
# If template_mode="from-booting-live-media", then there is /COPYING and /Clonezilla-Live-Version, then we should not assign that. |
777 |
doc_insert_in_root="" |
doc_insert_in_root="" |
778 |
if [ -e "$DEBIAN_ISO_TMP/COPYING" ]; then |
if [ -e "$DEBIAN_ISO_TMP/COPYING" ]; then |
877 |
rm /tmp/isodata 2>/dev/null |
rm /tmp/isodata 2>/dev/null |
878 |
fi |
fi |
879 |
|
|
880 |
|
# Remove the existing iso |
881 |
|
[ -e "$target_iso" ] && rm -f $target_iso |
882 |
|
|
883 |
# make iso file |
# make iso file |
884 |
genisoimage \ |
genisoimage \ |
885 |
-A "Clonezilla live CD" \ |
-A "Clonezilla live CD" \ |
916 |
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
917 |
clean_tmp_dir |
clean_tmp_dir |
918 |
[ -n "$target_iso" -a -f "$target_iso" ] && rm -fv $target_iso |
[ -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 |
|
919 |
echo "$msg_program_stop" |
echo "$msg_program_stop" |
920 |
exit 1 |
exit 1 |
921 |
fi |
fi |