2023-11-28 02:34:41 +00:00
|
|
|
#!/bin/sh
|
2023-03-31 19:08:50 +01:00
|
|
|
# SPDX-FileCopyrightText: 2023 Richard Masters <grick23@gmail.com>
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2023-11-28 02:34:41 +00:00
|
|
|
set -ex
|
|
|
|
|
2023-03-31 19:08:50 +01:00
|
|
|
mkdir build src
|
|
|
|
cd src
|
2023-11-28 02:16:09 +00:00
|
|
|
ungz --file ${DISTFILES}/${pkg}.tar.gz --output ${pkg}.tar
|
2023-03-31 19:08:50 +01:00
|
|
|
cd ..
|
|
|
|
|
|
|
|
cd build
|
|
|
|
untar --file ../src/${pkg}.tar
|
|
|
|
cd ${pkg}
|
|
|
|
|
2023-11-28 02:34:41 +00:00
|
|
|
mkdir -p build_generic/include/generated
|
2023-03-31 19:08:50 +01:00
|
|
|
catm build_generic/include/generated/ext4_config.h ../../config/ext4_config.h
|
|
|
|
|
|
|
|
cd blockdev/linux
|
|
|
|
tcc -m32 -march=i386 -std=c89 -I../../include -I../../build_generic/include -I../../../tcc/tcc-0.9.27/include -DVERSION="\"1.0\"" -c file_dev.c
|
|
|
|
|
|
|
|
cd ../../src
|
2023-04-03 19:14:38 +01:00
|
|
|
alias cc="tcc -m32 -march=i386 -std=c89 -I../include -I../build_generic/include -I../../tcc/tcc-0.9.27/include"
|
|
|
|
cc -c ext4.c
|
|
|
|
cc -c ext4_balloc.c
|
|
|
|
cc -c ext4_bcache.c
|
|
|
|
cc -c ext4_bitmap.c
|
|
|
|
cc -c ext4_block_group.c
|
|
|
|
cc -c ext4_blockdev.c
|
|
|
|
cc -c ext4_crc32.c
|
|
|
|
cc -c ext4_debug.c
|
|
|
|
cc -c ext4_dir.c
|
|
|
|
cc -c ext4_dir_idx.c
|
|
|
|
cc -c ext4_extent.c
|
|
|
|
cc -c ext4_fs.c
|
|
|
|
cc -c ext4_hash.c
|
|
|
|
cc -c ext4_ialloc.c
|
|
|
|
cc -c ext4_inode.c
|
|
|
|
cc -c ext4_journal.c
|
|
|
|
cc -c ext4_mbr.c
|
|
|
|
cc -c ext4_mkfs.c
|
|
|
|
cc -c ext4_super.c
|
|
|
|
cc -c ext4_trans.c
|
|
|
|
cc -c ext4_xattr.c
|
2023-03-31 19:08:50 +01:00
|
|
|
|
Remove the notion of "sys*"
- This idea originates from very early in the project and was, at the
time, a very easy way to categorise things.
- Now, it doesn't really make much sense - it is fairly arbitary, often
occuring when there is a change in kernel, but not from builder-hex0
to fiwix, and sysb is in reality completely unnecessary.
- In short, the sys* stuff is a bit of a mess that makes the project
more difficult to understand.
- This puts everything down into one folder and has a manifest file that
is used to generate the build scripts on the fly rather than using
coded scripts.
- This is created in the "seed" stage.
stage0-posix -- (calls) --> seed -- (generates) --> main steps
Alongside this change there are a variety of other smaller fixups to the
general structure of the live-bootstrap rootfs.
- Creating a rootfs has become much simpler and is defined as code in
go.sh. The new structure, for an about-to-be booted system, is
/
-- /steps (direct copy of steps/)
-- /distfiles (direct copy of distfiles/)
-- all files from seed/*
-- all files from seed/stage0-posix/*
- There is no longer such a thing as /usr/include/musl, this didn't
really make any sense, as musl is the final libc used. Rather, to
separate musl and mes, we have /usr/include/mes, which is much easier
to work with.
- This also makes mes easier to blow away later.
- A few things that weren't properly in packages have been changed;
checksum-transcriber, simple-patch, kexec-fiwix have all been given
fully qualified package names.
- Highly breaking change, scripts now exist in their package directory
but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh,
etc. This avoids manual definition of passes.
- Ditto with patches; default directory is patches, but then any patch
series specific to a pass are named patches-passX.
2023-11-06 23:51:23 +00:00
|
|
|
cp ../../../files/make_fiwix_initrd.c make_fiwix_initrd.c
|
2023-03-31 19:08:50 +01:00
|
|
|
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
|
|
|
|
|
2023-11-28 02:16:09 +00:00
|
|
|
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
|
2023-04-14 22:17:13 +01:00
|
|
|
|
|
|
|
cd ../../..
|
|
|
|
|
|
|
|
# Checksums
|
|
|
|
if match x${UPDATE_CHECKSUMS} xTrue; then
|
|
|
|
sha256sum -o ${pkg}.checksums \
|
|
|
|
/usr/bin/make_fiwix_initrd
|
|
|
|
|
2023-11-28 02:16:09 +00:00
|
|
|
cp ${pkg}.checksums ${SRCDIR}
|
2023-04-14 22:17:13 +01:00
|
|
|
else
|
|
|
|
sha256sum -c ${pkg}.checksums
|
|
|
|
fi
|