Integrated Treetap into Maple Linux #1

Merged
ahill merged 74 commits from treetap into main 2026-01-25 22:51:04 +00:00
4 changed files with 1262 additions and 33 deletions
Showing only changes of commit 320a2dbb2e - Show all commits

View File

@ -23,7 +23,6 @@ export TT_SYSROOT=$BOOTSTRAP/root
export TT_TARGET=$TARGET export TT_TARGET=$TARGET
# Fetch sources required for a bootstrap # Fetch sources required for a bootstrap
./treetap fetch sources/busybox/busybox.spec
./treetap fetch sources/linux/linux.spec ./treetap fetch sources/linux/linux.spec
./treetap fetch sources/llvm/llvm.spec ./treetap fetch sources/llvm/llvm.spec
./treetap fetch sources/musl/musl.spec ./treetap fetch sources/musl/musl.spec
@ -84,6 +83,7 @@ cd ..
# Install headers for musl # Install headers for musl
MUSL_VERSION=$(sed -En "s/SRC_VERSION=\"?(.+)\"/\1/p" $SPEC/musl/musl.spec) MUSL_VERSION=$(sed -En "s/SRC_VERSION=\"?(.+)\"/\1/p" $SPEC/musl/musl.spec)
tar xf $SOURCES/musl/$MUSL_VERSION/musl-*.tar* tar xf $SOURCES/musl/$MUSL_VERSION/musl-*.tar*
./treetap fetch sources/busybox/busybox.spec
cd musl-*/ cd musl-*/
# NOTE: Patch for musl 1.2.5 to prevent a character encoding vulnerability. This # NOTE: Patch for musl 1.2.5 to prevent a character encoding vulnerability. This
# should be safe to remove after the next release. ~ahill # should be safe to remove after the next release. ~ahill
@ -211,34 +211,21 @@ cmake -S llvm -B build-llvm \
-DLLVM_TABLEGEN=$NATIVE_TOOL_DIR/llvm-tblgen -DLLVM_TABLEGEN=$NATIVE_TOOL_DIR/llvm-tblgen
cmake --build build-llvm cmake --build build-llvm
cmake --install build-llvm --parallel $PROCS cmake --install build-llvm --parallel $PROCS
# NOTE: LLVM doesn't add symlinks for clang/ld, so we'll make them ourselves.
# ~ahill
ln -s clang $BOOTSTRAP/root/bin/cc
ln -s clang++ $BOOTSTRAP/root/bin/c++
ln -s ld.lld $BOOTSTRAP/root/bin/ld
cd .. cd ..
# Build Busybox # Build remaining software with treetap
BUSYBOX_VERSION=$(sed -En "s/SRC_VERSION=\"?(.+)\"/\1/p" $SPEC/busybox/busybox.spec) SOURCES=(busybox make)
tar xf $SOURCES/busybox/$BUSYBOX_VERSION/busybox-*.tar* for name in $SOURCES; do
cd busybox-*/ $TREETAP fetch $SPEC/$name/$name.spec
# NOTE: Like we did with musl before, we don't set CROSS_COMPILE because LLVM is $TREETAP build $SPEC/$name/$name.spec
# smart and doesn't need a compiler to cross-compile code. With that said, $TREETAP package $SPEC/$name/$name.spec
# Busybox uses Kbuild, which hard-codes variables like CC to GNU-based $TREETAP install .treetap/packages/$TARGET/$name-*.cpio.xz $BOOTSTRAP/root
# tools, which is not what we want. The following sed hack should do the done
# trick, but I wonder if there's a better solution. ~ahill
sed -i "s/?*= \$(CROSS_COMPILE)/?= /" Makefile
make -O -j $PROCS defconfig
# NOTE: tc causes a LOT of issues due to undefined things. We don't really need
# "traffic control" at this time, and when we eventually do, we will
# likely use something else. ~ahill
sed -i "s/CONFIG_TC=.*/CONFIG_TC=n/" .config
make -O -j $PROCS
# NOTE: Busybox doesn't appear to have a proper DESTDIR, so we just set
# CONFIG_PREFIX during the install step to work around this. ~ahill
make -O -j $PROCS install CONFIG_PREFIX=$BOOTSTRAP/root
cd ..
# Build Make
$TREETAP fetch $SPEC/make/make.spec
$TREETAP build $SPEC/make/make.spec
$TREETAP package $SPEC/make/make.spec
$TREETAP install .treetap/packages/$TARGET/make-*.cpio.xz $BOOTSTRAP/root
# Install Treetap # Install Treetap
cp $BOOTSTRAP/../treetap $BOOTSTRAP/root/bin/ cp $BOOTSTRAP/../treetap $BOOTSTRAP/root/bin/

1231
sources/busybox/.config Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,28 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev> # Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314" SRC_HASH="b8cc24c9574d809e7279c3be349795c5d5ceb6fdf19ca709f80cde50e47de314"
SRC_NAME="busybox" SRC_NAME="busybox"
SRC_PATCHES="
6b362ba1231e55cbff68ae9c9fdaa5749d459deed22cac5402cb83f0d8794a89 .config
"
SRC_URL="https://busybox.net/downloads/busybox-1.36.1.tar.bz2" SRC_URL="https://busybox.net/downloads/busybox-1.36.1.tar.bz2"
SRC_VERSION="1.36.1" SRC_VERSION="1.36.1"
build() { build() {
tar xf ../$SRC_FILENAME tar xf ../$SRC_FILENAME
cd busybox-*/ cd busybox-*/
# NOTE: For some reason, Busybox hard-codes GNU tools in the Makefile. This # NOTE: Like we did with musl before, we don't set CROSS_COMPILE because
# simple hack allows the environment to override the Makefile. ~ahill # LLVM is smart and doesn't need a compiler to cross-compile code.
# With that said, Busybox uses Kbuild, which hard-codes variables like
# CC to GNU-based tools, which is not what we want. The following sed
# hack should do the trick, but I wonder if there's a better solution.
# ~ahill
sed -i "s/?*= \$(CROSS_COMPILE)/?= /" Makefile sed -i "s/?*= \$(CROSS_COMPILE)/?= /" Makefile
make -O -j $TT_PROCS defconfig # NOTE: Apparently, Busybox fails to properly check for ncurses since the
# FIXME: tc complains about undefined values, causing the compilation to # test compiles a main function without a return value type, causing
# fail. What causes this? ~ahill # the compilation to fail. This patch fixes the issue by making the
sed -i "s/CONFIG_TC=.*/CONFIG_TC=n/" .config # returned type "void". This doesn't actually affect the build, but
# I'm not sure where else to put this. ~ahill
sed -i "s/main()/void main()/" scripts/kconfig/lxdialog/check-lxdialog.sh
make -O -j $TT_PROCS make -O -j $TT_PROCS
} }

View File

@ -50,6 +50,8 @@
# SRC_FILENAME - The name of the tarball to extract (optional) # SRC_FILENAME - The name of the tarball to extract (optional)
# SRC_HASH - The hash of the tarball for verification purposes (required) # SRC_HASH - The hash of the tarball for verification purposes (required)
# SRC_NAME - The name of the package being built (required) # SRC_NAME - The name of the package being built (required)
# SRC_PATCHES - A list of SHA256 hashes followed by their filenames to be
# copied to the build directory (optional)
# SRC_URL - The URL of the tarball to be downloaded (required) # SRC_URL - The URL of the tarball to be downloaded (required)
# SRC_VERSION - The version of the package being built (required) # SRC_VERSION - The version of the package being built (required)