Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936820 - sys-boot/lilo-24.2-r1: kernel installation hook issues
Summary: sys-boot/lilo-24.2-r1: kernel installation hook issues
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Joshua Kinard
URL: https://github.com/gentoo/gentoo/pull...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2024-07-28 07:27 UTC by Nowa Ammerlaan
Modified: 2024-10-06 12:08 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
proposed -r2 (lilo-24.2-r2.patch,6.17 KB, text/plain)
2024-07-28 07:27 UTC, Nowa Ammerlaan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nowa Ammerlaan gentoo-dev 2024-07-28 07:27:14 UTC
Created attachment 898440 [details]
proposed -r2

There are a couple of problems with the kernel installation hooks for lilo:
- they are installed in /etc instead of /usr/lib (which nowadays is the correct location for system provided hooks: https://github.com/projg2/installkernel-gentoo/issues/18)
- they lack the .install suffix
- there is no hook for installkernel[systemd] (i.e. kernel-install)

I propose the attached -r2, where I have also bumped the EAPI and resolved some minor complaints from pkgcheck.
Comment 1 Nowa Ammerlaan gentoo-dev 2024-07-28 07:28:35 UTC
Here's the diff between -r1 and -r2:

4c4
< EAPI="7"
---
> EAPI=8
6c6
< inherit flag-o-matic optfeature toolchain-funcs
---
> inherit optfeature toolchain-funcs
9d8
< IUSE="static minimal pxeserial device-mapper"
20d18
< SLOT="0"
22c20,23
< KEYWORDS="-* amd64 x86"
---
> SLOT="0"
> KEYWORDS="-* ~amd64 ~x86"
>
> IUSE="static minimal pxeserial device-mapper"
73c74
<       emake DESTDIR="${D}" install
---
>       emake DESTDIR="${ED}" install
89a91,109
>
>       # This we don't use
>       rm -r "${ED}/etc/initramfs" || die
>       # This should be in /usr/lib and it should have the .install suffix
>       dodir /usr/lib/kernel
>       for dir in postinst.d postrm.d; do
>               mv "${ED}/etc/kernel/${dir}" "${ED}/usr/lib/kernel/${dir}" || die
>               mv "${ED}/usr/lib/kernel/${dir}/zz-runlilo" "${ED}/usr/lib/kernel/${dir}/90-runlilo.install" || die
>       done
>       # Insert wrapper for systemd's kernel-install
>       exeinto /usr/lib/kernel/install.d
>       newexe - 90-runlilo.install <<-EOF
>               #!/bin/sh
>               if [ "\${1}" = "add" ]; then
>                       exec "\$(dirname \${0})/../postinst.d/90-runlilo.install"
>               elif [ "\${1}" = "remove" ]; then
>                       exec "\$(dirname \${0})/../postrm.d/90-runlilo.install"
>               fi
>       EOF
108,109c128
<       if [ "$(whoami)" != "root" ]
<       then
---
>       if [ "$(whoami)" != "root" ]; then
115,116c134
<       if [ -z "${rootpart}" ]
<       then
---
>       if [ -z "${rootpart}" ]; then
122,123c140
<       if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
<       then
---
>       if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]; then
131,132c148
<       if [ -z "${bootpart}" ]
<       then
---
>       if [ -z "${bootpart}" ]; then
137,138c153
<       if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
<       then
---
>       if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'; then
145,146c160
<       if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" /etc/lilo.conf
<       then
---
>       if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" /etc/lilo.conf; then
159,160c173
<       if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
<       then
---
>       if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]; then
165,168c178,179
<       if [[ -z "${ROOT}" ]] && use !minimal;
<       then
<               if lilocheck
<               then
---
>       if [[ -z "${ROOT}" ]] && use !minimal; then
>               if lilocheck; then
173,174c184
<                       if [ "$?" -ne 0 ]
<                       then
---
>                       if [ "$?" -ne 0 ]; then
189c199
<               "sys-kernel/installkernel[-systemd]"
---
>               sys-kernel/installkernel
Comment 2 Nowa Ammerlaan gentoo-dev 2024-09-16 08:06:57 UTC
Gentle ping, this is the last remaining package with kernel installation hooks that need fixing.
Comment 3 Larry the Git Cow gentoo-dev 2024-10-06 11:30:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98d2e2746a07b10000fee146975340b7c1156a24

commit 98d2e2746a07b10000fee146975340b7c1156a24
Author:     Joshua Kinard <kumba@gentoo.org>
AuthorDate: 2024-10-06 11:22:39 +0000
Commit:     Joshua Kinard <kumba@gentoo.org>
CommitDate: 2024-10-06 11:30:01 +0000

    sys-boot/lilo: Fix kernel installation hook issues; EAPI7 -> 8
    
    Reported-By: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
    Closes: https://bugs.gentoo.org/936820
    Signed-off-by: Joshua Kinard <kumba@gentoo.org>

 sys-boot/lilo/lilo-24.2-r2.ebuild | 200 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 200 insertions(+)
Comment 4 Nowa Ammerlaan gentoo-dev 2024-10-06 12:08:09 UTC
Thanks