Liveid - Feedback on identifying your live cd thanks to an UUID

1) History

Back in 2019 I was developing Rescatux and I found out that I needed a way to make sure I was booting the Rescatux disk and nothing else.

So I ended up with what I called liveid. I implemented it thanks to a modified live-build and a modified live-boot.

Back in the day I did not push my changes onto live-build or live-boot but to Rescatux repos.

I also tried to convince some other distro tools like dracut but you already know the answer... they were expecting me to patch dracut and I did not have time for that XD.

2) Introduction

Coming back to the present in 2024 I have sent a Merge Request regarding liveid to live-build and also a Merge Request regarding liveid to live-boot.

In the live-boot MR discussion Roland Clobus has suggested to bring the discussion here in the Debian Live mailing list.
So I'll try my best to make a summary so that this can discussed here.

Please make sure to also read resources at the end of the email because this was already discussed in the past in some form or another.

3) Problems aimed to be solved

3.1) This avoids problems when you have 4 usb pendrives connected to your
computer and you select one of them to boot from your BIOS/UEFI firmware.
In many cases this will trigger a different usb pendrive to be used instead.

3.2) Also avoids problems with some HP laptops that have pre-installed live-build
systems on their first partition.

4) How proposed liveid implementation for live-build/live-boot works

4.1) Each one of the medias (usually an ISO file) now has an additional UUID-like file.

4.2) Its saved thanks to some directories and files into the media
filesystem.
E.g.: /LIVEID/5BAA1131/19EB89E1/DF6EDB7E/6F422B5C is created in the
cdrom.

4.3) Also linux cmdline will have liveid=/LIVEID/5BAA1131/19EB89E1/DF6EDB7E/6F422B5C so
that live-boot knows exactly which device is the right one for the
kernel+initrd which have been loaded onto memory.

4.4) After liveid being implemented if the liveid path doesn't match,
the live cd won't be booted at all, unless you edit the liveid parametre and you remove it.

4.5) It also allows a live cd to be booted from its iso image thanks to the findiso parametre.

5) GRUB EFI Image is booted from RAM

For those of you that you aren't aware of it you should know that when a CDROM is booted from an UEFI system, well, it's done in a such a way that it's loaded from RAM. So GRUB itself does not know which it's the device
it has been booted from and it has to find the CDROM itself somehow.

6) FST File System Transposition

"Another point to consider: using a fixed label or uuid in the GRUB configuration of the ISO image will not work for another scenario: FST File System Transposition. See e.g. this Wiki page for a simple instruction which would allow a live image to boot (note: untested for the installer)."

From what I understand you could be interested in copying files from a cdrom to an usb and making sure that it still boots as expected. There would be two different medias with the same liveid path so you would get a collision there too.

7) Debian CD

So I guess that we could also study this for Debian installers.
I haven't studied the code myself. I mean... if it's an USB-only hard disk image there should not be any problem there...
I guess that they just use the USB filesystem label.
If there is an ISO which relies also on a boot/grub/efi.img image, well, they might have the same issues there.

8) I'm just thinking (assuming iso9660fs allows it) about moving `/LIVEID/5BAA1131/19EB89E1/DF6EDB7E/6F422B5C` to
`/.disk/LIVEID/5BAA1131/19EB89E1/DF6EDB7E/6F422B5C`
although I'm not very sure about it because I'm not sure if `.disk` might be converted onto capital letters in some devices.

Anyways, yeah, I'm open to move this file somewhere if someone has a better idea and it makes sense technically.

9) Another use case?

Well, that's the purpose of this thread in the mailing list. Gathering concerns on this improvement.

Resources:

- liveid page: https://github.com/rescatux/liveid
- live-build's liveid Merge Request: https://salsa.debian.org/live-team/live-build/-/merge_requests/364 - live-boot's liveid Merge Request: https://salsa.debian.org/live-team/live-boot/-/merge_requests/52 - live-build: UEFI shows grub> on HP250 G6 2SX60EA bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=924053 - File System Transposition (1): https://lists.gnu.org/archive/html/grub-devel/2022-06/msg00024.html - File System Transposition (2): https://wiki.debian.org/DebianInstaller/WritableUSBStick - 2020's discussion about liveid : https://lists.debian.org/debian-live/2020/04/msg00025.html - [live-build] boot failure, broken bootloaders when not using syslinux bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956131 - 2019's Gnu/Linux liveid proposal ask for feedback: https://sourceforge.net/p/rescatux/mailing-lists/message/36620767/ (This was sent to about 20 individual live-build-alike tool developers).

Reply via email to