Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions srcpkgs/systemd-boot/files/kernel.d/systemd-boot.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
## uncomment this line to disable the systemd-boot hook
#SYSTEMD_BOOT_DISABLE=1

## This variable corresponds to where systemd-boot should look for your kernel & initramfs
## Default $BOOT is /boot
#BOOT="/boot"

## Default ESP is $BOOT
#ESP="$BOOT"

## If unset, cmdline will be generated using UUID from fstab
#CMDLINE=""
27 changes: 17 additions & 10 deletions srcpkgs/systemd-boot/files/kernel.d/systemd-boot.post-install
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@ if ! bootctl is-installed >/dev/null; then
exit 0
fi

BOOT="${BOOT:-/boot}"
ESP="${ESP:-"$BOOT"}"
if [ -z "$ESP" ]; then
# This branch corresponds to "new" configs, as well as old configs that left $ESP to default value
BOOT="${BOOT:-/boot}"
else
# This branch corresponds to old configs that explicitly set $ESP to something exotic
# # It is a good idea to not source `$BOOT` from the user because this variable was previously unused
# i.e. held no significance to the execution of this script. We don't want to suddenly give it significance
# By doing this, users with $BOOT=/some/really/dumb/path in the config are not affected.
BOOT="${ESP}"
fi

BOOT="$ROOTDIR/$BOOT"
ESP="$ROOTDIR/$ESP"

[ -d "$ESP" ] || exit 0
[ -d "$BOOT" ] || exit 0

ARCH="$(xbps-uhelper arch)"

Expand All @@ -36,24 +43,24 @@ case "$ARCH" in
aarch64*) EFI_ARCH="aa64";;
esac

entries="$ESP/loader/entries"
entries="$BOOT/loader/entries"
name="void-$ARCH-$VERSION"
entry="$entries/$name.conf"

LINUX="vmlinuz-${VERSION}"

if [ ! -f "$ESP/$LINUX" ]; then
if [ ! -f "$BOOT/$LINUX" ]; then
LINUX="vmlinux-${VERSION}"
if [ ! -f "$ESP/$LINUX" ]; then
echo "Failed to find kernel at $ESP/vmlinuz-${VERSION} or $ESP/vmlinux-${VERSION}, aborting"
if [ ! -f "$BOOT/$LINUX" ]; then
echo "Failed to find kernel at $BOOT/vmlinuz-${VERSION} or $BOOT/vmlinux-${VERSION}, aborting"
exit 1
fi
fi

INITRD="initramfs-${VERSION}.img"

if [ ! -f "$ESP/$INITRD" ]; then
echo "Failed to find initramfs at $ESP/$INITRD, aborting"
if [ ! -f "$BOOT/$INITRD" ]; then
echo "Failed to find initramfs at $BOOT/$INITRD, aborting"
exit 1
fi

Expand Down
17 changes: 12 additions & 5 deletions srcpkgs/systemd-boot/files/kernel.d/systemd-boot.post-remove
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,26 @@ if [ "$SYSTEMD_BOOT_DISABLE" ]; then
exit 0
fi

BOOT="${BOOT:-/boot}"
ESP="${ESP:-"$BOOT"}"
if [ -z "$ESP" ]; then
# This branch corresponds to "new" configs, as well as old configs that left $ESP to default value
BOOT="${BOOT:-/boot}"
else
# This branch corresponds to old configs that explicitly set $ESP to something exotic
# # It is a good idea to not source `$BOOT` from the user because this variable was previously unused
# i.e. held no significance to the execution of this script. We don't want to suddenly give it significance
# By doing this, users with $BOOT=/some/really/dumb/path in the config are not affected.
BOOT="${ESP}"
fi

BOOT="$ROOTDIR/$BOOT"
ESP="$ROOTDIR/$ESP"

ARCH="$(xbps-uhelper arch)"

entries="$ESP/loader/entries"
entries="$BOOT/loader/entries"
name="void-$ARCH-$VERSION"
entry="$entries/$name.conf"

[ -d "$ESP" ] || exit 0
[ -d "$BOOT" ] || exit 0

rm -f "$entry"

Expand Down
2 changes: 1 addition & 1 deletion srcpkgs/systemd-boot/template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Template file for 'systemd-boot'
pkgname=systemd-boot
version=256.6
revision=2
revision=3
build_style=meson
conf_files="/etc/default/systemd-boot"
configure_args="-Defi=true -Dman=enabled -Dbootloader=enabled
Expand Down