Menu

Trying to create a script to create an image and iso

GGG
2025-06-14
2025-06-21
  • GGG

    GGG - 2025-06-14

    Hello,

    I'm working on a bash script that automates creating a clonezilla image, and a clonezilla recovery iso.

    Syslinux and grub can boot and run the script fine, and ocs-sr creates an image in a folder, however the script doesn't fully complete because after ocs-sr finishes creating the image folder, it then shows an interactive menu asking me if i want to power off, reboot, or cmd.

    I've tried adding -b -batch --batch etc, and "ocs_live_batch=yes", and other things, but the script still wont progress after running ocs-sr.

    What am I doing wrong?

    Kind Regards, Thanks

    syslinux.cfg

    LABEL run_script
    MENU LABEL RUN SCRIPT
    KERNEL /live/vmlinuz
    APPEND boot=live union=overlay username=user config components quiet noswap edd=on nomodeset enforcing=0 noprompt vga=788 ip= nosplash net.ifnames=0 splash i915.blacklist=yes radeonhd.blacklist=yes nouveau.blacklist=yes vmwgfx.enable_fbdev=1 keyboard-layouts=uk locales=en_GB.UTF-8 loglevel=3 ocs_1_cpu_udev ocs_live_batch=yes ocs_live_run="sudo bash /run/live/medium/script.sh"
    INITRD /live/initrd.img

    script.sh

    echo -e "Starting disk image creation..."
    ocs-sr --batch -q2 -j2 -nogui -z9p -sfsck -scs -senc savedisk "$IMAGE_NAME" "$SRC_DISK"

    Breaks here, and asks if i want to power off etc, and doesn't continue the script......

    echo -e "Creating recovery ISO..."
    ocs-live-dev -g auto -e1 auto -e2 auto -k1 -scr --batch -p noprompt \
    --recovery-iso \
    --recovery-name "$IMAGE_NAME" \
    --language en_GB.UTF-8 \
    --keymap NONE \
    --keyboard-layout UK \
    --iso "$CZ_ISO_DIR"

     
  • Steven Shiau

    Steven Shiau - 2025-06-21

    So where do the variables "$IMAGE_NAME" and "$SRC_DISK" come from?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.