77 |
check_file_size_in_ocs_image() { |
check_file_size_in_ocs_image() { |
78 |
local img_path="$1" |
local img_path="$1" |
79 |
local size_t |
local size_t |
80 |
|
local size_t_tot=0 |
81 |
for ifile in $img_path/*; do |
for ifile in $img_path/*; do |
82 |
size_t="$(du -Lms $ifile | awk -F" " '{print $1}')" |
size_t="$(du -Lms $ifile | awk -F" " '{print $1}')" |
83 |
if [ "$size_t" -gt "$FILE_LIMIT" ]; then |
size_t_tot=$((size_t_tot+size_t)) |
84 |
|
done |
85 |
|
if [ "$size_t_tot" -gt "$FILE_LIMIT" ]; then |
86 |
################################################################################ |
################################################################################ |
87 |
# Section edited by S. Georgaras <sng@hellug.gr> |
# Section edited by S. Georgaras <sng@hellug.gr> |
88 |
|
|
100 |
# echo "Abort!" |
# echo "Abort!" |
101 |
# exit 2 |
# exit 2 |
102 |
# esac |
# esac |
103 |
whiptail --backtitle Clonezilla-SysRescCD --title ' Excessive Image Size ' --yesno "The image file \"$(basename ${ifile%/})\" is too large ($size_t MB) and cannot be processed!!! |
whiptail --backtitle Clonezilla-SysRescCD --title ' Excessive Image Size ' --yesno "The image file \"$(basename ${1})\" is too large ($size_t_tot MB) and |
104 |
|
$msg_mkisofs_unable_process_that |
105 |
|
|
106 |
Do you want to create a 8GB DVD instead?" 0 60 |
$msg_are_u_sure_u_want_to_continue" 0 60 |
107 |
if [ $? -eq 1 ];then |
if [ $? -eq 1 ];then |
108 |
exit 1 |
exit 1 |
109 |
fi |
fi |
110 |
going2RAM="prog_only" |
# going2RAM="prog_only" |
111 |
break |
break |
|
################################################################################ |
|
112 |
fi |
fi |
113 |
done |
# done |
114 |
|
################################################################################ |
115 |
} |
} |
116 |
|
|
117 |
# |
# |
802 |
# s|ocs_lang=\"[^\"]*\"|ocs_lang=\"$LANG\"| |
# s|ocs_lang=\"[^\"]*\"|ocs_lang=\"$LANG\"| |
803 |
# " "$cfg_orig" > /tmp/ocs_isos*/isolinux/isolinux.cfg |
# " "$cfg_orig" > /tmp/ocs_isos*/isolinux/isolinux.cfg |
804 |
|
|
805 |
cust-menu -publisher "DRBL/Clonezilla http://drbl.name http://clonezilla.org" -V "$iso_label_tag" "$ORIGINAL_INSERT_MODE" "$going2RAM" |
# cust-menu -publisher "DRBL/Clonezilla http://drbl.name http://clonezilla.org" -V "$iso_label_tag" "$ORIGINAL_INSERT_MODE" "$going2RAM" |
806 |
|
cust-menu -publisher "DRBL/Clonezilla http://drbl.name http://clonezilla.org" -V "$iso_label_tag" "$ORIGINAL_INSERT_MODE" |
807 |
# fi |
# fi |
808 |
|
|
809 |
# Fix missing "boot=live" |
# Fix missing "boot=live" |
814 |
fi |
fi |
815 |
done |
done |
816 |
|
|
817 |
if [ -n "$going2RAM" ];then |
# if [ -n "$going2RAM" ];then |
818 |
ocs_imgs_with_abs_path='' |
# ocs_imgs_with_abs_path='' |
819 |
fi |
# fi |
820 |
|
|
821 |
if [ -e /tmp/isodata ];then |
if [ -e /tmp/isodata ];then |
822 |
iso_label_tag=`sed '2d' /tmp/isodata` |
iso_label_tag=`sed '2d' /tmp/isodata` |
885 |
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
[ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL |
886 |
fi |
fi |
887 |
|
|
888 |
|
# |
889 |
################################################################################ |
# ################################################################################ |
890 |
# Section edited by S. Georgaras <sng@hellug.gr> |
# # Section edited by S. Georgaras <sng@hellug.gr> |
891 |
ifile1=`dirname "$ifile"` |
# ifile1=`dirname "$ifile"` |
892 |
if [ "$going2RAM" = "prog_only" ];then |
# if [ "$going2RAM" = "prog_only" ];then |
893 |
whiptail --backtitle Clonezilla-SysRescCD --title ' Info ' --msgbox "The ISO file has been saved as $target_iso |
# whiptail --backtitle Clonezilla-SysRescCD --title ' Info ' --msgbox "The ISO file has been saved as $target_iso |
894 |
|
# |
895 |
This ISO file contains the program and settings to restore your image |
# This ISO file contains the program and settings to restore your image |
896 |
($(basename ${ifile%/})), but not the image itself. Now you have to burn |
# ($(basename ${ifile%/})), but not the image itself. Now you have to burn |
897 |
the ISO file to a 8GB DVD and then add the image file to it. |
# the ISO file to a 8GB DVD and then add the image file to it. |
898 |
|
# |
899 |
These are the commands to execute: |
# These are the commands to execute: |
900 |
cd /home/partimag |
# cd /home/partimag |
901 |
growisofs -Z \$(what-cd -dwb)=$target_iso |
# growisofs -Z \$(what-cd -dwb)=$target_iso |
902 |
eject \$(what-cd -dwb) |
# eject \$(what-cd -dwb) |
903 |
growisofs -M \$(what-cd -dwb) -R -J \\ |
# growisofs -M \$(what-cd -dwb) -R -J \\ |
904 |
-V \"$iso_label_tag\" --publisher \"$isoPublisher\" \\ |
# -V \"$iso_label_tag\" --publisher \"$isoPublisher\" \\ |
905 |
-graft-points /$(basename ${ifile%/})/=${ifile%/} |
# -graft-points /$(basename ${ifile%/})/=${ifile%/} |
906 |
|
# |
907 |
Alternatively, you can excute the file /tmp/burnISO |
# Alternatively, you can excute the file /tmp/burnISO |
908 |
|
# |
909 |
NOTE: \$(what-cd -dwb) will use your first DVD-writer. In case you want |
# NOTE: \$(what-cd -dwb) will use your first DVD-writer. In case you want |
910 |
to use another device, you have to replace \$(what-cd -dwb) with |
# to use another device, you have to replace \$(what-cd -dwb) with |
911 |
that device name e.g. /dev/hdd |
# that device name e.g. /dev/hdd |
912 |
" 0 0 |
# " 0 0 |
913 |
fi |
# fi |
914 |
|
# |
915 |
echo "#!/bin/bash" > /tmp/burnISO |
# echo "#!/bin/bash" > /tmp/burnISO |
916 |
echo "eject \$(what-cd -dwb)" >> /tmp/burnISO |
# echo "eject \$(what-cd -dwb)" >> /tmp/burnISO |
917 |
echo "echo -n \"Place an empty DVD in the DVD-writer and press ENTER \"" >> /tmp/burnISO |
# echo "echo -n \"Place an empty DVD in the DVD-writer and press ENTER \"" >> /tmp/burnISO |
918 |
echo "read" >> /tmp/burnISO |
# echo "read" >> /tmp/burnISO |
919 |
echo "cd /home/partimag" >> /tmp/burnISO |
# echo "cd /home/partimag" >> /tmp/burnISO |
920 |
echo "growisofs -Z \$(what-cd -dwb)=$target_iso" >> /tmp/burnISO |
# echo "growisofs -Z \$(what-cd -dwb)=$target_iso" >> /tmp/burnISO |
921 |
echo "eject \$(what-cd -dwb)" >> /tmp/burnISO |
# echo "eject \$(what-cd -dwb)" >> /tmp/burnISO |
922 |
echo "echo \"The medium must now be ejected and reinserted into\"" >> /tmp/burnISO |
# echo "echo \"The medium must now be ejected and reinserted into\"" >> /tmp/burnISO |
923 |
echo "echo \"the DVD-writer for the burning process to continue\"" >> /tmp/burnISO |
# echo "echo \"the DVD-writer for the burning process to continue\"" >> /tmp/burnISO |
924 |
echo "echo -n \"Place reload the DVD in the DVD-writer and press ENTER \"" >> /tmp/burnISO |
# echo "echo -n \"Place reload the DVD in the DVD-writer and press ENTER \"" >> /tmp/burnISO |
925 |
echo "read" >> /tmp/burnISO |
# echo "read" >> /tmp/burnISO |
926 |
echo "growisofs -M \$(what-cd -dwb) -R -J \\" >> /tmp/burnISO |
# echo "growisofs -M \$(what-cd -dwb) -R -J \\" >> /tmp/burnISO |
927 |
echo "-V \"$iso_label_tag\" --publisher \"$isoPublisher\" \\" >> /tmp/burnISO |
# echo "-V \"$iso_label_tag\" --publisher \"$isoPublisher\" \\" >> /tmp/burnISO |
928 |
echo "-graft-points /$(basename ${ifile%/})/=${ifile%/}" >> /tmp/burnISO |
# echo "-graft-points /$(basename ${ifile%/})/=${ifile%/}" >> /tmp/burnISO |
929 |
chmod +x /tmp/burnISO |
# chmod +x /tmp/burnISO |
930 |
|
# |
931 |
################################################################################ |
# ################################################################################ |
932 |
|
# |