2021-07-06 01:52:10 +01:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
|
|
|
|
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2021-08-05 13:16:19 +01:00
|
|
|
# shellcheck source=sysglobal/helpers.sh
|
2021-07-06 01:52:10 +01:00
|
|
|
. helpers.sh
|
2021-12-28 22:39:01 +00:00
|
|
|
# shellcheck source=/dev/null
|
|
|
|
. bootstrap.cfg
|
2021-07-06 01:52:10 +01:00
|
|
|
|
|
|
|
export PATH=/usr/bin:/usr/sbin
|
|
|
|
export PREFIX=/usr
|
|
|
|
export SOURCES=/usr/src
|
2022-02-10 10:55:06 +00:00
|
|
|
export DESTDIR=/tmp/destdir
|
2021-07-06 01:52:10 +01:00
|
|
|
|
|
|
|
create_fhs() {
|
|
|
|
# Add the rest of the FHS that we will use and is not created pre-boot
|
|
|
|
for d in bin lib sbin; do
|
|
|
|
ln -s "usr/${d}" "/${d}"
|
|
|
|
done
|
2021-12-20 02:40:19 +00:00
|
|
|
mv /usr/sbin/* /usr/bin/
|
2022-01-14 10:57:47 +00:00
|
|
|
rm -r /sbin /usr/sbin
|
2021-12-20 02:40:19 +00:00
|
|
|
ln -s bin /usr/sbin
|
|
|
|
ln -s bin /sbin
|
2021-07-06 01:52:10 +01:00
|
|
|
mkdir /etc /proc /run /sys /tmp /var
|
|
|
|
mount -t proc proc /proc
|
|
|
|
mount -t sysfs sysfs /sys
|
|
|
|
# Make /tmp a ramdisk (speeds up configure etc significantly)
|
|
|
|
mount -t tmpfs tmpfs /tmp
|
|
|
|
}
|
|
|
|
|
2021-08-05 13:16:19 +01:00
|
|
|
populate_device_nodes ""
|
|
|
|
|
2021-07-06 01:52:10 +01:00
|
|
|
create_fhs
|
|
|
|
|
|
|
|
build bash-5.1
|
|
|
|
|
2022-02-10 10:55:06 +00:00
|
|
|
exec env -i PATH=${PATH} PREFIX=${PREFIX} SOURCES=${SOURCES} DESTDIR=${DESTDIR} bash run2.sh
|