logo

bootstrap-initrd

Linux initrd to bootstrap from a small binary seed git clone https://anongit.hacktivis.me/git/bootstrap-initrd.git/
commit: 30039cc883c686b790783efd396fd187990706f6
parent e4199565c2c490b02fa4aa888ef18869e0a20ed7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  4 Feb 2025 14:36:26 +0100

bootstrap muon

Diffstat:

MREADME.md1+
Mdistfiles.SHA512SUM1+
Mextras-build-all.sh4+++-
Aextras/muon-stage1.sh24++++++++++++++++++++++++
Aextras/muon-stage2.sh39+++++++++++++++++++++++++++++++++++++++
Aextras/pkgconf.sh31+++++++++++++++++++++++++++++++
Mfetch.sh1+
Mmake-root.sh20++++++++++++--------
8 files changed, 112 insertions(+), 9 deletions(-)

diff --git a/README.md b/README.md @@ -142,6 +142,7 @@ Meanwhile: - GNU make: Required by the other extras - xz: Not for anything yet, but requires working around libtool to build so including it - lua: For oasis +- muon: For pkgconf and git without autotools - pkgconf: For iproute2 - iproute2: Basic networking configuration - bearssl: small TLS library diff --git a/distfiles.SHA512SUM b/distfiles.SHA512SUM @@ -15,6 +15,7 @@ e713445dbd824189e3fdf0b07bf61585372b4d3bd4b87dce8dca1125baadd3681ab5be7dfec203c0 27eebbe44aae1bd4fe08aacda463d50e49e1133964ab13ef2061bdac14851b21936d04a874d2c43fc16a3c5d52c3d6b7621960bd9e393808389795212a2ed2b3 distfiles/linux-headers-6.12.6-r0.apk.x86_64 d90c6903355ee1309cb0d92a8a024522ff049091a117ea21efb585b5de35776191cd67d17a65b18c2f9d374795b7c944f047576f0e3fe818d094b26f0e4845c5 distfiles/lua-5.4.6.tar.gz 145260cbd6a8226cef3dfef0c8baba31847beaebc7e6b65d39d02715fd4f4cab9b139b6c3772e550088d4f9ae80c6d3ed20b9a7664c693644dfb96b4cb60e67c distfiles/make-4.4.1.tar.gz +a43780ec3e3f43f03909725b7de6e9277ed30701703d7b19c7e4c349b30ab97dadb629de7638e6d0cab5a3a33f8bffad63c733c41edcdcdad60fcf5adea26965 distfiles/muon-v0.3.1.tar.gz 0f874d6c7be3a69a69553d99c4b50ede6e3b92811052c13a36d8dd35955817f437f77e185d624804526d36e8cc6e99be4eedf8c2d3bcf09340068b1e41da5a49 distfiles/musl-1.2.5-r9.apk.aarch64 10f462174d0fa0caaa4e4b767848b2d3a89c70617aca562cf0cd310ee2119eee8638b9eb2909a0756ee8e8952236624c1bacaac314b2d1146cf1c47b4c9b409d distfiles/musl-1.2.5-r9.apk.armhf eb1e36d35decc8df6c383845e73a703bb5e0f322ca4ba8c346a54652f6d3c9c46d1eef901031ccfaa3a52a132963a67f35f791480f5918c091f3141775e1b1b9 distfiles/musl-1.2.5-r9.apk.riscv64 diff --git a/extras-build-all.sh b/extras-build-all.sh @@ -5,7 +5,9 @@ set -ex /extras/bearssl.sh -/extras/pkgconf-lite.sh +/extras/muon-stage1.sh +/extras/pkgconf.sh +/extras/muon-stage2.sh # libpkgconf /extras/make.sh diff --git a/extras/muon-stage1.sh b/extras/muon-stage1.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -ex + +tar xof /distfiles/muon-*.tar.gz +cd muon-*/ + +./bootstrap.sh bootstrap + +# Equivalent to commit 74174cbb3e9e1386982b18ffd0ab0e4fe72c98b2 +ed ./tests/project/meson.build <<EOF +/meson_tests_dir =/ +m-2 +w +q +EOF + +export LD=$CC + +./bootstrap/muon setup -Dprefix=/usr build +./bootstrap/muon -C build samu +./bootstrap/muon -C build install + +cd .. +rm -r ./muon-*/ diff --git a/extras/muon-stage2.sh b/extras/muon-stage2.sh @@ -0,0 +1,39 @@ +#!/bin/sh +set -ex + +die() { + echo "die: $@" + exit 1 +} + +command -v muon || die "Run /extras/muon-stage1.sh" +pkg-config --exists libpkgconf || die "Run /extras/pkgconf.sh" + +tar xof /distfiles/muon-*.tar.gz +cd muon-*/ + +# needs to re-bootstrap to get a muon which uses libpkgconf +./bootstrap.sh bootstrap + +# Equivalent to commit 74174cbb3e9e1386982b18ffd0ab0e4fe72c98b2 +ed ./tests/project/meson.build <<EOF +/meson_tests_dir =/ +m-2 +w +q +EOF + +export LD=$CC + +./bootstrap/muon setup \ + -Dprefix=/usr \ + -Dlibcurl=disabled \ + -Dlibarchive=disabled \ + -Dlibpkgconf=enabled \ + build + +./bootstrap/muon -C build samu +./bootstrap/muon -C build install + +cd .. +rm -r ./muon-*/ diff --git a/extras/pkgconf.sh b/extras/pkgconf.sh @@ -0,0 +1,31 @@ +#!/bin/sh +set -ex + +die() { + echo "die: $@" + exit 1 +} + +command -v muon || die "Run /extras/muon.sh" + +tar xof /distfiles/pkgconf-*.tar.gz +cd ./pkgconf-*/ + +ed meson.build <<EOF +/subdir('tests') +s;^;#; +w +q +EOF + +export LD="tcc" +export MAKE="pdpmake" + +muon setup -Dprefix=/usr -Dtests=disabled build +muon -C build samu +muon -C build install + +ln -sf pkgconf /usr/bin/pkg-config + +cd .. +rm -r ./pkgconf-*/ diff --git a/fetch.sh b/fetch.sh @@ -17,6 +17,7 @@ URLS=" https://curl.haxx.se/ca/cacert-2024-11-26.pem https://www.kernel.org/pub/software/scm/git/git-2.45.2.tar.gz https://mirrors.edge.kernel.org/pub/linux/kernel/people/tytso/e2fsprogs/v1.47.1/e2fsprogs-1.47.1.tar.gz + https://muon.build/releases/v0.3.1/muon-v0.3.1.tar.gz " WORKDIR="$(dirname "$0")" diff --git a/make-root.sh b/make-root.sh @@ -36,19 +36,23 @@ distfiles=" gettext-tiny-0.3.2.tar.gz git-2.45.2.tar.gz e2fsprogs-1.47.1.tar.gz + muon-v0.3.1.tar.gz " local_distfiles=" - extras/make.sh - extras/xz.sh - extras/lua.sh - extras/pkgconf-lite.sh - extras/iproute2.sh + extras-build-all.sh extras/bearssl.sh - extras/tiny-curl.sh + extras/e2fsprogs.sh extras/gettext-tiny.sh extras/git.sh - extras/e2fsprogs.sh - extras-build-all.sh + extras/iproute2.sh + extras/lua.sh + extras/make.sh + extras/muon-stage1.sh + extras/muon-stage2.sh + extras/pkgconf-lite.sh + extras/pkgconf.sh + extras/tiny-curl.sh + extras/xz.sh " WORKDIR="$(dirname "$0")" WORKDIR="$(realpath "$WORKDIR")"