commit e9fbaf3

chld  ·  2026-09-23 00:09:52 +0000 UTC
parent bc5ee75
build-userland init!
3 files changed,  +44, -0
+1, -0
1@@ -2,3 +2,4 @@ kiss.tar.xz
2 mwakat-rootfs.tar.xz
3 log
4 build/*
5+*.tar.*
+42, -0
 1@@ -0,0 +1,42 @@
 2+#!/bin/sh
 3+
 4+printf "\nyou can skip this build process by removing this from create-mwakat; this is just for getting a slightly smaller userland.\n"
 5+
 6+set -xe
 7+pwd=`pwd`
 8+
 9+rm -rf build/*
10+
11+### toybox
12+
13+git clone --depth 1 'https://github.com/landley/toybox.git' build/toybox/
14+cd build/toybox/
15+
16+echo 'cc -static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os $@' > ./cc.sh
17+chmod 755 ./cc.sh
18+export CC=`pwd`/cc.sh
19+export HOSTCC=$CC
20+make defconfig
21+
22+sed -i 's/-o/-static -Oz -Oz -Wl,-s -Wl,--as-needed -Wl,-Os -o/g' scripts/install.sh
23+sed -i 's/cc/cc -static -Oz -Oz -Wl,-s -Wl,--as-needed -Wl,-Os/g' kconfig/Makefile
24+sed -i 's#scripts/install.sh#scripts/install.sh --static#g' Makefile
25+sed -i 's/\$HOSTCC/$HOSTCC -static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os/g' scripts/make.sh
26+
27+make CFLAGS='-static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os' LDFLAGS='-static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os' PREFIX="$PKG"
28+cp -f ./build/build/toybox $m/bin/toybox
29+
30+### busybox
31+
32+cd $pwd
33+rm -f busybox-1.36.1.tar.bz2
34+wget 'https://busybox.net/downloads/busybox-1.36.1.tar.bz2'
35+tar -xvf busybox-1.36.1.tar.bz2 -C build/
36+cd build/busybox*/
37+cp $pwd/util/busybox.config .config
38+
39+sed -i 's/gcc/cc -static -static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os/g' Makefile
40+sed -i 's#GNU/Linux#Serious/Linux#g' `find . -name .config -type f`
41+# make olddefconfig
42+gmake PREFIX="$PREFIX" CFLAGS='-static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os' DESTDIR="$PKG" LDFLAGS='-static -static -Oz -Wl,-s -Wl,--as-needed -Wl,-Os' V=1
43+cp -f ./busybox $m/usr/sbin/busybox.static
+1, -0
1@@ -10,6 +10,7 @@ sh ./setup-rootfs
2 sh ./setup-apk
3 sh ./setup-userland
4 sh ./setup-post
5+sh ./build-userland
6 
7 # unmount /mnt as it finished
8 sh ./util/kiss-mount $m .