summaryrefslogtreecommitdiff
path: root/setup-preimage
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-12-10 11:32:48 -0600
committerZach van Rijn <me@zv.io>2022-12-10 13:45:42 -0600
commite6db002716c0c46fd73ebc258ada23edbf5c7d12 (patch)
treed991697f179e07eaab1c8fdc2dad8f18efbe0111 /setup-preimage
downloadbootstrap-e6db002716c0c46fd73ebc258ada23edbf5c7d12.tar.gz
bootstrap-e6db002716c0c46fd73ebc258ada23edbf5c7d12.tar.bz2
bootstrap-e6db002716c0c46fd73ebc258ada23edbf5c7d12.tar.xz
bootstrap-e6db002716c0c46fd73ebc258ada23edbf5c7d12.zip
Initial proof of concept.
Currently, if you run this on a Linux box as an unprivileged user: $ ./bootstrap armv7 /some/scratch/directory you will end up with, completely from source: rootfs-armv7l-adelie-linux-musleabihf-preimage.tgz which is an armv7-native rootfs with all the tools that you need to build our distribution. (Substitute your favorite target). Work that remains to be done involves fixing "bootstrap.sh" in the packages.git repository, then plumbing that back into this project so that the complete process can be automated.
Diffstat (limited to 'setup-preimage')
-rwxr-xr-xsetup-preimage35
1 files changed, 35 insertions, 0 deletions
diff --git a/setup-preimage b/setup-preimage
new file mode 100755
index 0000000..7892a0d
--- /dev/null
+++ b/setup-preimage
@@ -0,0 +1,35 @@
+#!/bin/sh -e
+
+set -x;
+
+# these will require proper mounting when actually used
+mkdir -p dev proc sys tmp;
+
+# overwrite leftovers from mcmtools bootstrap
+cat > root/.bashrc <<EOF
+PATH="${PATH}";
+EOF
+
+# handle git backend issue (hardcoded paths)
+# git config --global http.sslCAInfo /cacert.pem
+cat > root/.gitconfig <<EOF
+[http]
+ sslCAInfo = "${CURL_CA_BUNDLE}"
+EOF
+
+# handle CA certificate issue (this or 'CURL_CA_BUNDLE' env var)
+cat > root/.curlrc <<EOF
+--cacert "${CURL_CA_BUNDLE}"
+EOF
+
+# hack to create abuild user and group
+# FIXME: have to use a patched 'abuild' anyway, debug me!
+cat > etc/group <<EOF
+abuild:x:300:builder
+EOF
+cat > etc/passwd <<EOF
+builder:x:1000:300::/usr/src:/bin/sh
+EOF
+
+# maybe not necessary?
+chown -R 1000:300 root etc;