logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://hacktivis.me/git/bootstrap-initrd.git
commit: ca12c53e1f8ab865ac47789e8e4e0db34a2ce21a
parent 7bea775e5acfc416176ddcf8810cb39cd6ea4c2b
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed,  8 May 2024 05:23:10 +0200

bootstrap-git.sh: Add

Diffstat:

MREADME.md1+
Abootstrap-git.sh22++++++++++++++++++++++
Mdistfiles.SHA512SUM1+
Mfetch.sh1+
Minit.sh7+++++--
Mmake-root.sh8+++++++-
6 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md @@ -132,6 +132,7 @@ Meanwhile: - 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) - gettext-tiny: Much smaller replacement to GNU gettext, for git +- git: For oasis ## Launching in QEMU ``` diff --git a/bootstrap-git.sh b/bootstrap-git.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -ex + +die() { + echo "die: $@" + exit 1 +} + +command -v make || die "Run /bootstrap-make.sh" +command -v curl || die "Run /bootstrap-tiny-curl.sh" +command -v msgfmt || die "Run /bootstrap-gettext-tiny.sh" + +tar xof /git-*.tar.gz +cd git-*/ + +LD=$CC ./configure --prefix=/usr --with-curl +unset MAKE +make +make install INSTALL=install + +cd .. +rm -fr git-*/ diff --git a/distfiles.SHA512SUM b/distfiles.SHA512SUM @@ -4,6 +4,7 @@ f9ed25683cfc6c4abe7f1203a2b82ed101ee4c9e0f9ab60755b6a09c8d1e8e4f64d413624e7bb9c4 083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3 distfiles/bzip2-1.0.8.tar.gz 31f03cc19566d007c4cffdad2ada71d99b4734ad7b13bc4f30d73d321f40cbe13b87a801aa61d9788207a851cc1f95a8af8ac732a372d45edb932f204bce3744 distfiles/cacert-2024-03-11.pem 0ed85599c8dc4114764b8eeed1e35cde97f11185c3f689e377d020758cc010ba4402febb84dba4cdc78e94fa2cd65614dafade8708ea078db5b2921925c36e78 distfiles/gettext-tiny-0.3.2.tar.gz +50ac7c57fcb9cb684378b9a944913a40cc8c17daf93757e4ffa5889d3ca0787e2f549aca1fa14ae8d416ebab02dd6674ce28d1a27786324ba0474a628e1e6549 distfiles/git-2.45.0.tar.gz 0b30b0f4c4c92a10ee2da263ea44666f445d96bac86ca4afb7bbb50d8278986e4145a7bcdf3ed9f75611bb956e93e16fc0e19874498ce3ae1a00e6fbb4f910c9 distfiles/heirloom-070715.tar.bz2 1f1f10a7b49402053172cc028bbd939a46fcf933994cb867fa40e8c5bbd7b1291575b3bac254cd79dc4fce3e3a2c88fe0f890449888fda16169c8e6a2540f055 distfiles/heirloom-devtools-070527.tar.bz2 8afbce28e3db544226987ae1979cf148515ba6a7e4a5c6beb1e58c05f3c6d01bbe81410b81ef32bea9a45788c86c7094130f56cb3f95c732906c02c05de1a370 distfiles/iproute2-6.6.0.tar.gz diff --git a/fetch.sh b/fetch.sh @@ -20,6 +20,7 @@ URLS=" https://bearssl.org/bearssl-0.6.tar.gz https://curl.se/tiny/tiny-curl-8.4.0.tar.gz https://curl.haxx.se/ca/cacert-2024-03-11.pem + https://www.kernel.org/pub/software/scm/git/git-2.45.0.tar.gz " WORKDIR="$(dirname "$0")" diff --git a/init.sh b/init.sh @@ -93,8 +93,9 @@ build_hierloom_devtools() { build_hierloom() { cd /heirloom-0*/ - mkdir -p /usr/5bin /usr/5lib /etc/default - for cmd in libcommon diff tar sort + mkdir -p /usr/5bin /usr/5lib /etc/default /usr/5bin/s42 /usr/5bin/posix2001 + for cmd in libcommon diff tar sort split comm cut find\ + libuxre ed do bmake "$cmd/Makefile" bmake CC=$CC AR="ar" RANLIB=true -C "$cmd" @@ -102,6 +103,8 @@ build_hierloom() { bmake CC=$CC AR="ar" RANLIB=true -C "$cmd" clean done ln -fs /usr/5bin/sort /bin/sort + mv /usr/5bin/ed /usr/bin/ed + mv /usr/5bin/find /usr/bin/find } build_utils_std() { diff --git a/make-root.sh b/make-root.sh @@ -31,6 +31,7 @@ distfiles=" tiny-curl-8.4.0.tar.gz cacert-2024-03-11.pem gettext-tiny-0.3.2.tar.gz + git-2.45.0.tar.gz " local_files=" init.sh @@ -49,6 +50,7 @@ local_files=" bootstrap-bearssl.sh bootstrap-tiny-curl.sh bootstrap-gettext-tiny.sh + bootstrap-git.sh " WORKDIR="$(dirname "$0")" WORKDIR="$(realpath "$WORKDIR")" @@ -173,7 +175,11 @@ sed -i \ sed -i \ -e 's;#ifdef _AIX;#if defined(_AIX) || defined(__linux__);' \ -e '/static int utf8/avoid writerr(struct oblok *op, int count, int written) {}' \ - heirloom-070715/tar/tar.c || die "Failed fixing heirloom libcommon for musl" + heirloom-070715/tar/tar.c || die "Failed fixing heirloom tar for musl" + +sed -i \ + -e 's;#ifdef _AIX;#if defined(_AIX) || defined(__linux__);' \ + heirloom-070715/find/find.c || die "Failed fixing heirloom find for musl" sed -i -e 's;libwchar.a: fake;libwchar.a:;' heirloom-070715/libwchar/Makefile.mk || die