-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75f6b30
commit 2a48c46
Showing
4 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Some useful pacman hooks not included in package | ||
|
||
See `README.md` in each directory for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Sync required contents from /boot to /efi | ||
|
||
Sync required contents to boot RaspberryPi 4B in UEFI mode from `/boot` to `/efi` | ||
|
||
This should help people who mount ESP on `/efi`, but you can always adjust them to meet your needs. | ||
|
||
## Usage | ||
|
||
1. Disable hooks provided by `uefi-raspberrypi4` package | ||
|
||
You can run those commands to achive that: | ||
```bash | ||
ln -s /dev/null /etc/pacman.d/hooks/70-post-install-uefi.hook | ||
ln -s /dev/null /etc/pacman.d/hooks/80-pre-remove-uefi.hook | ||
``` | ||
|
||
2. Put [hooks](./hooks) and [scripts](./scripts) into `/etc/pacman.d`. | ||
|
||
## FAQ | ||
|
||
- Why not ship those in `uefi-raspberrypi4` package? | ||
|
||
Most people mount ESP on `/boot`, thus files required during boot have already been taken well care of. | ||
|
18 changes: 18 additions & 0 deletions
18
pacman-hooks/sync-boot-to-efi/hooks/74-sync-boot-to-efi.hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[Trigger] | ||
Operation = Install | ||
Operation = Upgrade | ||
Type = Path | ||
Target = boot/overlays/ | ||
Target = boot/*.elf | ||
Target = boot/bootcode.bin | ||
Target = boot/config.txt | ||
Target = boot/*.dat | ||
Target = boot/dtbs/broadcom/bcm2711-rpi-4-b.dtb | ||
Target = boot/RPI_EFI.fd | ||
|
||
[Action] | ||
Description = Syncing required files in /boot to /efi... | ||
Depends = coreutils | ||
When = PostTransaction | ||
Exec = /etc/pacman.d/scripts/sync-boot-to-efi | ||
NeedsTargets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
declare -r target=efi | ||
while read -r path | ||
do | ||
if [ -n "$path" ] | ||
then | ||
target_path=$target/$(basename "$path") | ||
echo "Syncing $path to $target_path..." | ||
case "$path" in | ||
*config.txt|*RPI_EFI.fd) | ||
echo "We are syncing $path to $target_path.pacnew to prevent conflicts, you need to merge them manually." | ||
cp "$path" "$target_path.pacnew" | ||
;; | ||
*) | ||
cp "$path" "$target_path" | ||
;; | ||
esac | ||
fi | ||
done |