commit: 1bc4296091c51f53a5598050c8956d16e945b0f5
parent af610ab70b2cf461ad643fbb572f2a8c822efb01
Author: Andrius Štikonas <andrius@stikonas.eu>
Date: Sun, 16 Apr 2023 16:00:44 +0100
Merge pull request #282 from eduardosm/build-kernels-in-chroot
Add option to build kernels and related tools during chroot and bwrap builds
Diffstat:
14 files changed, 72 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/bwrap.yml b/.github/workflows/bwrap.yml
@@ -43,7 +43,7 @@ jobs:
key: cache-${{ hashFiles('sys*/*/sources') }}
- name: Run bootstrap
id: bootstrap
- run: ./rootfs.py --bwrap --external-sources --preserve --cores 2
+ run: ./rootfs.py --bwrap --external-sources --build-kernels --preserve --cores 2
- name: Archive created packages
if: steps.bootstrap.conclusion == 'success'
uses: actions/upload-artifact@v3
diff --git a/rootfs.py b/rootfs.py
@@ -39,6 +39,7 @@ def create_configuration_file(args):
config.write("KERNEL_BOOTSTRAP=True\n")
else:
config.write("KERNEL_BOOTSTRAP=False\n")
+ config.write(f"BUILD_KERNELS={args.update_checksums or args.build_kernels}\n")
# pylint: disable=too-many-statements
def main():
@@ -73,6 +74,9 @@ def main():
parser.add_argument("--external-sources",
help="Download sources externally from live-bootstrap.",
action="store_true")
+ parser.add_argument("--build-kernels",
+ help="Also build kernels in chroot and bwrap builds.",
+ action="store_true")
parser.add_argument("--no-create-config",
help="Do not automatically create config file",
action="store_true")
diff --git a/sysa/SHA256SUMS.pkgs b/sysa/SHA256SUMS.pkgs
@@ -16,8 +16,8 @@ a7bd12bd0c639783ce1c0e9f640cf004a87460bbda8154bc550c5e6884457b48 automake-1.15.
57100612d902537b72ee2fd3dfecc903f2ea3959f1a480af87c6a1ef9a9d7c03 automake-1.16.3_0.tar.bz2
1c7e09ac08f156960420fca1f6e8560c1855bf01b001a0648b56153d6ceb9c28 automake-1.6.3_0.tar.bz2
444131776779d1f27628088a817bfb8c9aa85f4b036b934794a71e484ec9bd70 automake-1.6.3_1.tar.bz2
-ef08694bf8e78ffcf56f9c8a63b0f189e301c06f02ab240e15e4c7fe354c2a0d automake-1.7_0.tar.bz2
e8ff13753943e43972a8cf1672819f001718ed38e5497cf7b554c21a507ba22b automake-1.7.8_0.tar.bz2
+ef08694bf8e78ffcf56f9c8a63b0f189e301c06f02ab240e15e4c7fe354c2a0d automake-1.7_0.tar.bz2
9922651b64ad2e29b944082f26db223008220155048f25d64df1f6d82071ff1c automake-1.8.5_0.tar.bz2
c5807850a377e4bb9aa4121d9781d145bdd80327626a9419630a75ce2c8d9c71 automake-1.9.6_0.tar.bz2
46282b2a7c2e3d50bac2d3f90fee56629c4a533a962ad61eabac6395a3b676db bash-5.2.15_0.tar.bz2
@@ -84,20 +84,20 @@ e0c91898e771c65e6a462600243a7858b069db5726680193f86d7dbac3f740ae openssl-1.1.1l
69daf6ffbf26fea500426c6936e5a16e82833f03ad0dc6109697f69a8516b4c7 patch-2.7.6_0.tar.bz2
914a7abf36a64723b6e9f9b0b6ccd19c8e544fa798896a2bb1151dc341890c22 perl-5.000_0.tar.bz2
887d835562d471653bcda60e652fceb4b3ef58a83321a4eb5af0431dc182781b perl-5.003_0.tar.bz2
-b86fc586d72a6d204d0b9017afe17aa2439529e13f43befc56648b78de17c8f8 perl5.004-05_0.tar.bz2
-451ae6bb6e996a1c857fe92ec379654413fadec180c6477cf5fd4b5d7a079e26 perl5.005-03_0.tar.bz2
a2e1f93eeaa3985c660cc73645930489bad6d68011e4ae6892c6b09c8f02395b perl-5.10.1_0.tar.bz2
8f2730b029a4e62792460ea0448b8f1806d15e5175f3004b31b153d16cb7f4d1 perl-5.32.1_0.tar.bz2
9fa8850897248d77d554caa2b3d52e7890308cbf28750ffc24c09f498aee563c perl-5.6.2_0.tar.bz2
+b86fc586d72a6d204d0b9017afe17aa2439529e13f43befc56648b78de17c8f8 perl5.004-05_0.tar.bz2
+451ae6bb6e996a1c857fe92ec379654413fadec180c6477cf5fd4b5d7a079e26 perl5.005-03_0.tar.bz2
d0c03003eaf21045e13afd2551df952a568e97cea91dec7edb0b829016d434b4 pkg-config-0.29.2_0.tar.bz2
bbe7955df4eec1e4c21ae397545943abc0ef55d1b136d6f30f1550f82cf0cb22 python-2.0.1_0.tar.bz2
281cc79f24007f4667ae5914f89c671be3b2d008fb5296d66b65314d30a7e768 python-2.0.1_1.tar.bz2
66f1571ecc2f00cee322e419f0d53127b2465330bbd8fe01d2fe0af91b9084fc python-2.3.7_0.tar.bz2
7c65497273651adda57d156f7380f07bbeb73dfa96fd6432ed0e3b82a44b7d65 python-2.3.7_1.tar.bz2
203119d5d6bc56f9253abbf6583c9a8bccd00e7b34d2a126b7f4c61294abb0d5 python-2.5.6_0.tar.bz2
-284ef5e0c44e5e3f2a2e6c3a9dd55ad26a200d6701279383cdbaca0fb2dc831b python-3.11.1_0.tar.bz2
b8e03286ff4aae2a47e61dd7a11d4b272717a181cbcfa8da3fee91e67c007f94 python-3.1.5_0.tar.bz2
4857037c9db993f8feef1de8e4918692a066771713aa25b66e69392b987a0122 python-3.1.5_1.tar.bz2
+284ef5e0c44e5e3f2a2e6c3a9dd55ad26a200d6701279383cdbaca0fb2dc831b python-3.11.1_0.tar.bz2
8bcf91d546333a2af3bfef23aeb0f3e98979715100b48a7c373cd2f22ebb6fb9 python-3.3.7_0.tar.bz2
4568978b5bc0cb501ff6ef5c632c0018ca0c1ed6361b8d18c2fd8bf3d03fc62e python-3.4.10_0.tar.bz2
f19dceb161ed1d1d7cdad8ef54d2688a022ab6e26fe73e66d52b2dc362acb3c5 python-3.8.16_0.tar.bz2
diff --git a/sysa/kexec-fiwix/kexec-fiwix.checksums b/sysa/kexec-fiwix/kexec-fiwix.checksums
@@ -0,0 +1 @@
+afb30f2e80adefc979bdffdb525cf2862897f0beefbb0740fbd05ab3246a32c9 /usr/bin/kexec-fiwix
diff --git a/sysa/kexec-fiwix/kexec-fiwix.kaem b/sysa/kexec-fiwix/kexec-fiwix.kaem
@@ -2,3 +2,14 @@
# SPDX-License-Identifier: MIT
cd src
tcc -m32 -march=i386 -std=c89 -I../../tcc/tcc-0.9.27/include -o ${bindir}/kexec-fiwix kexec-fiwix.c
+cd ..
+
+# Checksums
+if match x${UPDATE_CHECKSUMS} xTrue; then
+ sha256sum -o ${pkg}.checksums \
+ /usr/bin/kexec-fiwix
+
+ cp ${pkg}.checksums ${srcdir}
+else
+ sha256sum -c ${pkg}.checksums
+fi
diff --git a/sysa/kexec-tools-2.0.22/kexec-tools-2.0.22.sh b/sysa/kexec-tools-2.0.22/kexec-tools-2.0.22.sh
@@ -11,5 +11,8 @@ src_prepare() {
src_configure() {
./configure --prefix="${PREFIX}" \
- --sbindir="${PREFIX}/bin"
+ --sbindir="${PREFIX}/bin" \
+ --build=i686-pc-linux-gnu \
+ --host=i686-pc-linux-gnu \
+ --target=i686-pc-linux-gnu
}
diff --git a/sysa/lwext4-1.0.0-lb1/lwext4-1.0.0-lb1.checksums b/sysa/lwext4-1.0.0-lb1/lwext4-1.0.0-lb1.checksums
@@ -0,0 +1 @@
+0a3f0012c01cb5aee0643f1674f265e68b5eeadb37596bcc4fe60aad55c9d3d7 /usr/bin/make_fiwix_initrd
diff --git a/sysa/lwext4-1.0.0-lb1/lwext4-1.0.0-lb1.kaem b/sysa/lwext4-1.0.0-lb1/lwext4-1.0.0-lb1.kaem
@@ -46,3 +46,15 @@ catm make_fiwix_initrd.c ../../../files/make_fiwix_initrd.c
tcc -m32 -march=i386 -std=c89 -I../include -I../build_generic/include -I../../tcc/tcc-0.9.27/include -DVERSION="\"1.0\"" -c make_fiwix_initrd.c
tcc -m32 -o ${bindir}/make_fiwix_initrd ext4.o ext4_balloc.o ext4_bcache.o ext4_bitmap.o ext4_block_group.o ext4_blockdev.o ext4_crc32.o ext4_debug.o ext4_dir.o ext4_dir_idx.o ext4_extent.o ext4_fs.o ext4_hash.o ext4_ialloc.o ext4_inode.o ext4_journal.o ext4_mbr.o ext4_mkfs.o ext4_super.o ext4_trans.o ext4_xattr.o ../blockdev/linux/file_dev.o make_fiwix_initrd.o
+
+cd ../../..
+
+# Checksums
+if match x${UPDATE_CHECKSUMS} xTrue; then
+ sha256sum -o ${pkg}.checksums \
+ /usr/bin/make_fiwix_initrd
+
+ cp ${pkg}.checksums ${srcdir}
+else
+ sha256sum -c ${pkg}.checksums
+fi
diff --git a/sysa/run.kaem b/sysa/run.kaem
@@ -45,7 +45,17 @@ cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
+BUILD_FIWIX=False
+
if match x${KERNEL_BOOTSTRAP} xTrue; then
+ BUILD_FIWIX=True
+fi
+
+if match x${BUILD_KERNELS} xTrue; then
+ BUILD_FIWIX=True
+fi
+
+if match x${BUILD_FIWIX} xTrue; then
# The Fiwix kernel
pkg="fiwix-1.4.0-lb1"
cd ${pkg}
@@ -58,14 +68,16 @@ if match x${KERNEL_BOOTSTRAP} xTrue; then
kaem --verbose --file ${pkg}.kaem
cd ..
- # Build the ext2 image
- make_fiwix_initrd
-
# Live boot loader for Fiwix
pkg="kexec-fiwix"
cd ${pkg}
kaem --verbose --file ${pkg}.kaem
cd ..
+fi
+
+if match x${KERNEL_BOOTSTRAP} xTrue; then
+ # Build the ext2 image
+ make_fiwix_initrd
# Boot Fiwix
kexec-fiwix
diff --git a/sysa/run2.sh b/sysa/run2.sh
@@ -73,7 +73,7 @@ build ed-1.4
build bc-1.07.1
-if [ "${CHROOT}" = False ]; then
+if [ "${CHROOT}" = False ] || [ "${BUILD_KERNELS}" = True ]; then
# Save because linux deletes all distfiles to save space
cp "${DISTFILES}"/musl-1.2.3.tar.gz "${SOURCES}"/musl-1.2.3
fi
@@ -86,13 +86,15 @@ grep --no-filename '^build' "${SOURCES}"/run*.sh | grep -v musl-1.2.3 | sed "s/b
rm -rf "${SOURCES:?}/${p:?}"
done
-if [ "${CHROOT}" = False ]; then
+if [ "${CHROOT}" = False ] || [ "${BUILD_KERNELS}" = True ]; then
build kexec-tools-2.0.22
build linux-4.9.10
+fi
- build musl-1.2.3 '' no-patches
+build musl-1.2.3 '' no-patches
+if [ "${CHROOT}" = False ]; then
create_sysb
if [ "${KERNEL_BOOTSTRAP}" = True ]; then
echo "Kernel bootstrapping successful."
@@ -101,8 +103,6 @@ if [ "${CHROOT}" = False ]; then
go_sysb
fi
else
- build musl-1.2.3 '' no-patches
-
# In chroot mode transition directly into System C.
SYSC=/sysc_image
sys_transfer "${SYSC}" /sysc gzip patch
diff --git a/sysa/tcc-0.9.27/simple-patches/check-reloc-null.after b/sysa/tcc-0.9.27/simple-patches/check-reloc-null.after
@@ -0,0 +1,6 @@
+static void fill_local_got_entries(TCCState *s1)
+{
+ ElfW_Rel *rel;
+ if (!s1->got->reloc)
+ return;
+ for_each_elem(s1->got->reloc, 0, rel, ElfW_Rel) {
diff --git a/sysa/tcc-0.9.27/simple-patches/check-reloc-null.before b/sysa/tcc-0.9.27/simple-patches/check-reloc-null.before
@@ -0,0 +1,4 @@
+static void fill_local_got_entries(TCCState *s1)
+{
+ ElfW_Rel *rel;
+ for_each_elem(s1->got->reloc, 0, rel, ElfW_Rel) {
diff --git a/sysa/tcc-0.9.27/tcc-0.9.27.checksums b/sysa/tcc-0.9.27/tcc-0.9.27.checksums
@@ -1 +1 @@
-5cd0428fdcb9dc579cdf496a4fd974c4d2a941f76f2ce2049a1c2ff477f64002 /usr/bin/tcc
+e5f00ef66c5796f436089d3f6e67af001182e6fbb439d13bb65eef8cf82f5973 /usr/bin/tcc
diff --git a/sysa/tcc-0.9.27/tcc-0.9.27.kaem b/sysa/tcc-0.9.27/tcc-0.9.27.kaem
@@ -26,6 +26,9 @@ untar --file ../src/${pkg}.tar
/sysa/tcc-0.9.27/simple-patches/addback-fileopen.before /sysa/tcc-0.9.27/simple-patches/addback-fileopen.after
/x86/bin/simple-patch /sysa/tcc-0.9.27/build/tcc-0.9.27/tccelf.c \
/sysa/tcc-0.9.27/simple-patches/fiwix-paddr.before /sysa/tcc-0.9.27/simple-patches/fiwix-paddr.after
+# Fix SIGSEGV while building lwext4
+/x86/bin/simple-patch /sysa/tcc-0.9.27/build/tcc-0.9.27/tccelf.c \
+ /sysa/tcc-0.9.27/simple-patches/check-reloc-null.before /sysa/tcc-0.9.27/simple-patches/check-reloc-null.after
untar --non-strict --file ../src/${MES_PKG}.tar
cd ${pkg}