You are not logged in.
Hello Arch Linux community.
Im relatively new to this distro and linux overall - so I need help on creating my first pacman hook.
As mentioned in the topic I want to move all the updated boot files from /boot to the /EFI/arch folder on my ESP partition. My custom script looks like:
[Trigger]
Operation = Upgrade
Type = Package
Target = linux
Target = linux-headers[Achtion]
Discription = Moving files from /boot to /boot/EFI/arch
When = PostTransaction
Exec = mv /boot/vmlinux-linux /boot/EFI/arch/
Exec = mv /boot/initramfs-linux.img /boot/EFI/arch/
Exec = mv /boot/initramfs-linux-fallback.img /boot/EFI/arch/
Is this solution possible/Can I actually launch bash commands in a hook? I didnt find a more aesthetic way so far...
Best regards
Offline
Why do you want the kernel in a subfolder on the ESP? What boot manager are you using? Do you even need the kernel on the ESP?
As for "bash commands" that depends on what you need. `mv` is a binary under /usr/bin/, so you can use that.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I'm using rEFInd and want to store all the boot necessary files in the arch folder to get the arch icon displayed on the boot menu.
I actually don't know if I need the whole kernel on my esp but the boot files which initialize the os and further. And this are the files I want to move.
Offline
You could create an entry in refind.conf for the kernel with the icon you want or bind mount /boot/EFI/arch/ to /boot both avoiding using the custom hook.
Online
Thanks. The first choice may be the easiest but if I imagine a dual boot whith multiple kernel files at the same place it could get really hard to overview.
The second guess sound really nice but Im not sure how to do this? just creating a fstab entry which says like "boot/EFI/arch/ /boot ..." ? Doesn't looking right to me.
Offline
Untested but something such as
/boot/EFI/arch/ /boot none bind 0 0
Online
Tested it - seems to not work as expected. Files even placed in the /boot folder...
# <devices> <dir> <type> <options> <dump> <pass>
# /dev/sda1
PARTUUID=19c99006-6c81-44eb-891a-b44228dc4f46 /boot vfat defaults 0 2/boot/EFI/arch/ /boot none bind 0 0
# /dev/sda2
PARTUUID=49e228a7-8fd0-42a5-b465-fa7b41e90ee3 none swap defaults 0 0# /dev/sda3
PARTUUID=15c4ceb7-bfe8-47a9-82fb-45f6fa6a32ae / ext4 rw,relatime 0 1
Offline
Yeah, you need to mount the ESP somewhere other than /boot for that to work.
Offline
Using /esp for the ESP
# <devices> <dir> <type> <options> <dump> <pass>
# /dev/sda3
PARTUUID=15c4ceb7-bfe8-47a9-82fb-45f6fa6a32ae / ext4 rw,relatime 0 1
# /dev/sda2
PARTUUID=49e228a7-8fd0-42a5-b465-fa7b41e90ee3 none swap defaults 0 0
# /dev/sda1
PARTUUID=19c99006-6c81-44eb-891a-b44228dc4f46 /esp vfat defaults 0 2
/esp/EFI/arch/ /boot none bind 0 0
Online
I actually don't know if I need the whole kernel on my esp
No, rEFInd does not require that the kernel & initramfs be on the ESP. It includes EFI filesystem drivers.
Offline
Using /esp for the ESP
# <devices> <dir> <type> <options> <dump> <pass> # /dev/sda3 PARTUUID=15c4ceb7-bfe8-47a9-82fb-45f6fa6a32ae / ext4 rw,relatime 0 1 # /dev/sda2 PARTUUID=49e228a7-8fd0-42a5-b465-fa7b41e90ee3 none swap defaults 0 0 # /dev/sda1 PARTUUID=19c99006-6c81-44eb-891a-b44228dc4f46 /esp vfat defaults 0 2 /esp/EFI/arch/ /boot none bind 0 0
Tried and it seemed to work. Just had to change the "bind" to "defaults,bind" to boot properly.
Thank you!
Offline