fff7d1bc / better-initramfs

Small and reliable initramfs solution supporting (remote) rescue shell, lvm, dmcrypt luks, software raid, tuxonice, uswsusp and more.
BSD 3-Clause "New" or "Revised" License
314 stars 49 forks source link

better-initramfs update ? #56

Open jeandestouches opened 1 year ago

jeandestouches commented 1 year ago

Hello, Are you planning to update better-initramfs? There are a couple of updates available since last release. Only one without update being vconfig if I'm correct.

alpine 3.14.2 > 3.17.2

busybox 1.33.1 > 1.34.1
cryptsetup 2.4.0 > 2.4.3
dropbear 2020.81 > 2022.83
json-c 0.15 > 0.16
libaio 0.3.112 > 0.3.113
libblkid 2.37 > 2.38.1
libgcrypt 1.8.8 > 1.10.1
libgpg-error 1.42 > 1.46
libuuid 2.37 > 2.38.1
lvm2 2.02.188 > 2.03.19
mdadm 4.1 > 4.2
popt 1.18 > 1.19
zlib 1.2.11 > 1.2.13

Thanks! Cheers

fff7d1bc commented 1 year ago

Yes, I just found the project to be mostly feature completed and I do not invest much time into it. There's however many parts that I'd like to entirely rewrite, and add static eudev for proper /run/udev that is then required for systemd and lvm running under systemd.

Anyhow thanks for showing interest, I've just pushed update with new sysroot, I will update deps to new versions and maybe finally add some distfiles checksum validation while at it too.

unqueued commented 1 year ago

I'm really glad to hear that @slashbeast, I have been working on it on my own as well.

BTW have you had a chance to revisit my PRs for ip4ll and dns? I was thinking of just rebasing and combining my networking updates, since they are behind master now.

jeandestouches commented 1 year ago

Thanks @slashbeast I forgot to mention missing ecdsa support for dropbear but noticed you added it already, nice. https://github.com/slashbeast/better-initramfs/commit/732c3617417762faffb60e53683d4404bf1d9303

I personally added a kexec-tools lebuild a few months ago to be able to kexec to a different kernel (or pass kernel options) straight from initramfs. It works fine. I don't know if you feel like to add it ? Otherwise, I just let this here for those interested to try.

Size of the compiled binary : 255K

From: jean <jean@localhost.lan>
Date: Fri, 17 Mar 2023 10:54:16 +0100
Subject: [PATCH 1/2] add kexec 2.0.24 lebuild

---
 bootstrap/lebuilds/kexec-tools.lebuild | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 bootstrap/lebuilds/kexec-tools.lebuild

diff --git a/bootstrap/lebuilds/kexec-tools.lebuild b/bootstrap/lebuilds/kexec-tools.lebuild
new file mode 100644
index 0000000..dd42607
--- /dev/null
+++ b/bootstrap/lebuilds/kexec-tools.lebuild
@@ -0,0 +1,20 @@
+#!/bin/sh
+name='kexec-tools'
+version='2.0.24'
+sources=( "https://www.kernel.org/pub/linux/utils/kernel/kexec/${name}-${version}.tar.xz" )
+homepage='https://kernel.org/pub/linux/utils/kernel/kexec'
+license='GPLv2'
+
+build_cmd="
+    export CFLAGS=\"\$CFLAGS -static\" && \
+    export CXXFLAGS=\"\$CXXFLAGS -static\" && \
+    cd /source/${name}-${version} && \
+    ./configure --prefix=/binit/prefix && \
+    make -j ${cores_num:-1} && \
+    make install
+"
+deploy="/binit/prefix/sbin/kexec"
+
+fetch_source
+install_source
+build_source
-- 
2.39.2
From 50621a9586490f7579027657656d67d5db10a918 Mon Sep 17 00:00:00 2001
From: jean <jean@localhost.lan>
Date: Fri, 17 Mar 2023 10:59:36 +0100
Subject: [PATCH 2/2] add kexec support

---
 bootstrap/bootstrap-all.conf | 2 +-
 scripts/meta                 | 6 ++++++
 scripts/release              | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/bootstrap/bootstrap-all.conf b/bootstrap/bootstrap-all.conf
index 28de1c3..4864076 100644
--- a/bootstrap/bootstrap-all.conf
+++ b/bootstrap/bootstrap-all.conf
@@ -1 +1 @@
-packages='busybox libaio lvm2 zlib dropbear libuuid popt libgpg-error libgcrypt json-c libblkid cryptsetup askpass mdadm vconfig'
+packages='busybox libaio lvm2 zlib dropbear libuuid popt libgpg-error libgcrypt json-c libblkid cryptsetup askpass mdadm kexec-tools vconfig'
diff --git a/scripts/meta b/scripts/meta
index 7d59ce9..70ac9ff 100755
--- a/scripts/meta
+++ b/scripts/meta
@@ -95,6 +95,12 @@ prepare() {
        ewarn "No mdadm binary found, Software Raid support will be disabled."
    fi

+  if test -f kexec; then
+    install -m 755 kexec "${sourceroot}/bin/kexec"
+  else
+    ewarn "No kexec binary found, kexec support will be disabled."
+  fi
+
    if test -f dropbearmulti; then
        install -m 755 dropbearmulti "${sourceroot}/bin/dropbearmulti"
        ( cd "${sourceroot}/bin/" && rm -f dropbear dropbearkey dbclient && ln -s dropbearmulti dropbear && ln -s dropbearmulti dropbearkey && ln -s dropbearmulti dbclient )
diff --git a/scripts/release b/scripts/release
index 7c9bd08..bbabd84 100755
--- a/scripts/release
+++ b/scripts/release
@@ -97,7 +97,7 @@ for arch in ${arches}; do
    # cleanup
    rm -f "${workdir:-/LEFAIL}"/bootstrap/output/*
    rm -f "${workdir:-/LEFAIL}"/output/initramfs.cpio.gz
-   rm -f "${workdir:-/LEFAIL}"/sourceroot/bin/{busybox,sh,cryptsetup,lvm,mdadm,dropbearmulti,dropbear,dropbearkey,resume}
+   rm -f "${workdir:-/LEFAIL}"/sourceroot/bin/{busybox,sh,cryptsetup,lvm,mdadm,kexec,dropbearmulti,dropbear,dropbearkey,resume}

    ( 
        cd "${workdir}" || die
-- 
2.39.2
fff7d1bc commented 1 year ago

It might make sense if better-initramfs will get features similar to https://github.com/open-power/petitboot but I do not see use for it. So I will leave it out, however if you feel like it might be of use for others feel free to make pull request with lebuild just leave it out of default installation list for now.

fff7d1bc commented 1 year ago

FWIW it is still on my radar of things to do in near future, along with eudev support so finally the systemd can get proper /run/udev from initramfs.

unqueued commented 1 year ago

Well it has been like four years, but I reviewed everything. When binit_net_addr=dhcp is set, then nameservers will be set automatically, unless one or more binit_net_nss has been set. I also included link-local support from https://github.com/slashbeast/better-initramfs/pull/49, since that is usually included in dhcp clients anyway, and wouldn't be unexpected. Let me know what you think.