[syslinux] Alternating boot default entry every reboot

james harvey jamespharvey20 at gmail.com
Thu Oct 6 21:41:37 PDT 2016


Not sure iso/syslinux directly has a way to do this, but I did find a
way to have a system act like you're saying.

I don't want it to automatically alternate, I want to have a command
to run that will change the default.  (Remote system.)

=====
#!/bin/bash
sudo bash -c "sed -i '0,/^DEFAULT .*$/{s/^DEFAULT .*/DEFAULT
terra-snapper/}' /boot/syslinux/syslinux.cfg"
sudo systemctl reboot
=====

(Note that's 3 lines, the second line wraps to two lines in this email.)

If clonezilla (not even sure what that is) uses systemd, it would be
easy to modify this into a systemd .service file which would auto-run
after boot.  You wouldn't need sudo anymore, and you wouldn't want the
reboot command or it would auto reboot during the boot process.


On Fri, Oct 7, 2016 at 12:24 AM, Brendon Costa via Syslinux
<syslinux at zytor.com> wrote:
> Hi,
>
> I am currently using isolinux (syslinux-6.03) in a clonezilla setup. It
> boots fine, however I want to have a setup where the default boot selection
> alternates every boot.
>
> * First boot : Default is menu item 0
> * Second boot : Default is menu item 1
> * Third boot : Default is menu item 0
> ...
>
> The idea is that when it is booted into clonezilla the clonezilla script
> checks if the system needs to be restored by mounting NFS and checking for
> existence of a file. After clonezilla has restored it will reboot and then
> the isolinux will boot the native file system (Windows, OSX or Linux). Once
> the native OS has restarted, then isolinux will again boot clonezilla and
> the cycle continues every time you reboot.
>
> I have this clonezilla + isolinux installed on a bootable USB.
>
> I know this is possible with GRUB:
> http://unix.stackexchange.com/a/110539
>
> however from what I understand GRUB will not work correctly from the
> bootable USB on all hardware, which is why we use isolinux.
>
> 1) Is there any way I can achieve this currently in isolinux that I did not
> see looking at the docs?
>
> 2) If not, is this possible (obviously not possible for read-only CD, but
> bootable USB I imagine yes) and would a patch be welcome to support such a
> feature?
>
>
> Thanks,
> Brendon.
> _______________________________________________
> Syslinux mailing list
> Submissions to Syslinux at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux


More information about the Syslinux mailing list