You are not logged in.

#1 2024-04-24 13:48:55

Asmyldof
Member
Registered: 2024-04-24
Posts: 3

[SOLVED]Arch ISO (with archiso tools): Adding scripts to EFI partition

Hello All,

Medium-long term user and reader, first time poster here.
Big fan.

But I have now run into a small deep-dive where googling and/or searching here only leads to other questions and answers that are way simpler in nature ("how do I grow the EFI partition on my computer" type questions -- EASY!).

I would like to make an Arch ISO with various customization (I'm already quite deep into all sorts of cool weird mods that make the iso itself exceptionally versatile). One of the mods I want to do is add various EFI scripts to the EFI partition of the ISO, because I'm also already adding a cloud-init partition and a persistence EXT4 partition, so I am not allowed to add another secondary EFI partition to hold the scripts in an accessible FS1: location once the EFIShell is booted (xorriso limit is 4, probably a joliet thing). -- Also having everything in a single main EFI partition is much neater, but I'd be able to look past that were I allowed to make an ISO with 5 partitions.

I have dug a little bit through the arch-iso scripts, but the script-fu in there is several miles beyond my own and there's loads of locations where the EFI part might be generated, depending on all sorts.

Is there anyone here that knows straight off the bat if I can just place certain EFI script files somewhere such that they always get included into the generated EFI partition? I'd like it to work with an unmodified archiso toolset (so the manual for colleagues is easy), but if it needs modifications I could make them with a bit of help from someone in the know, test them in all possible ways and propose that as an addition/upgrade to the main project for you guys to judge for merging.

Mainly my ideal world would be that there's a folder that I can supply as an argument, or that must exist in a specific place, and all files within it will be added to the EFI partition, similar to the airrootfs folder, up to a couple hundred MB. (Intel EEProg and Lantools, various other proprietary vendor tools, bin files for the ethernet Phys, it adds up quickly)

Much thanks for all your efforts past and future,
Rob

Last edited by Asmyldof (2024-05-06 09:07:25)

Offline

#2 2024-04-27 08:08:40

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: [SOLVED]Arch ISO (with archiso tools): Adding scripts to EFI partition

I have never really messed much with EFI stuff in archiso but if I am reading your post correctly you want to add stuff to /boot/efi. My route would be to place files in this folder and then do a test build and see if they are present on iso image [am guessing they would be]

https://gitlab.archlinux.org/archlinux/ … type=heads

The path where you place scripts is down to you...


Mr Green

Offline

#3 2024-04-27 16:00:39

Crunchbang
Member
From: Script headers everywhere
Registered: 2024-04-25
Posts: 2

Re: [SOLVED]Arch ISO (with archiso tools): Adding scripts to EFI partition

it may take some fiddling around but using EFI stub it should be possible by copying the kernel and initrd off of the ISO and adding a stub entry to EFI with something like

efibootmgr -c -d /dev/nvme0n1 -p 1 -l \EFI\archiso\vmlinuz-linux -L "Archiso Boot" -u 'img_dev=/dev/nvme0n1p4 img_loop=/ISO/archlinux-2022.09.03-x86_64.iso initrd=\EFI\archiso\initramfs-linux.img' -v

Offline

#4 2024-04-28 12:31:02

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 607

Re: [SOLVED]Arch ISO (with archiso tools): Adding scripts to EFI partition

archiso doesn't support placing additional files in the ESP. Since you already have a cloud-init (CIDATA) partition, why not place them there? See https://wiki.archlinux.org/title/Instal … lash_drive for an example.

Offline

#5 2024-04-29 01:36:55

Asmyldof
Member
Registered: 2024-04-24
Posts: 3

Re: [SOLVED]Arch ISO (with archiso tools): Adding scripts to EFI partition

I had assumed conflicts with using CIDATA, but I cannot honestly say why I had those assumptions. Maybe something about making my first cloud-init ISO ages ago, and only recently getting colleagues complaining my USB stick can't do every single task in the world and being a people pleaser ;-). (I do know that a standard 2MB CIDATA drive as in the example does not show up accessible in the EFI shell, only the EFI partition and the internal drive do if it's windows-y formatted).

Thanks for the suggestion.

Hopefully you guys will forgive my hard-headedness if I later decide to place a feature request to add a flag to mkarchiso that allows inflating the EFI partition not to the nearest whole megabyte, but by a specified number of megabytes. I still see usefulness in that, because there's a load of hardware modification and rescue tooling available in EFI shell scripts that I wouldn't mind having on a single USB rescue stick even if I weren't already deep into making a Frankenstein's Arch ISO.

I shall endeavour to do a set of tests with a larger EFI-flagged CIDATA drive this coming week, see if that works for both purposes, and update the topic and/or thread accordingly.

Offline

#6 2024-05-06 09:06:22

Asmyldof
Member
Registered: 2024-04-24
Posts: 3

Re: [SOLVED]Arch ISO (with archiso tools): Adding scripts to EFI partition

Good news!

When I grow CIDATA to 500MB I can find it as a partition on all 3 types of target systems from the EFI shell, so it's just a tiny bit of extra instruction for debugging to say "Go to FS1: and run ls to see if you see folder xyz".

That's good enough for me.
Thanks for your attention.

Offline

Board footer

Powered by FluxBB