summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbootstrap-main.sh29
-rwxr-xr-xbootstrap-stage1-test.sh38
2 files changed, 40 insertions, 27 deletions
diff --git a/bootstrap-main.sh b/bootstrap-main.sh
index 26e3555..6ee7dca 100755
--- a/bootstrap-main.sh
+++ b/bootstrap-main.sh
@@ -3,40 +3,15 @@
set -e
SCRIPT_DIR=
-ARCH=
-PLAT=
main()
{
SCRIPT_DIR="$(cd "${0%/*}" && pwd)"
- setup_arch_plat
+
"${SCRIPT_DIR}/bootstrap-prepare.sh"
"${SCRIPT_DIR}/bootstrap-stage1-build.sh"
"${SCRIPT_DIR}/bootstrap-stage1-install.sh"
- stage1
-}
-
-setup_arch_plat()
-{
- ARCH="$(cat /etc/proteanos_arch)"
- PLAT="$(cat /etc/proteanos_plat)"
-}
-
-stage1()
-{
- local zlib_upstream_ver
-
- sudo chroot . true
- sudo chroot . readelf -hl /usr/bin/readelf
-
- zlib_upstream_ver="$(printf '%s' ../pkg/zlib/zlib-*.orig.tar* | sed \
- 's|^.*/zlib-\([a-z0-9.~]*\).*\.orig\.tar.*$|\1|')"
- tar -xjOf ../pkg/zlib/zlib-*.orig.tar* \
- "zlib-${zlib_upstream_ver}/examples/fitblk.c" >fitblk.c
- sudo chroot . "${ARCH}-gcc" -lz -o /fitblk /fitblk.c
- sudo chroot . /fitblk | grep -F 'fitblk abort' >/dev/null
-
- cd ..
+ "${SCRIPT_DIR}/bootstrap-stage1-test.sh"
}
main "${@}"
diff --git a/bootstrap-stage1-test.sh b/bootstrap-stage1-test.sh
new file mode 100755
index 0000000..bfe11a1
--- /dev/null
+++ b/bootstrap-stage1-test.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+set -e
+
+ARCH=
+
+main()
+{
+ ARCH="$(cat /etc/proteanos_arch)"
+
+ cat <<-EOF
+ Testing packages in stage 1...
+ ==============================
+ EOF
+
+ test_packages
+}
+
+test_packages()
+{
+ local zlib_upstream_ver
+
+ cd root
+
+ sudo chroot . true
+ sudo chroot . readelf -hl /usr/bin/readelf
+
+ zlib_upstream_ver="$(printf '%s' ../pkg/zlib/zlib-*.orig.tar* | sed \
+ 's|^.*/zlib-\([a-z0-9.~]*\).*\.orig\.tar.*$|\1|')"
+ tar -xjOf ../pkg/zlib/zlib-*.orig.tar* \
+ "zlib-${zlib_upstream_ver}/examples/fitblk.c" >fitblk.c
+ sudo chroot . "${ARCH}-gcc" -lz -o /fitblk /fitblk.c
+ sudo chroot . /fitblk | grep -F 'fitblk abort' >/dev/null
+
+ cd ..
+}
+
+main "${@}"