Add Guix step including bootstrap bin, build guix, build iso and fix some small bug

This commit is contained in:
vxtls 2026-02-28 19:19:18 -05:00
parent fb146bbf97
commit 3178f1f9e0
36 changed files with 890 additions and 7 deletions

66
steps-guix/guix-1.5.0/pass1.sh Executable file
View file

@ -0,0 +1,66 @@
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
local bootstrap_scm patch_template rendered_patch
default
if [ ! -f /tmp/guix-bootstrap-seeds.env ]; then
echo "Missing /tmp/guix-bootstrap-seeds.env" >&2
false
fi
. /tmp/guix-bootstrap-seeds.env
bootstrap_scm="gnu/packages/bootstrap.scm"
patch_template="${base_dir}/patches/bootstrap-local-seeds.patch.in"
rendered_patch="/tmp/guix-bootstrap-local-seeds.patch"
if [ ! -f "${patch_template}" ]; then
echo "Missing patch template: ${patch_template}" >&2
false
fi
sed \
-e "s|@EXEC_BASH_HASH@|${EXEC_BASH_HASH}|g" \
-e "s|@EXEC_MKDIR_HASH@|${EXEC_MKDIR_HASH}|g" \
-e "s|@EXEC_TAR_HASH@|${EXEC_TAR_HASH}|g" \
-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" \
"${patch_template}" > "${rendered_patch}"
if grep -Eq '@[A-Z0-9_]+@' "${rendered_patch}"; then
echo "Unexpanded placeholder found in ${rendered_patch}" >&2
false
fi
patch --dry-run -p1 < "${rendered_patch}"
patch -p1 < "${rendered_patch}"
grep -q 'file:///external/distfiles/' "${bootstrap_scm}"
grep -q "${EXEC_BASH_HASH}" "${bootstrap_scm}"
grep -q "${STATIC_BINARIES_SEED_HASH}" "${bootstrap_scm}"
grep -q "${GUILE_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 "Offline bootstrap environment: require explicit channels." guix/channels.scm
}
src_configure() {
local host_triplet
host_triplet="$(gcc -dumpmachine)"
./configure \
--prefix="${PREFIX}" \
--libdir="${LIBDIR}" \
--host="${host_triplet}" \
--build="${host_triplet}"
}
src_compile() {
default_src_compile
}
src_install() {
default_src_install
}

View file

@ -0,0 +1,112 @@
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -109,13 +109,13 @@
,(base32 "1cqqavghjfr0iwxqf61lrssv27wfigysgq2rs4rm1gkmn04yn1k3")))
("i686-linux"
("bash"
- ,(base32 "0rjaxyzjdllfkf1abczvgaf3cdcc7mmahyvdbkjmjzhgz92pv23g"))
+ ,(base32 "@EXEC_BASH_HASH@"))
("mkdir"
- ,(base32 "133ybmfpkmsnysrzbngwvbysqnsmfi8is8zifs7i7n6n600h4s1w"))
+ ,(base32 "@EXEC_MKDIR_HASH@"))
("tar"
- ,(base32 "07830bx29ad5i0l1ykj0g0b1jayjdblf01sr3ww9wbnwdbzinqms"))
+ ,(base32 "@EXEC_TAR_HASH@"))
("xz"
- ,(base32 "0i9kxdi17bm5gxfi2xzm0y73p3ii0cqxli1sbljm6rh2fjgyn90k")))
+ ,(base32 "@EXEC_XZ_HASH@")))
("i586-gnu"
("bash"
,(base32 "1as8649aqaibahhhrvkj10ci8shpi4hq5n7gnik8rhhy0dc1jarg"))
@@ -164,15 +164,12 @@
(define %bootstrap-executable-base-urls
;; This is where the bootstrap executables come from.
- '("https://ftpmirror.gnu.org/guix/bootstrap/"
- "https://git.savannah.gnu.org/cgit/guix.git/plain/gnu/packages/bootstrap/"
- "https://alpha.gnu.org/gnu/guix/bootstrap/"
- "http://flashner.co.il/guix/bootstrap/"
- "http://lilypond.org/janneke/guix/"))
+ '("file:///external/distfiles/"))
(define (bootstrap-executable-file-name system program)
"Return the FILE-NAME part of url where PROGRAM can be found for SYSTEM."
(match system
+ ("i686-linux" (string-append "i686-linux/bootstrap-exec-" program "-i686-linux"))
("powerpc64le-linux" (string-append system "/20210106/" program))
("i586-gnu" (string-append system "/20200326/" program))
("x86_64-gnu" (string-append system "/20241122/" program))
@@ -388,15 +385,15 @@
("riscv64-linux"
"/20210725/guile-3.0.2.tar.xz")
(_
- "/20131110/guile-2.0.9.tar.xz"))))
+ "/guile-static-stripped-2.2.4-i686-linux.tar.xz"))))
(define (bootstrap-guile-hash system)
"Return the SHA256 hash of the Guile bootstrap tarball for SYSTEM."
(match system
("x86_64-linux"
- (base32 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3"))
+ (base32 "@GUILE_SEED_HASH@"))
("i686-linux"
- (base32 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp"))
+ (base32 "@GUILE_SEED_HASH@"))
("mips64el-linux"
(base32 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr"))
("armhf-linux"
@@ -458,8 +455,8 @@
(lambda (p)
(format p "\
#!~a
-export GUILE_SYSTEM_PATH=~a/share/guile/2.0
-export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/2.0/ccache
+export GUILE_SYSTEM_PATH=~a/share/guile/2.2
+export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/2.2/ccache
exec -a \"~a0\" ~a \"~a@\"\n"
bash out out dollar guile-real dollar)))
(chmod guile #o555)
@@ -480,8 +477,8 @@
~a -dc < $GUILE_TARBALL | ~a xv
# Use the bootstrap guile to create its own wrapper to set the load path.
-GUILE_SYSTEM_PATH=$out/share/guile/2.0 \
-GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.0/ccache \
+GUILE_SYSTEM_PATH=$out/share/guile/2.2 \
+GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.2/ccache \
$out/bin/guile -c ~s $out ~a
# Sanity check.
@@ -625,16 +622,16 @@
("riscv64-linux"
"/20210725/static-binaries.tar.xz")
(_
- "/20131110/static-binaries.tar.xz")))
+ "/static-binaries-0-i686-linux.tar.xz")))
%bootstrap-base-urls))
(sha256
(match system
("x86_64-linux"
(base32
- "0c533p9dhczzcsa1117gmfq3pc8w362g4mx84ik36srpr7cx2bg4"))
+ "@STATIC_BINARIES_SEED_HASH@"))
("i686-linux"
(base32
- "0s5b3jb315n13m1k8095l0a5hfrsz8g0fv1b6riyc5hnxqyphlak"))
+ "@STATIC_BINARIES_SEED_HASH@"))
("armhf-linux"
(base32
"0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5"))
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -194,8 +194,8 @@
(introduction %guix-channel-introduction)))
(define %default-channels
- ;; Default list of channels.
- (list %default-guix-channel))
+ ;; Offline bootstrap environment: require explicit channels.
+ '())
(define (guix-channel? channel)
"Return true if CHANNEL is the 'guix' channel."

View file

@ -0,0 +1,34 @@
--- guix-1.5.0/gnu/packages/bootstrap.scm
+++ guix-1.5.0/gnu/packages/bootstrap.scm
@@ -357,8 +357,9 @@
;;; Bootstrap packages.
;;;
-(define %bootstrap-base-urls
- ;; This is where the initial binaries come from.
+(define %bootstrap-linux-headers-base-urls
+ ;; Keep linux headers as an explicit exception: text headers can still come
+ ;; from the historical bootstrap mirrors.
'("https://ftpmirror.gnu.org/guix/bootstrap/"
"https://ftp.gnu.org/gnu/guix/bootstrap"
"https://alpha.gnu.org/gnu/guix/bootstrap"
@@ -369,6 +370,10 @@
"http://flashner.co.il/guix/bootstrap"
"http://lilypond.org/janneke/guix/"))
+(define %bootstrap-base-urls
+ ;; All bootstrap binaries must come from local, reproducible distfiles.
+ '("file:///external/distfiles"))
+
(define (bootstrap-guile-url-path system)
"Return the URI for FILE."
(string-append "/" system
@@ -684,7 +689,7 @@
(uri (map (cute string-append <>
"/i686-linux/20190815/"
"linux-libre-headers-stripped-4.14.67-i686-linux.tar.xz")
- %bootstrap-base-urls))
+ %bootstrap-linux-headers-base-urls))
(sha256
(base32
"0sm2z9x4wk45bh6qfs94p0w1d6hsy6dqx9sw38qsqbvxwa1qzk8s"))))

View file

@ -0,0 +1 @@
f https://ftpmirror.gnu.org/gnu/guix/guix-1.5.0.tar.gz df2102eed00aff0b17275654a42f094c8a1117ec065884eb1ff76005e47415c5