New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework iso boot: Use only grub2 and make it easer to add boot menu items #83585
base: master
Are you sure you want to change the base?
Conversation
Here's a script to test it: https://gist.github.com/mkg20001/6d8a607a28131176fb6ed3b94c282c71 |
--target=i386-pc \ | ||
--boot-directory=$PWD/append/boot \ | ||
--no-bootsector \ | ||
--skip-fs-probe \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't do it's job properly. would need to fix this, possibly upstream patch
--efi-directory=$PWD/append/EFI \ | ||
--boot-directory=$PWD/append/boot \ | ||
--no-nvram \ | ||
--skip-fs-probe \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know if this is needed, since all modules are in the efi image (added some code to make detection dynamic)
but dunno if later other archs might have similar problems as MBR with image size limit.... I guess no, we'll see later then
3af8d07
to
5185eb1
Compare
#if test -n "$usbBootable"; then | ||
# echo "Making image hybrid..." | ||
# if test -n "$efiBootable"; then | ||
# isohybrid --uefi $out/iso/$isoName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may or may not be relevant
d69350f
to
e8781d4
Compare
f3782eb
to
0d64291
Compare
Hello, I want to help review this PR for inclusion. About code review- To tell you a bit about what I do and don't know- I am reasonably familiar with how EFI works in principle, and how MBR works (having written asm code that can boot from MBR and read FAT partition). I'm also reasonably familiar with the workings of grub. I am very unfamiliar with NixOS iso creation stuff, or with bootable CD stuff. My knowledge is thus, limited, but if you're only looking for a second pair of eyes then we can chat on discord and I can read up on stuff that I'm unfamiliar with. About testing- I can test this PR. To start: I did the following to run your iso in qemu (adapted from your instructions)-
The first thing I did after launch was to hit I want to start by enumerating ways to install Linux from an ISO-
How many of these do you support in your current work? I notice that you have removed all usages of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this change (on top of nixos-unstable
@ 24c9b05) on ThinkPad T580 with both Legacy boot only
and UEFI only
:
installer
option works with both modes (made sure that/sys/firmware/efi
directory exist onUEFI
and does not onLegacy boot
), so that's great!copytoram
option doesn't boot on bothUEFI
andLegacy boot
(see https://imgur.com/a/qx1JrDt).copytoram
option boots fine on 24c9b05.
I used nix-build nixos -A config.system.build.isoImage -I nixos-config=nixos/modules/installer/cd-dvd/installation-cd-minimal.nix
to build iso image.
there's a "no space left" error so it's possible that the image is a bit bigger and therefore there's not enough ram. |
Currently I don't really have the time to fix some of the remaining nitpicks in this PR and get the usb-booting stuff re-added and I'd be happy for somebody that would help fix it |
0d64291
to
9515e57
Compare
I marked this as stale due to inactivity. → More info |
Motivation for this change
Using two bootloaders isn't really a good idea, let's focus on just one
I found this https://willhaley.com/blog/custom-debian-live-environment/ which uses grub for all boot-related things and re-implemented the current boot-process using that
Additionally currently there seems to be a script to create a custom EFI boot image, etc
I've removed that all and it's now only creating a small boot image and loading the rest from the ISO, otherwise this causes havoc with some things such as my own ISO (which is 4gb) being detected as some odd 67mb thing and just launching an empty grub prompt on UEFI
Also that's an opportunity to re-style the grub image
Additionally I added "boot.persistence". It's a kernel parameter that allows replacing the ISO's tmpfs which gets mounted on / with a physical device, so one can boot from an ISO and use it like a normal OS (everything except the store is persistent)Seperated into #83911And I made it easier to add custom boot items
Currently booting shows a bunch of errors, I'll fix thoseone error about echo, which is because we're using modloading to check if echo exists, otherwise it changes prefix to /boot and tries to load modules from there. but it's not a fatal errorAdditionally history is a mess, I'll get to that later aswellRebasedThings done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)