fix(guix-bootstrap): wire mes seeds into bootstrap.scm and align xz seed link mode with Guix static bootstrap

This commit is contained in:
vxtls 2026-03-01 22:00:50 -05:00
parent 5e4c88782f
commit 5eac7edb91
3 changed files with 84 additions and 0 deletions

View file

@ -27,6 +27,8 @@ src_prepare() {
-e "s|@EXEC_XZ_HASH@|${EXEC_XZ_HASH}|g" \
-e "s|@STATIC_BINARIES_SEED_HASH@|${STATIC_BINARIES_SEED_HASH}|g" \
-e "s|@GUILE_SEED_HASH@|${GUILE_SEED_HASH}|g" \
-e "s|@MES_MINIMAL_SEED_HASH@|${MES_MINIMAL_SEED_HASH}|g" \
-e "s|@MESCC_TOOLS_SEED_HASH@|${MESCC_TOOLS_SEED_HASH}|g" \
"${patch_template}" > "${rendered_patch}"
if grep -Eq '@[A-Z0-9_]+@' "${rendered_patch}"; then
@ -41,8 +43,12 @@ src_prepare() {
grep -q "${EXEC_BASH_HASH}" "${bootstrap_scm}"
grep -q "${STATIC_BINARIES_SEED_HASH}" "${bootstrap_scm}"
grep -q "${GUILE_SEED_HASH}" "${bootstrap_scm}"
grep -q "${MES_MINIMAL_SEED_HASH}" "${bootstrap_scm}"
grep -q "${MESCC_TOOLS_SEED_HASH}" "${bootstrap_scm}"
grep -q "All bootstrap binaries must come from local, reproducible distfiles." "${bootstrap_scm}"
grep -q "%bootstrap-linux-headers-base-urls" "${bootstrap_scm}"
grep -q "mes-minimal-stripped-0.19-i686-linux.tar.xz" "${bootstrap_scm}"
grep -q "mescc-tools-static-stripped-0.5.2-i686-linux.tar.xz" "${bootstrap_scm}"
grep -q "Offline bootstrap environment: require explicit channels." guix/channels.scm
}

View file

@ -97,6 +97,76 @@
("armhf-linux"
(base32
"0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5"))
@@ -675,6 +672,44 @@
(if (not (elf-file? "bin/egrep"))
(substitute* '("bin/egrep" "bin/fgrep")
(("^exec grep") (string-append (getcwd) "/bin/grep"))))
(chmod "bin" #o555))))
+
+(define (bootstrap-mes-minimal-origin system)
+ (origin
+ (method url-fetch)
+ (uri (map (cut string-append <>
+ "/mes-minimal-stripped-0.19-i686-linux.tar.xz")
+ %bootstrap-base-urls))
+ (sha256
+ (match system
+ ((or "i686-linux" "x86_64-linux")
+ (base32 "@MES_MINIMAL_SEED_HASH@"))
+ (_
+ (base32 "@MES_MINIMAL_SEED_HASH@"))))))
+
+(define %bootstrap-mes-minimal
+ (package-from-tarball "mes-minimal-bootstrap"
+ bootstrap-mes-minimal-origin
+ "mes"
+ "Bootstrap Mes minimal binary seed"))
+
+(define (bootstrap-mescc-tools-origin system)
+ (origin
+ (method url-fetch)
+ (uri (map (cut string-append <>
+ "/mescc-tools-static-stripped-0.5.2-i686-linux.tar.xz")
+ %bootstrap-base-urls))
+ (sha256
+ (match system
+ ((or "i686-linux" "x86_64-linux")
+ (base32 "@MESCC_TOOLS_SEED_HASH@"))
+ (_
+ (base32 "@MESCC_TOOLS_SEED_HASH@"))))))
+
+(define %bootstrap-mescc-tools
+ (package-from-tarball "mescc-tools-bootstrap"
+ bootstrap-mescc-tools-origin
+ "M2-Planet"
+ "Bootstrap MesCC tools binary seed"))
(define-public %bootstrap-linux-libre-headers
(package-from-tarball
@@ -989,11 +1022,15 @@
;; own packages.
(match (%current-system)
((or "i686-linux" "x86_64-linux")
- `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)))
+ `(("linux-libre-headers" ,%bootstrap-linux-libre-headers)
+ ("mes-minimal" ,%bootstrap-mes-minimal)
+ ("mescc-tools" ,%bootstrap-mescc-tools)))
(_
`(("libc" ,%bootstrap-glibc)
("gcc" ,%bootstrap-gcc)
("binutils" ,%bootstrap-binutils)
("coreutils&co" ,%bootstrap-coreutils&co)
+ ("mes-minimal" ,%bootstrap-mes-minimal)
+ ("mescc-tools" ,%bootstrap-mescc-tools)
;; In gnu-build-system.scm, we rely on the availability of Bash.
("bash" ,%bootstrap-coreutils&co)))))
@@ -1005,5 +1042,7 @@
`(("libc" ,%bootstrap-glibc)
("gcc" ,%bootstrap-gcc)
("binutils" ,%bootstrap-binutils)
("coreutils&co" ,%bootstrap-coreutils&co)
+ ("mes-minimal" ,%bootstrap-mes-minimal)
+ ("mescc-tools" ,%bootstrap-mescc-tools)
("bash" ,%bootstrap-coreutils&co)))
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -194,8 +194,8 @@

View file

@ -2,6 +2,14 @@
SEED_PREFIX="/bootstrap-seeds/xz-5.2.4"
src_prepare() {
default
# Mirror Guix bootstrap static strategy: force libtool-built xz executable
# to link with -all-static.
sed -i 's/^xz_LDADD =/xz_LDADD = -all-static /' src/xz/Makefile.in
}
src_configure() {
./configure \
--prefix="${SEED_PREFIX}" \