Use of a Linux initramfs to fully automate the bootstrapping process
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
2.4 KiB

#!/bin/sh
# SPDX-FileCopyrightText: 2021 Andrius Štikonas <andrius@stikonas.eu>
# SPDX-FileCopyrightText: 2021 Paul Dersey <pdersey@gmail.com>
# SPDX-FileCopyrightText: 2020-2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
PATH=/x86/bin
1 year ago
# Set commonly used variables
sources=/after
prefix=/usr
bindir=${prefix}/bin
libdir=${prefix}/lib
incdir=${prefix}/include
tmpdir=/tmp # tmpdir is needed for patch to work
# Environmental variables needed for mes
NYACC_PKG=nyacc-1.00.2
MES_PKG=mes
MES_PREFIX=${sources}/${MES_PKG}/src/mes-m2-7fa2f99bf9bba2d79bd9d15c579be8905520d960
GUILE_LOAD_PATH=${MES_PREFIX}/mes/module:${MES_PREFIX}/module:${sources}/${MES_PKG}/src/${NYACC_PKG}/module
mkdir ${prefix} ${bindir} ${libdir} ${incdir} ${tmpdir}
cd ${prefix}
# Remove remaining dependencies on /bin (stage0-posix directory)
cp /x86/bin/blood-elf bin/blood-elf
cp /x86/bin/catm bin/catm
cp /x86/bin/chmod bin/chmod
cp /x86/bin/get_machine bin/get_machine
cp /x86/bin/hex2 bin/hex2
cp /x86/bin/kaem ${bindir}/kaem
cp /x86/bin/M1 bin/M1
cp /x86/bin/M2-Planet bin/M2-Planet
cp /x86/bin/mkdir bin/mkdir
cp /x86/bin/sha256sum bin/sha256sum
cp /x86/bin/ungz bin/ungz
cp /x86/bin/untar bin/untar
cp /x86/bin/cp bin/cp
chmod 755 bin/blood-elf
chmod 755 bin/catm
chmod 755 bin/chmod
chmod 755 bin/cp
chmod 755 bin/get_machine
chmod 755 bin/hex2
chmod 755 bin/kaem
chmod 755 bin/M1
chmod 755 bin/M2-Planet
chmod 755 bin/mkdir
chmod 755 bin/sha256sum
chmod 755 bin/ungz
chmod 755 bin/untar
PATH=${bindir}
cd ${sources}
# mes
pkg=${MES_PKG}
cd ${pkg}
kaem --file ${pkg}.kaem
cd ${sources}
# tcc 0.9.26
pkg="tcc-0.9.26"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
libdir=${libdir}/mes
# gzip
pkg="gzip-1.2.4"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# tar
pkg="tar-1.12"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# sed
pkg="sed-4.0.9"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# patch
pkg="patch-2.5.9"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# make
pkg="make-3.80"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# bzip2
pkg="bzip2-1.0.8"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# tcc 0.9.27
pkg="tcc-0.9.27"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# coreutils
pkg="coreutils-5.0"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# heirloom-devtools
pkg="heirloom-devtools-070527"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
# bash
pkg="bash-2.05b"
cd ${pkg}
kaem --file ${pkg}.kaem
cd ..
bash run.sh