Skip to content
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

Arch iso boot fixup (kexec-parse-boot and kexec-boot-iso fixups) #1120

Merged
merged 3 commits into from
Mar 8, 2022

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Feb 21, 2022

Archlinux is providing detached signed iso, just like Tails and Qubes OS. We add it here:

  • The public key was generated in this PR for inclusion by :
mkdir /tmp/test3
gpg --homedir /tmp/test3 --auto-key-locate clear,wkd -v --locate-external-key [email protected]
gpg --homedir /tmp/test3 --edit-key [email protected]
(minimize, save)
gpg --homedir /tmp/test3 --export --armor > ~/heads/initrd/etc/distro/keys/archlinux.key

@tslilc : Any insight? Does that need to be fixed upstream by Archlinux?

  • kexec boot params are passing archisolabel=ARCH_202202 and archisobasedir=arch
  • where the actual Heads added arguments are passing the right uuid, as to boot all other ISOs....
  • Arch really wants to boot from label, while not making it available.... How to fix this? not sure and not investigated.
    EDIT: fixed with kexec-iso-boot fixup.

Hint: There might be code inside of linuxboot/webboot that might help us resolve this, since they implemented a correct parser.

On the good side, the present commit is not breaking other detached signature verified ISO boot:

  • c511c68 is not breaking:
    • Tails 4.26 boots from detached signature verified iso (fromiso= passes uuid not label at final kexec call)
    • Qubes 4.0.4 boots from detached signature verified iso. (fromiso= passes uuid not label at final kexec call)

@tlaurion tlaurion marked this pull request as draft February 21, 2022 17:17
@tlaurion
Copy link
Collaborator Author

Some hints on why this might not be working out of the box

Not sure how to hack around this.

On Heads side, a quick hack was done a while ago to permit iso boot, which was to pass fromiso and the iso boot options to cover most OS iso boot.

Some recalled hints: #470 (comment), pointing to https://mbusb.aguslr.com/howto.html shows that Arch expects:
img_dev=$imgdevpath img_loop=$iso_path

Since Heads already passes variables to support debian (findiso=$iso_path) and fedora (iso-scan/filename=$iso_path), there might be a need to support others, since those variables are only picked up by the OS that are interested in them.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 21, 2022

Ok with 8f6c61c change, the iso boots successfully!

Then comes the time to install it and have it booted successfully, which will probably require additional changes to kexec-parse-boot. But in current state, it seems to fit original need of #584.

fixes #584

@tslilc @MrChromebox please review.
If you have ideas on how to fix #1001 and #1117 properly.... be my guest!

@tlaurion tlaurion marked this pull request as ready for review February 21, 2022 18:06
@tlaurion tlaurion changed the title WiP: Arch iso boot fixup (kexec-parse-boot fixup) Arch iso boot fixup (kexec-parse-boot and kexec-boot-iso fixups) Feb 21, 2022
@techge
Copy link
Contributor

techge commented Feb 23, 2022

What exactly needs to get tested if you already checked it correctly? That is to say: I am not sure what exactly I am supposed to be looking for.
What is the best way to get a pre-built rom (which option/version shall I use) these days? I do not have a working toolchain right now...

@techge
Copy link
Contributor

techge commented Feb 23, 2022

btw, I just remembered: Ironically, I flashed a coreboot rom last weekend, because I was annoyed that I can not start my arch iso in heads to re-install my system :D

@lynxred
Copy link

lynxred commented Feb 23, 2022

mkdir /tmp/test3
gpg --homedir /tmp/test3 --auto-key-locate clear,wkd -v --locate-external-key [email protected]
gpg --homedir /tmp/test3 --edit-key [email protected]
(minimize, save)
gpg --homedir /tmp/test3 --export --armor > ~/heads/initrd/etc/distro/keys/archlinux.key

it needs to be written in the heads console?

@lynxred
Copy link

lynxred commented Feb 23, 2022

i see this error image

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 23, 2022

mkdir /tmp/test3
gpg --homedir /tmp/test3 --auto-key-locate clear,wkd -v --locate-external-key [email protected]
gpg --homedir /tmp/test3 --edit-key [email protected]
(minimize, save)
gpg --homedir /tmp/test3 --export --armor > ~/heads/initrd/etc/distro/keys/archlinux.key

@lynxred: No. That is how Arch linux distribution public key was added to Heads in this PR.
And Archlinux distibution signing key being inside of this PR permits Heads to verify ISO detached signed integrity against it through USB boot option. You are not using the ROM provided by this PR in the above picture aren't, you?

@techge The iso boots from this PR.
But that Arch being installed on disk? Not tested.
You reported in the past that initrd needed to be manually generated (#702)
Is it still the case? I915 driver still missing from initrd?

@tlaurion
Copy link
Collaborator Author

@techge : To download prebuilt roms: linuxboot/heads-wiki#88

tslil clingman and others added 3 commits February 23, 2022 09:50
bin/kexec-parse-boot: test linuxboot@2bb1f52 that fix correctly comma seperated arguments.

Still TODO: when booting, Heads tries to find where the ISO with /dev/disk/by-label/ARCH_202202 wich is never brought up. uuids could, not sure why the label is not brought up correctly. Maybe an issue in the way Arch makes the ISO.
@tslilc : Any idea to continue linuxboot#584 or modify linuxboot#762?
@tlaurion tlaurion force-pushed the arch_iso_boot_fixup branch from 8f6c61c to 1809b3b Compare February 23, 2022 14:50
@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 23, 2022

i see this error image

So following your comment here #1117 (comment) I expect you are using x230-maximized ROM. And following the error you have #1120 (comment) even through ISO was signed in FEB 2022, I expect you are not running the ROM produced by this PR when clicking 8f6c61c green mark, x230-maximized board, artifacts and then downloading the full ROM (not top.rom nor bottom.rom, and flash internally with USB thumb drive containing that file).

Again: only flash internally from Legacy->Legacy, Maximized->Maximized. Those cannot be mixed.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 23, 2022

@lynxred And I just realised that this PR was not based on master, and consequently, the x230-maximized board was not built by the CircleCI prior of your report.

CircleCI is building for x230-maximized again with 1809b3b being rebased on top of master (which included new instructions for CircleCI to built for x230-maximized), sorry about that.

@tlaurion
Copy link
Collaborator Author

btw, I just remembered: Ironically, I flashed a coreboot rom last weekend, because I was annoyed that I can not start my arch iso in heads to re-install my system :D

@techge hopefully, you are willing to retest installation/boot and report with ROM produced in this PR!

@techge
Copy link
Contributor

techge commented Feb 28, 2022

@techge hopefully, you are willing to retest installation/boot and report with ROM produced in this PR!

I am willing, but I can't make any promises about when this will happen. I try to do it this week though. I am sorry.

@tlaurion
Copy link
Collaborator Author

tlaurion commented Mar 7, 2022

Just retested from ISO boot:

  • Q4.1, Q4.0
  • Archlinux
  • Tails 4.26

@tlaurion tlaurion merged commit acf7091 into linuxboot:master Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants