logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://anongit.hacktivis.me/git/bootstrap-initrd.git/
commit: 96f22ce289dab1fcc1b0e14fd9b08ab974c15584
parent eaf189b7bea896cde4de262647dc410c8542e084
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  8 Sep 2025 02:21:40 +0200

replace e2fsprogs with genext2fs

Diffstat:

MREADME.md4++--
Mdistfiles.SHA512SUM2+-
Mextras-build-all.sh5+++--
Dextras/e2fsprogs.sh38--------------------------------------
Aextras/genext2fs.sh49+++++++++++++++++++++++++++++++++++++++++++++++++
Mfetch.sh2+-
Mmake-root.sh6++----
7 files changed, 58 insertions(+), 48 deletions(-)

diff --git a/README.md b/README.md @@ -139,16 +139,16 @@ Meanwhile: - GNU tar: [No.](https://www.roguelazer.com/blog/surprising-behavior-in-gnu-tar/) ### extras as packed tarballs -- GNU make: Required by the other extras +- genext2fs: To create an ext2 filesystem - lua: For oasis - muon: For pkgconf and git without autotools - pkgconf: For iproute2 +- GNU make: Required by the other extras - iproute2: Basic networking configuration - bearssl: small TLS library - tiny-curl: Still pretty big but hopefully close enough to the usual one - cacert (from curl.haxx.se): Maybe could be reduced to a handful of CAs (like maybe even just Let's Encrypt) - git: For oasis -- e2fsprogs: In case you need to format some extra storage You can automatically build all of the above with `/extras-build-all.sh` but be warned that some use pre-generated autotools blobs which harms reviewability. diff --git a/distfiles.SHA512SUM b/distfiles.SHA512SUM @@ -1,7 +1,7 @@ 1d6957515833c81ca3fa070bef1ddc82fab3ff03ca3e8a81aae3f8c09b01d1ed488eb8f54988f25c09cbfbc7a90a4cd1de13ba179f205580c9c73164a0ced2a8 distfiles/BearSSL-3c040368f6791553610e362401db1efff4b4c5b8.tar.gz 596d1b304f1f2d64b020d04845db10a2330c7f614a9fd0b5344afff65877d2141b3fcaa43d9e2dbc2f6a7929a1dab07df54d3d4bd69678b53906472958c7b80c distfiles/bzip2-bzip2-1.0.8.tar.gz 26c6fa1ac7bcfd523f9ab9e6c2d971103ccfc610ad0df504d4e9b064dad74576d77240c052b808f4c37c9240302a7e973a20f79ee39ac7bf3201a6fa9f0dfa96 distfiles/cacert-2024-11-26.pem -d9d8f08584a284a0b1c0fd7101a28cab7200dee7d8aa83d20105a4de4acded031cdf02ed68525b81aeb8981a1e5a3a95c1dc63a006676b95717ce10d4ee7646f distfiles/e2fsprogs-1.47.2.tar.gz +628994f4f5f6d534a42e16db5322e36addb227d0e0ee589ebebbbb6beda9c53774186a932d04fcb978fde1cbe534b8335fdbfea256aecd2d873c03bc5892a8ce distfiles/genext2fs-v1.5.0.tar.gz cac867bf4b7bfa0a02dfc01b551c380d3a66f8c09af4666e8f36f9898ece201ddd23511d7e8c08a20ae0a4cdb013be8b4ccf5777cf85ba9c2cf77c1e7bb72966 distfiles/git-2.50.0.tar.gz 0b30b0f4c4c92a10ee2da263ea44666f445d96bac86ca4afb7bbb50d8278986e4145a7bcdf3ed9f75611bb956e93e16fc0e19874498ce3ae1a00e6fbb4f910c9 distfiles/heirloom-070715.tar.bz2 1f1f10a7b49402053172cc028bbd939a46fcf933994cb867fa40e8c5bbd7b1291575b3bac254cd79dc4fce3e3a2c88fe0f890449888fda16169c8e6a2540f055 distfiles/heirloom-devtools-070527.tar.bz2 diff --git a/extras-build-all.sh b/extras-build-all.sh @@ -1,6 +1,8 @@ #!/bin/sh set -ex +/extras/genext2fs.sh + /extras/lua.sh /extras/bearssl.sh @@ -15,6 +17,5 @@ set -ex /extras/make.sh -/extras/e2fsprogs.sh # make - /extras/iproute2.sh # make pkgconf + diff --git a/extras/e2fsprogs.sh b/extras/e2fsprogs.sh @@ -1,38 +0,0 @@ -#!/bin/sh -set -ex - -die() { - echo "die: $@" - exit 1 -} - -command -v make || die "Run /extras/make.sh" - -cd /extras/e2fsprogs-*/ - -LD=tcc ./configure --disable-nls --disable-backtrace - -# Replace __GNUC_PREREQ calls with 1 -ed lib/ext2fs/rbtree.h <<EOF -101 -c -#if 1 -. -p -179 -c -#if 1 -. -w -q -EOF - -make clean - -# With pdpmake-2.0.3: -# pdpmake: don't know how to make all -make - -make install INSTALL=install - -cd - diff --git a/extras/genext2fs.sh b/extras/genext2fs.sh @@ -0,0 +1,49 @@ +#!/bin/sh +set -ex + +die() { + echo "die: $@" + exit 1 +} + +cd /extras/genext2fs-*/ + +# Cleaned up after ./configure --disable-libarchive CC=tcc +cat >config.h <<EOF +#define HAVE_DIRENT_H 1 +#define HAVE_FCNTL_H 1 +#define HAVE_GETLINE 1 +#define HAVE_GETOPT_H 1 +#define HAVE_GETOPT_LONG 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_LIBGEN_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_SNPRINTF 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRTOF 1 +#define HAVE_STRUCT_STAT_ST_RDEV 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_WCHAR_H 1 +#define MAJOR_IN_SYSMACROS 1 +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "1.4.2" +EOF + +${CC} ${CFLAGS} -I./ -o /bin/genext2fs genext2fs.c + +# Needs md5sum +#ln -s /bin/genext2fs ./genext2fs +#./test.sh + +cd - diff --git a/fetch.sh b/fetch.sh @@ -14,7 +14,6 @@ URLS=" https://curl.se/tiny/tiny-curl-8.4.0.tar.gz https://curl.haxx.se/ca/cacert-2024-11-26.pem https://git.kernel.org/pub/scm/git/git.git/snapshot/git-2.50.0.tar.gz - https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.2/e2fsprogs-1.47.2.tar.gz https://muon.build/releases/v0.5.0/muon-v0.5.0.tar.gz " WORKDIR="$(dirname "$0")" @@ -67,6 +66,7 @@ fetch_forge https://github.com/onetrueawk/awk/archive nawk 20250116 fetch_forge https://github.com/ibara/oksh/archive/refs/tags oksh oksh-7.7 fetch_forge https://github.com/ibara/yacc/archive/refs/tags yacc oyacc-6.6 fetch_forge https://github.com/pkgconf/pkgconf/archive/refs/tags pkgconf pkgconf-2.4.3 +fetch_forge https://github.com/bestouff/genext2fs/archive genext2fs v1.5.0 # suckless.org doesn't provides snapshots of sbase (yet?) test -e sbase-b30fb568.tar.gz || curl ${CURL_OPTS} -o sbase-b30fb568.tar.gz https://git.sr.ht/~mcf/sbase/archive/b30fb56804bfed69b45ef0e944d2e029e4d26258.tar.gz diff --git a/make-root.sh b/make-root.sh @@ -33,8 +33,8 @@ extra_tarballs=" BearSSL-3c040368f6791553610e362401db1efff4b4c5b8.tar.gz tiny-curl-8.4.0.tar.gz git-2.50.0.tar.gz - e2fsprogs-1.47.2.tar.gz muon-v0.5.0.tar.gz + genext2fs-v1.5.0.tar.gz " extra_distfiles=" cacert-2024-11-26.pem @@ -42,7 +42,7 @@ extra_distfiles=" extra_local_files=" extras-build-all.sh extras/bearssl.sh - extras/e2fsprogs.sh + extras/genext2fs.sh extras/git.sh extras/iproute2.sh extras/lua.sh @@ -118,8 +118,6 @@ if ! test "${EXCLUDE_EXTRAS:+y}" = "y"; then rm -r ./extras/git-*/t ./extras/git-*/po ./extras/git-*/Documentation/RelNotes || die - rm -r ./extras/e2fsprogs-*/tests ./extras/e2fsprogs-*/po || die - # config.status: error: cannot find input file: `tests/Makefile.in' #rm -r ./extras/tiny-curl-*/tests || die