diff --git a/srcpkgs/lilo/files/kernel.d/lilo.post-install b/srcpkgs/lilo/files/kernel.d/lilo.post-install index dd4d2c70759..63df21d568c 100644 --- a/srcpkgs/lilo/files/kernel.d/lilo.post-install +++ b/srcpkgs/lilo/files/kernel.d/lilo.post-install @@ -4,32 +4,12 @@ # # Arguments passed to this script: $1 pkgname, $2 version. # -PKGNAME="${1}" -VERSION="${2}" -boot="${ROOTDIR}/boot" -etc="${ROOTDIR}/etc" -entries="${etc}/lilo.d" -name="void-${VERSION}" -entry="${entries}/${name}.conf" +[ -x "$(command -v lilo)" ] || \ + return 0 -[ -d "${boot}" ] && [ -d "${etc}" ] || exit 0 -mkdir -p "${entries}" - -cat <<-EOF > "${entry}" -image = /${boot}/vmlinuz-${VERSION} - label = "${name}" - initrd = /${boot}/initramfs-${VERSION}.img -EOF - -# Replace existing default entry with this one -echo "default=${name}" > "${entries}/default.conf" - -conf="$(mktemp)" -cat "${etc}/lilo.conf" "${entries}"/*.conf > "${conf}" - -[ -x "$(command -v lilo)" ] && \ - lilo -C "${conf}" - -# Remove temporary config file -rm -f "${conf}" +if [ -e /etc/lilo.conf ]; then + lilo +elif [ ! -e /etc/lilo.conf ]; then + echo "Warning: Not updating LILO. Configuration file wasn't found." 1>&2 +fi diff --git a/srcpkgs/lilo/files/kernel.d/lilo.post-remove b/srcpkgs/lilo/files/kernel.d/lilo.post-remove index 7d7bab1767c..464d15731c9 100644 --- a/srcpkgs/lilo/files/kernel.d/lilo.post-remove +++ b/srcpkgs/lilo/files/kernel.d/lilo.post-remove @@ -4,26 +4,9 @@ # # Arguments passed to this script: $1 pkgname, $2 version. # -PKGNAME="${1}" -VERSION="${2}" -boot="${ROOTDIR}/boot" -etc="${ROOTDIR}/etc" -entries="${etc}/lilo.d" -name="void-${VERSION}" -entry="${entries}/${name}.conf" +[ -x "$(command -v lilo)" ] || \ + return 0 -[ -d "${boot}" ] && [ -d "${etc}" ] || exit 0 -rm -f "${entry}" - -# No default entry if the removed one was the default -sed "/^default=${name}\$/d" -i "${entries}/default.conf" - -conf="$(mktemp)" -cat "${etc}/lilo.conf" "${entries}"/*.conf > "${conf}" - -[ -x "$(command -v lilo)" ] && \ - lilo -C "${conf}" - -# Remove temporary config file -rm -f "${conf}" +# Do not abort in case of an error. +lilo || true diff --git a/srcpkgs/lilo/files/lilo.conf b/srcpkgs/lilo/files/lilo.conf deleted file mode 100644 index 1828438ca32..00000000000 --- a/srcpkgs/lilo/files/lilo.conf +++ /dev/null @@ -1,29 +0,0 @@ -# Example lilo(8) configuration. -# See lilo.conf(5) for more information. - -# Additional kernel parameter. -append="quiet" - -# Specifies the boot device. -boot="/dev/sda" - -# Devices which should be mounted as root. -root="/dev/sda2" - -# Enables map compaction. -compact - -# Prompt to start one certain kernel from the displayed menu. -prompt - -# Time to wait before booting the default kernel. -timeout=100 - -# Allow use of partitions above 1024 cylinders. -lba32 - -# Mount the root file system read-only. -read-only - -# Images are configured in /etc/lilo.d/*.conf -# End of file diff --git a/srcpkgs/lilo/template b/srcpkgs/lilo/template index 0490669adc3..46984d8e27a 100644 --- a/srcpkgs/lilo/template +++ b/srcpkgs/lilo/template @@ -1,11 +1,10 @@ # Template file for 'lilo' pkgname=lilo version=24.1 -revision=3 +revision=4 only_for_archs="i686 x86_64" hostmakedepends="bin86" makedepends="device-mapper-devel" -make_dirs="/etc/lilo.d 0755 root root" conf_files="/etc/lilo.conf" short_desc="Standard Linux boot loader" maintainer="Sören Tempel " @@ -31,9 +30,10 @@ do_install() { make DESTDIR=${DESTDIR} install mv ${DESTDIR}/sbin/* ${DESTDIR}/usr/sbin - # Setup config files rm ${DESTDIR}/etc/lilo.conf_example - vinstall ${FILESDIR}/lilo.conf 600 etc + for file in sample/*.conf; do + vsconf ${file} + done # Setup kernel hooks rm -rf ${DESTDIR}/etc/initramfs ${DESTDIR}/etc/kernel