diff --git a/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-install b/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-install index 7f4d27e985..2517421e3e 100644 --- a/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-install +++ b/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-install @@ -13,33 +13,33 @@ if [ "$GUMMIBOOT_DISABLE" ]; then exit 0 fi -boot=$ROOTDIR/boot -entries=$boot/loader/entries -name=void-$VERSION -entry=$entries/$name.conf -options=$boot/loader/void-options.conf -loader=$boot/loader/loader.conf +boot="$ROOTDIR/boot" +entries="$boot/loader/entries" +name="void-$VERSION" +entry="$entries/$name.conf" +options="$boot/loader/void-options.conf" +loader="$boot/loader/loader.conf" -[ -d $boot ] || exit 0 +[ -d "$boot" ] || exit 0 -mkdir -p $entries +mkdir -p "$entries" -cat <<-EOF > $entry +cat <<-EOF > "$entry" title Void Linux version $VERSION linux /vmlinuz-$VERSION initrd /initramfs-$VERSION.img EOF -if [ -r $options ]; then +if [ -r "$options" ]; then # Add user provided options from /boot/loader/void-options.conf: - printf 'options %s\n' "$(cat $options | sed '/^#/d;/^$/d')" >> $entry + printf 'options %s\n' "$(cat "$options" | sed '/^#/d;/^$/d')" >> "$entry" fi -if grep -q ^default $loader 2>/dev/null; then +if grep -q ^default "$loader" 2>/dev/null; then # Replace existing default entry with this entry: - sed -i "s/default.*/default $name/" $loader + sed -i "s/default.*/default $name/" "$loader" else # Add this entry as the default: - printf 'default %s\n' $name >>$loader + printf 'default %s\n' $name >>"$loader" fi diff --git a/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-remove b/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-remove index b946d62456..a207b2d362 100644 --- a/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-remove +++ b/srcpkgs/gummiboot/files/kernel.d/gummiboot.post-remove @@ -7,15 +7,15 @@ PKGNAME="$1" VERSION="$2" -boot=$ROOTDIR/boot -entries=$boot/loader/entries -name=void-$VERSION -entry=$entries/$name.conf -loader=$boot/loader/loader.conf +boot="$ROOTDIR/boot" +entries="$boot/loader/entries" +name="void-$VERSION" +entry="$entries/$name.conf" +loader="$boot/loader/loader.conf" -[ -d $boot ] || exit 0 +[ -d "$boot" ] || exit 0 -rm -f $entry +rm -f "$entry" # No default entry if the removed entry was the default: -sed -i "/^default $name\$/d" $loader +[ -e "$loader" ] && sed -i "/^default $name\$/d" "$loader" diff --git a/srcpkgs/gummiboot/template b/srcpkgs/gummiboot/template index a824e27c02..052776fe7f 100644 --- a/srcpkgs/gummiboot/template +++ b/srcpkgs/gummiboot/template @@ -1,7 +1,7 @@ # Template file for 'gummiboot' pkgname=gummiboot version=48.1 -revision=5 +revision=6 archs="i686* x86_64* aarch64*" build_style=gnu-configure conf_files="/etc/default/gummiboot"