Hello,
can you please provide sample of the solution on how to copy the FINAL step Clonezilla to run bash script
copyfile.sh AND where to store this file.
cp C:\demo\sample.exe C:\sample.exe
and restart clonezilla
DONE
for this file grub.cfg
set pref=/boot/grub
set default="0"
if loadfont $prefix/unicode.pf2; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi
set timeout="2"
set hidden_timeout_quiet=false
if background_image $prefix/ocswp-grub2.png; then
set color_normal=black/black
set color_highlight=magenta/black
else
set color_normal=cyan/blue
set color_highlight=white/blue
fi
menuentry --hotkey=R " RAM VERSION, ::: Restore :::"{
search --set -f /live/vmlinuz
linux /live/vmlinuz boot=live config noswap edd=on nomodeset noprompt locales=en_US.UTF-8 keyboard-layouts=en ocs_live_batch="yes" ocs_prerun="dhclient -v" ocs_prerun1="sleep 2" ocs_prerun2="sudo mount -t cifs "//10.20.40.10/images" /home/partimag -o user="administrator",password="img",vers=1.0" ocs_prerun3="sleep 2" vga=788 toram=live,syslinux nosplash ocs_live_run="ocs-sr -g /dev/sda1 -e1 /dev/sda1 -e2 -r -j2 -scr -p $2 restoredisk $3 $4"
initrd /live/initrd.img
}
menuentry --hotkey=R "RAM VERSION, ::: Backup :::"{
search --set -f /live/vmlinuz
linux /live/vmlinuz boot=live config noswap edd=on nomodeset noprompt locales=en_US.UTF-8 keyboard-layouts=en ocs_live_batch="yes" ocs_prerun="dhclient -v" ocs_prerun1="sleep 2" ocs_prerun2="sudo mount -t cifs "//10.20.40.10/images" /home/partimag -o user="administrator",password="img",vers=1.0" ocs_prerun3="sleep 2" vga=788 toram=live,syslinux nosplash ocs_live_run="sudo ocs-sr -q2 -j2 -z1p -i 4096 -sfsck -scs -senc -p $2 savedisk $3 $4"
initrd /live/initrd.img
}
Many thanks for your help !
You can use boot parameter ocs_postrun to assign the file to be run:
https://clonezilla.org/fine-print-live-doc.php?path=./clonezilla-live/doc/99_Misc/00_live-boot-parameters.doc#00_live-boot-parameters.doc
As for where to store this file, it depends on the media which you want to put, and how you mount it.
If it's in USB flash drive, normally the path "/run/live/medium/" after booting Clonezilla live is corresponding to the root of your USB flash drive. You can try to put the file in the root on your USB flash drive and set, like:
ocs_postrun2="bash /run/live/medium/copyfile.sh".
However, I believe you need more ocs_postrun* to mount the partition which you want to access the files.
Steven