moved everything to different stages

This commit is contained in:
ag-tsotetsi
2026-03-29 12:29:46 +02:00
parent abcc7eca2a
commit c69f878094
18 changed files with 423 additions and 530 deletions

View File

@@ -0,0 +1,22 @@
fetch $BISON_URL
sudo chroot "$SYSROOT" /usr/bin/env -i \
MAKEFLAGS="$MAKEFLAGS" \
PATH=/usr/bin:/usr/sbin \
SOURCES=/sources \
BISON_VERSION=$BISON_VERSION \
/usr/bin/bash <<- "EOF"
set -euo pipefail
cd "$SOURCES" && tar xf bison-$BISON_VERSION.tar.xz && cd bison-$BISON_VERSION
./configure \
--prefix=/usr \
--silent \
--quiet
make && make install
cd "$SOURCES" && rm -rf bison-$BISON_VERSION
EOF

View File

@@ -0,0 +1,10 @@
sudo chroot "$SYSROOT" /usr/bin/env -i \
/usr/bin/bash <<- "EOF"
rm -rf /usr/share/{info,man,doc}/*
find /usr/{lib,libexec} -name \*.la -delete
rm -rf /cross
EOF

28
stage/prechroot/perl.bash Normal file
View File

@@ -0,0 +1,28 @@
fetch $PERL_URL
sudo chroot "$SYSROOT" /usr/bin/env -i \
MAKEFLAGS="$MAKEFLAGS" \
PATH=/usr/bin:/usr/sbin \
SOURCES=/sources \
PERL_VERSION=$PERL_VERSION \
/usr/bin/bash <<- "EOF"
set -euo pipefail
cd "$SOURCES" && tar xf perl-$PERL_VERSION.tar.gz && cd perl-$PERL_VERSION
sh Configure -des \
-D prefix=/usr \
-D vendorprefix=/usr \
-D useshrplib \
-D privlib=/usr/lib/perl5/$PERL_VERSION/core_perl \
-D archlib=/usr/lib/perl5/$PERL_VERSION/core_perl \
-D sitelib=/usr/lib/perl5/$PERL_VERSION/site_perl \
-D sitearch=/usr/lib/perl5/$PERL_VERSION/site_perl \
-D vendorlib=/usr/lib/perl5/$PERL_VERSION/vendor_perl \
-D vendorarch=/usr/lib/perl5/$PERL_VERSION/vendor_perl
make && make install
cd "$SOURCES" && rm -rf perl-$PERL_VERSION
EOF

View File

@@ -0,0 +1,28 @@
fetch $PYTHON_URL
sudo chroot "$SYSROOT" /usr/bin/env -i \
MAKEFLAGS="$MAKEFLAGS" \
PATH=/usr/bin:/usr/sbin \
SOURCES=/sources \
PYTHON_VERSION=$PYTHON_VERSION \
/usr/bin/bash <<- "EOF"
set -euo pipefail
cd "$SOURCES" && tar xf Python-$PYTHON_VERSION.tar.xz && cd Python-$PYTHON_VERSION
./configure \
--prefix=/usr \
--enable-shared \
--without-static-libpython \
--disable-test-modules \
--without-ensurepip \
--silent \
--quiet
make && make install
rm -rf /usr/lib/python$PYTHON_VERSION/test
cd "$SOURCES" && rm -rf Python-$PYTHON_VERSION
EOF

View File

@@ -0,0 +1,35 @@
sudo chroot "$SYSROOT" /usr/bin/env -i /usr/bin/bash <<- "EOF"
ln -s /run /var/run
ln -sfv /run/lock /var/lock
install -dv -m 0750 /root
install -dv -m 1777 /tmp /var/tmp
ln -s proc/self/mounts /etc/mtab
cat > /etc/hosts <<- "END_OF_FILE"
127.0.0.1 localhost axe
::1 localhost
END_OF_FILE
cat > /etc/passwd <<- "END_OF_FILE"
root:x:0:0:root:/root:/usr/bin/bash
uuidd:x:6:6::/dev/null:/usr/bin/nologin
messagebus:x:7:7::/run/dbus:/usr/bin/nologin
nobody:x:65534:65534::/dev/null:/usr/bin/nologin
END_OF_FILE
cat > /etc/group <<- "END_OF_FILE"
root:x:0:
tty:x:1:
audio:x:2:
video:x:3:
input:x:4:
wheel:x:5:
uuidd:x:6:
messagebus:x:7:
users:x:999:
nogroup:x:65534:
END_OF_FILE
EOF

View File

@@ -0,0 +1,35 @@
fetch $UTIL_LINUX_URL
sudo chroot "$SYSROOT" /usr/bin/env -i \
MAKEFLAGS="$MAKEFLAGS" \
PATH=/usr/bin:/usr/sbin \
SOURCES=/sources \
UTIL_LINUX_VERSION=$UTIL_LINUX_VERSION \
/usr/bin/bash <<- "EOF"
set -euo pipefail
cd "$SOURCES" && tar xf util-linux-$UTIL_LINUX_VERSION.tar.xz && cd util-linux-$UTIL_LINUX_VERSION
mkdir -p /var/lib/hwclock
./configure --libdir=/usr/lib \
--runstatedir=/run \
--disable-chfn-chsh \
--disable-login \
--disable-nologin \
--disable-su \
--disable-setpriv \
--disable-runuser \
--disable-pylibmount \
--disable-static \
--disable-liblastlog2 \
--without-python \
ADJTIME_PATH=/var/lib/hwclock/adjtime \
--silent \
--quiet
make && make install
cd "$SOURCES" && rm -rf util-linux-$UTIL_LINUX_VERSION
EOF