Tomas-M / linux-live

Linux Live Kit
http://www.linux-live.org/
1.01k stars 249 forks source link

Make linux-live UEFI compatible? #218

Closed DoktorJ closed 1 year ago

DoktorJ commented 2 years ago

As per an older ticket, linux-live does not seem to make a purely UEFI-compatible boot device. Many newer motherboards out there -- notably in my case the Intel NUC11 and NUC12 systems -- no longer support legacy/BIOS booting, and don't even have a CSM option... the UEFI boot doesn't even recognize a perfectly functional (on older systems) linux-live USB drive as a boot option.

I tried making the base install on a NUC11, so it would have the EFI boot partition and everything in case that might make a difference, but unfortunately it doesn't ☹

tute-avalos commented 2 years ago

Hi, i have an issue related to this one. My squashfs is larger than 4GB so i need to format to ext4 or ntfs for storage the fs file. The EFI boot is not supported for other partitions rather than FAT32. I can't boot into notbooks that hasn't legacy boot. :(

Tomas-M commented 2 years ago

@tute-avalos I would suggest you to split your squashfs into smaller parts.

tute-avalos commented 2 years ago

how do you do that? it's there a parameter in the build script?

Tomas-M commented 2 years ago

Actually no, you would need to do that manually - extract the 4GB squashfs to your filesystem and then compress some of the parts separately. You may use unsquashfs and mksquashfs commands for that.

Tomas-M commented 2 years ago

Alternatively you can build it twice, first specify some directories in config, such as MKMOD="bin etc home lib lib64 opt root sbin srv"

and then build it for the second time with MKMOD="usr var"

This will make you two squashfs images, which you can simply put there together. (name does not matter, just extension matters)

tute-avalos commented 2 years ago

Alternatively you can build it twice, first specify some directories in config, such as MKMOD="bin etc home lib lib64 opt root sbin srv"

and then build it for the second time with MKMOD="usr var"

This will make you two squashfs images, which you can simply put there together. (name does not matter, just extension matters)

So, if the both files 01-core.sb and 02-core.sb (for example) are in the same folder, it will work? :open_mouth:

Tomas-M commented 2 years ago

yes

computermaster0101 commented 1 year ago

Is there any way to place the bootloader on a fat32 partition and the sb on a second partition formatted in ntfs or ext?

Tomas-M commented 1 year ago

Basically yes. If you boot the kernel and initrd somehow (eg from fat), it then tries to mount all drives until it finds .sb data somewhere. Just make sure to put the .sb modules to proper directory, eg. /linux/.sb or /yourLiveOSname/.sb

CsIxy commented 1 year ago

Hello everyone and Thomas! I really liked this work. It works perfectly for me. I modified it a bit. The only problem is what can be done when changing the kernel? .... ? UEFI Boot already is solved for me. I only convert Debian distro installations this way. Right now, LMDE 5 Cinnamon was working, but it also worked under Sparky, Peppermint, Q4OS and Debian 11.5 cinnamon non free. I like it because if I have enough RAM, everything from hairy to leathery can go into the RAM.

So I install the distro in a partition. I tune it, update it to the current state, upload my favorite programs and before starting the Linux Live Kit, I commit a foul. I also put the /boot folder in the config file, in order to see if I can handle the kernel change somehow, because as far as I know, it has not been solved yet. I copy the 8 scripts from /slax/debian/rootcopy/usr/bin from the linux live kit to the /usr/bin folder of my installed linux. So in the end my Live Linux will be a huge Slax. Oh yes!

I copy the linux folder from the builded iso to my pendrive's first Ext4 partition's / , run the /linux/boot/bootinst.sh file. It may be necessary to allow extlinux.x64 and bootinst.sh to run before these.

then

I change the contents of /linux/boot/syslinux.cfg file to:

UI /linux/boot/vesamenu.c32

TIMEOUT 140 MENU ROWS 4

MENU CLEAR MENU BACKGROUND /linux/boot/bootlogo.png

LABEL default1 MENU LABEL Run Linux KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0

LABEL default2 MENU LABEL Run Linux debug KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug

LABEL default3 MENU LABEL Run Linux (Persistent changes) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch,automount

LABEL perch MENU LABEL Run Linux (Fresh start) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 automount

LABEL toram MENU LABEL Run Linux (Copy to RAM) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram

then

I am now making a second 320Mb Fat32 partition and moving the EFI folder (which was created in the root of the flash drive's first partition as a result of running bootinst.sh) from the previous partition into it (I usually leave the empty EFI folder in the Ext4 partition, although it can be deleted from there). I copy the bootlogo.png, initrfs.img, vmlinuz files from the /linux/boot folder of first Ext4 partition to the /EFI/boot/ folder of the second Fat32 partition

and change the contents of /EFI/boot/syslinux.cfg to:

UI vesamenu.c32

TIMEOUT 140 MENU ROWS 4

MENU CLEAR MENU BACKGROUND bootlogo.png

LABEL default1 MENU LABEL Run Linux KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0

LABEL default2 MENU LABEL Run Linux debug KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug

LABEL default3 MENU LABEL Run Linux (Persistent changes) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch,automount

LABEL perch MENU LABEL Run Linux (Fresh start) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 automount

LABEL toram MENU LABEL Run Linux (Copy to RAM) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram

That's all ... and it's all good. :)

seba1452021 commented 1 year ago

https://github.com/rrottmann/slax-efi my fork: https://github.com/seba1452021/slax-efi

computermaster0101 commented 1 year ago

I was able to uefi boot using fat32 file system. I was also able to create and use a second partition as ext4 for data.

Also confirmed uefi boot by placing only /linux/boot dir to fat32 with *.sb on partition 2 and running bootinst script

IIMustangII1151 commented 1 year ago

@CsIxy

I'm trying to replicate your process here but i don't understand where to change the content of syslinux.cfg. what is the path of these files?

I change the syslinux.cfg file to:

and change the contents of syslinux.cfg to:

IIMustangII1151 commented 1 year ago

UI vasamenu.c32

vesamenu.c32

CsIxy commented 1 year ago

UI vasamenu.c32

vesamenu.c32

Hi IIMustangII1151 ! Thanks for spotting my mistake: UI vasamenu.c32 needs to be fixed UI vesamenu.c32 . I fixed this.

As a result of your other question, I edited my original post. I hope that this way my beginner's English writing has become correct and understandable. The rest is just a matter of copy-paste operations.

Of course, messing with the Ext4 partition can be done with root rights, just don't be fatal! ;)

Shibaditya99 commented 1 year ago

Hello everyone and Thomas! I really liked this work. It works perfectly for me. I modified it a bit. The only problem is what can be done when changing the kernel? .... ? UEFI Boot already is solved for me. I only convert Debian distro installations this way. Right now, LMDE 5 Cinnamon was working, but it also worked under Sparky, Peppermint, Q4OS and Debian 11.5 cinnamon non free. I like it because if I have enough RAM, everything from hairy to leathery can go into the RAM.

So I install the distro in a partition. I tune it, update it to the current state, upload my favorite programs and before starting the Linux Live Kit, I commit a foul. I also put the /boot folder in the config file, in order to see if I can handle the kernel change somehow, because as far as I know, it has not been solved yet. I copy the 8 scripts from /slax/debian/rootcopy/usr/bin from the linux live kit to the /usr/bin folder of my installed linux. So in the end my Live Linux will be a huge Slax. Oh yes!

I copy the linux folder from the builded iso to my pendrive's first Ext4 partition's / , run the /linux/boot/bootinst.sh file. It may be necessary to allow extlinux.x64 and bootinst.sh to run before these.

then

I change the contents of /linux/boot/syslinux.cfg file to:

UI /linux/boot/vesamenu.c32

TIMEOUT 140 MENU ROWS 4

MENU CLEAR MENU BACKGROUND /linux/boot/bootlogo.png

LABEL default1 MENU LABEL Run Linux KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0

LABEL default2 MENU LABEL Run Linux debug KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug

LABEL default3 MENU LABEL Run Linux (Persistent changes) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch,automount

LABEL perch MENU LABEL Run Linux (Fresh start) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 automount

LABEL toram MENU LABEL Run Linux (Copy to RAM) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram

then

I am now making a second 320Mb Fat32 partition and moving the EFI folder (which was created in the root of the flash drive's first partition as a result of running bootinst.sh) from the previous partition into it (I usually leave the empty EFI folder in the Ext4 partition, although it can be deleted from there). I copy the bootlogo.png, initrfs.img, vmlinuz files from the /linux/boot folder of first Ext4 partition to the /EFI/boot/ folder of the second Fat32 partition

and change the contents of /EFI/boot/syslinux.cfg to:

UI vesamenu.c32

TIMEOUT 140 MENU ROWS 4

MENU CLEAR MENU BACKGROUND bootlogo.png

LABEL default1 MENU LABEL Run Linux KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0

LABEL default2 MENU LABEL Run Linux debug KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug

LABEL default3 MENU LABEL Run Linux (Persistent changes) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch,automount

LABEL perch MENU LABEL Run Linux (Fresh start) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 automount

LABEL toram MENU LABEL Run Linux (Copy to RAM) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram

That's all ... and it's all good. :)

it's working on fresh start and persistent change mode. but how to install in on the internal HDD or SSD? @CsIxy

CsIxy commented 1 year ago

Hello everyone and Thomas! I really liked this work. It works perfectly for me. I modified it a bit. The only problem is what can be done when changing the kernel? .... ? UEFI Boot already is solved for me. I only convert Debian distro installations this way. Right now, LMDE 5 Cinnamon was working, but it also worked under Sparky, Peppermint, Q4OS and Debian 11.5 cinnamon non free. I like it because if I have enough RAM, everything from hairy to leathery can go into the RAM. So I install the distro in a partition. I tune it, update it to the current state, upload my favorite programs and before starting the Linux Live Kit, I commit a foul. I also put the /boot folder in the config file, in order to see if I can handle the kernel change somehow, because as far as I know, it has not been solved yet. I copy the 8 scripts from /slax/debian/rootcopy/usr/bin from the linux live kit to the /usr/bin folder of my installed linux. So in the end my Live Linux will be a huge Slax. Oh yes! I copy the linux folder from the builded iso to my pendrive's first Ext4 partition's / , run the /linux/boot/bootinst.sh file. It may be necessary to allow extlinux.x64 and bootinst.sh to run before these. then I change the contents of /linux/boot/syslinux.cfg file to: UI /linux/boot/vesamenu.c32 TIMEOUT 140 MENU ROWS 4 MENU CLEAR MENU BACKGROUND /linux/boot/bootlogo.png LABEL default1 MENU LABEL Run Linux KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 LABEL default2 MENU LABEL Run Linux debug KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug LABEL default3 MENU LABEL Run Linux (Persistent changes) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch,automount LABEL perch MENU LABEL Run Linux (Fresh start) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 automount LABEL toram MENU LABEL Run Linux (Copy to RAM) KERNEL /linux/boot/vmlinuz APPEND vga=769 initrd=/linux/boot/initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram then I am now making a second 320Mb Fat32 partition and moving the EFI folder (which was created in the root of the flash drive's first partition as a result of running bootinst.sh) from the previous partition into it (I usually leave the empty EFI folder in the Ext4 partition, although it can be deleted from there). I copy the bootlogo.png, initrfs.img, vmlinuz files from the /linux/boot folder of first Ext4 partition to the /EFI/boot/ folder of the second Fat32 partition and change the contents of /EFI/boot/syslinux.cfg to: UI vesamenu.c32 TIMEOUT 140 MENU ROWS 4 MENU CLEAR MENU BACKGROUND bootlogo.png LABEL default1 MENU LABEL Run Linux KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 LABEL default2 MENU LABEL Run Linux debug KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 debug LABEL default3 MENU LABEL Run Linux (Persistent changes) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 perch,automount LABEL perch MENU LABEL Run Linux (Fresh start) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 automount LABEL toram MENU LABEL Run Linux (Copy to RAM) KERNEL vmlinuz APPEND vga=769 initrd=initrfs.img load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram That's all ... and it's all good. :)

it's working on fresh start and persistent change mode. but how to install in on the internal HDD or SSD? @CsIxy

Nowadays, I don't think it's a problem if you download the Linux Live Kit - Current version and do the build with it. Do it as I described, it can even go to a GPT disk. Use the UEFI Boot option as I described. Make an independent efi partition for this purpose. It's okay to have multiple EFI partitions on one disk. For UEFI Boot, you don't need to run bootinst.sh or bootinst.bat. These must be placed in the EFI/Boot/ folder of the efi partition: bootlogo.png , initrfs.img , libcom32.c32 , menu.c32 , syslinux.efi , vmlinuz , bootx64.efi , ldlinux.e64 , libutil.c32 , syslinux.cfg , vesamenu.c32 . In the case of legacy boot, frugal install can insert something like this into the /boot/grub/grub.cfg file of another installed linux:

BEGIN /etc/grub.d/40_custom

This file provides an easy way to add custom menu entries. Simply type the

menu entries you want to add after this comment. Be careful not to change

the 'exec tail' line above.

menuentry “LiveDebi” { search --no-floppy --fs-uuid --set=root c225d09c-blab-labl-abla-1657eb877bb4 linux /linux/boot/vmlinuz root=UUID=c225d09c-blab-labl-abla-1657eb877bb4 vga=769 load_ramdisk=1 prompt_ramdisk=0 rw printk.time=0 apparmor=0 toram initrd /linux/boot/initrfs.img }

END /etc/grub.d/40_custom

The double crosses are needed in the comment text above, which this editor bans from here.

Even with a Frugal Legacy install, there is no need to run bootinst.*() files, they can be deleted.

Any menu title can be entered instead of LiveDebi. The UUID should be the UUID of your own Ext4 Linux Live partition. Go! :)