Github messages for voidlinux
 help / color / mirror / Atom feed
* Re: [PR PATCH] [Updated] [WIP] lilo: add configuration file for kernel hook
       [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
  1 sibling, 0 replies; 2+ messages in thread
From: voidlinux-github @ 2019-09-05 12:01 UTC (permalink / raw)
  To: ml

[-- 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
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] lilo: add configuration file for kernel hook
       [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-13770@inbox.vuxu.org>
  2019-09-05 12:01 ` [PR PATCH] [Updated] [WIP] lilo: add configuration file for kernel hook voidlinux-github
@ 2019-09-05 12:01 ` voidlinux-github
  1 sibling, 0 replies; 2+ messages in thread
From: voidlinux-github @ 2019-09-05 12:01 UTC (permalink / raw)
  To: ml

[-- 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
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-05 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-13770@inbox.vuxu.org>
2019-09-05 12:01 ` [PR PATCH] [Updated] [WIP] lilo: add configuration file for kernel hook voidlinux-github
2019-09-05 12:01 ` voidlinux-github

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).