Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [WIP] lilo: add configuration file for kernel hook
Date: Thu, 05 Sep 2019 14:01:09 +0200	[thread overview]
Message-ID: <20190905120109.eosG9pEWLpXuw2E8rYmoBr_j6PVMmrjq-bExrs8Su70@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-13770@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

There is an updated pull request by seitokaichou against master on the void-packages repository

https://github.com/seitokaichou/void-packages master
https://github.com/void-linux/void-packages/pull/13770

[WIP] lilo: add configuration file for kernel hook
Optionally allow the post-install hook to replace /etc/lilo.conf with one that uses the newest kernel. 
Removed the post-install hook.

A patch file from https://github.com/void-linux/void-packages/pull/13770.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-13770.patch --]
[-- Type: text/x-diff, Size: 4570 bytes --]

From 45565277bb41b10f6bb653f5193c6e533c054bda Mon Sep 17 00:00:00 2001
From: prez <prez@national.shitposting.agency>
Date: Sun, 18 Aug 2019 19:38:33 +0200
Subject: [PATCH] lilo: add configuration file for kernel hook

Optionally allow the post-install hook to replace /etc/lilo.conf with one that uses the newest kernel
---
 srcpkgs/lilo/files/kernel.d/lilo.post-install | 33 +++++++++++++++++--
 srcpkgs/lilo/files/kernel.d/lilo.post-remove  | 14 --------
 srcpkgs/lilo/files/lilo-kernel-hook.confd     | 18 ++++++++++
 srcpkgs/lilo/template                         |  8 +++--
 4 files changed, 54 insertions(+), 19 deletions(-)
 delete mode 100644 srcpkgs/lilo/files/kernel.d/lilo.post-remove
 create mode 100644 srcpkgs/lilo/files/lilo-kernel-hook.confd

diff --git a/srcpkgs/lilo/files/kernel.d/lilo.post-install b/srcpkgs/lilo/files/kernel.d/lilo.post-install
index 58fce923e62..c37c5cbb585 100644
--- a/srcpkgs/lilo/files/kernel.d/lilo.post-install
+++ b/srcpkgs/lilo/files/kernel.d/lilo.post-install
@@ -7,7 +7,36 @@
 PKGNAME="$1"
 VERSION="$2"
 
-[ -x "$(command -v lilo)" ] || \
+if [ ! -x "$(command -v lilo)" ] || [ ! -f /etc/lilo.conf ]; then
 	exit 0
+fi
 
-[ -f /etc/lilo.conf ] && lilo
+. "${ROOTDIR}/etc/default/lilo-kernel-hook"
+if [ -z "${MODIFY_LILO_CONF}" ] || [ -z "${BOOT}" ] || [ -z "${ROOT}" ]; then
+	lilo
+	exit 0
+fi
+
+cat <<EOF > /etc/lilo.conf
+lba32
+compact
+read-only
+map="/boot/System.map-${VERSION}"
+boot=${BOOT}
+
+image="/boot/vmlinuz-${VERSION}"
+EOF
+if [ -n "${OPTIONS}" ]; then
+	echo "	append=\"${OPTIONS}\"" >> /etc/lilo.conf
+fi
+if [ -n "${INITRD_ENABLED}" ]; then
+	echo "	initrd=\"/boot/initramfs-${VERSION}.img\"" >> /etc/lilo.conf
+fi
+case "$ROOT" in
+	"PARTUUID"*)
+		echo "	addappend=\" root=${ROOT}\"" >> /etc/lilo.conf ;;
+	*)
+		echo "	root=\"${ROOT}\"" >> /etc/lilo.conf ;;
+esac
+
+lilo
diff --git a/srcpkgs/lilo/files/kernel.d/lilo.post-remove b/srcpkgs/lilo/files/kernel.d/lilo.post-remove
deleted file mode 100644
index 9826229855e..00000000000
--- a/srcpkgs/lilo/files/kernel.d/lilo.post-remove
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-#
-# Kernel hook for LILO.
-#
-# Arguments passed to this script: $1 pkgname, $2 version.
-#
-PKGNAME="$1"
-VERSION="$2"
-
-[ -x "$(command -v lilo)" ] || \
-	exit 0
-
-# Do not abort kernel removal on error.
-[ -f /etc/lilo.conf ] && lilo || true
diff --git a/srcpkgs/lilo/files/lilo-kernel-hook.confd b/srcpkgs/lilo/files/lilo-kernel-hook.confd
new file mode 100644
index 00000000000..8ea0951f1a9
--- /dev/null
+++ b/srcpkgs/lilo/files/lilo-kernel-hook.confd
@@ -0,0 +1,18 @@
+# Options for the kernel hook script installed by the 'lilo' package.
+#
+# To allow the kernel hook to overwrite the lilo configuration file, set MODIFY_LILO_CONF=yes
+# Do not use this mechanism if more than one root device or kernel is needed.
+MODIFY_LILO_CONF=""
+#
+# To boot without an initrd, unset INITRD_ENABLED
+INITRD_ENABLED=yes
+#
+# Disk where new boot sector should be written to. Passed as global option to lilo. Example: 
+#BOOT="/dev/sda"
+#
+# Root device passed as global option to lilo.
+# Can also be a PARTUUID, even though lilo does not have proper support for it. Example:
+#ROOT="LABEL=void"
+#
+# Kernel command-line options. Example:
+#OPTIONS="loglevel=4 slub_debug=P page_poison=1"
diff --git a/srcpkgs/lilo/template b/srcpkgs/lilo/template
index 0a757995d97..986260e1bdf 100644
--- a/srcpkgs/lilo/template
+++ b/srcpkgs/lilo/template
@@ -1,7 +1,7 @@
 # Template file for 'lilo'
 pkgname=lilo
 version=24.2
-revision=3
+revision=4
 archs="i686* x86_64*"
 hostmakedepends="bin86"
 makedepends="device-mapper-devel"
@@ -12,6 +12,8 @@ homepage="http://www.joonet.de/lilo"
 distfiles="${DEBIAN_SITE}/main/l/${pkgname}/${pkgname}_${version}.orig.tar.gz"
 checksum=e158f19de4560c935ebe0507c21b79bff17618b9230d8076fe8c5fff9fdbd5b1
 
+conf_files="/etc/default/lilo-kernel-hook"
+
 pre_build() {
 	sed -i Makefile src/Makefile \
 		-e 's|^\tmake|\t$(MAKE)|g' \
@@ -25,6 +27,7 @@ do_build() {
 
 do_install() {
 	vmkdir usr/bin
+	vmkdir etc/
 	make DESTDIR=${DESTDIR} install
 	mv ${DESTDIR}/sbin/* ${DESTDIR}/usr/bin
 	mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin
@@ -36,10 +39,9 @@ do_install() {
 
 	# Setup kernel hooks
 	rm -rf ${DESTDIR}/etc/initramfs ${DESTDIR}/etc/kernel
+	vinstall "${FILESDIR}/lilo-kernel-hook.confd" 644 etc/default lilo-kernel-hook
 	vinstall ${FILESDIR}/kernel.d/lilo.post-install 750 \
 		etc/kernel.d/post-install 50-lilo
-	vinstall ${FILESDIR}/kernel.d/lilo.post-remove 750 \
-		etc/kernel.d/post-remove 50-lilo
 
 	vlicense COPYING
 }

      parent reply	other threads:[~2019-09-05 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-13770@inbox.vuxu.org>
2019-09-05 12:01 ` voidlinux-github
2019-09-05 12:01 ` voidlinux-github [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190905120109.eosG9pEWLpXuw2E8rYmoBr_j6PVMmrjq-bExrs8Su70@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).