Add sysb and sysc scaffolding.

Now that we have the Linux Kernel built, we move to a full-disk (rather
than initramfs) setup in sysc. However, we cannot assume the seed kernel
has support for mounting hard drives. So, first we need to kexec into
sysb, which is used as a jumping off point to create the hard drive for
sysc.

Additionally, since 2.6.16 does not have support for on-demand initramfs
(initramfs must be built into kernel), we will have to rebuild the linux
kernel within sysb without the initramfs.

All of this process is not performed for chroot mode. Instead, we skip
sysb and jump straight to sysc, copying over appropriate data.

The python scripts have been changed slightly. Each sys* inherits
SysGeneral, which contains various functions which are not specific to
any sys* and simplifies those files. rootfs now also handles sysb and
sysc.

bootstrap.cfg also gives an indication whether we are running in a
chroot to avoid attempting to kexec/mount within a chroot.
This commit is contained in:
fosslinux 2021-07-06 10:52:10 +10:00
parent 925ce198c1
commit 5c88f1c87f
75 changed files with 624 additions and 176 deletions

32
sysc/bison-2.3/bison-2.3.sh Executable file
View file

@ -0,0 +1,32 @@
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
src_prepare() {
default
../../import-gnulib.sh
AUTOPOINT=true autoreconf-2.69 -fi
# Remove pregenerated files
rm src/parse-gram.c src/parse-gram.h src/scan-skel.c src/scan-gram.c
# Remove pregenerated .info
rm doc/bison.info
}
src_configure() {
LEX=flex-2.5.33 ./configure \
--prefix="${PREFIX}" \
--program-suffix=-2.3 \
--datarootdir="${PREFIX}/share/bison-2.3"
}
src_compile() {
make MAKEINFO=true
}
src_install() {
make MAKEINFO=true DESTDIR="${DESTDIR}" install
}

1
sysc/bison-2.3/checksums Normal file
View file

@ -0,0 +1 @@
5f32418b2681b9c26a845689d9761f0c28bbaadce32c58d6b203f4ad8ebe0234 /image/bin/bison-2.3

55
sysc/bison-2.3/import-gnulib.sh Executable file
View file

@ -0,0 +1,55 @@
#!/bin/sh
# SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
#
# SPDX-License-Identifier: GPL-3.0-or-later
set -e
gnulib_modules='
argmatch
dirname
error
exitfail
extensions
getopt
gettext
hard-locale
hash
malloc
mbswidth
obstack
quote
quotearg
stdbool
stdio-safer
strerror
strtoul
strverscmp
unistd-safer
unlocked-io
verify
xalloc
xalloc-die
xstrndup
'
# Copy over needed files
for i in ${gnulib_modules}; do
for f in $(../gnulib-b28236b/gnulib-tool --extract-filelist "${i}") \
lib/wcwidth.h; do
cp -pf "../gnulib-b28236b/${f}" "./${f}"
done
done
# Generate the things
(echo '# This file is generated automatically by "bootstrap".' &&
echo 'AC_DEFUN([GNULIB_AUTOCONF_SNIPPET],[' &&
../gnulib-b28236b/gnulib-tool --extract-autoconf-snippet $gnulib_modules &&
echo '])'
) > m4/gnulib.m4
(echo '# This file is generated automatically by "bootstrap".' &&
../gnulib-b28236b/gnulib-tool --extract-automake-snippet $gnulib_modules |
sed 's/^[ ]*AM_CPPFLAGS[ ]*+=/# (commented out by bootstrap) &/'
) > lib/gnulib.mk

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
This macro does not exist in newer versions of autoconf and is unrequired.
There is no version of autoconf supporting this project + gnulib + this macro.
--- m4/po_gl.m4 2021-04-11 18:39:53.353069610 +1000
+++ m4/po_gl.m4 2021-04-11 18:40:20.422242498 +1000
@@ -24,7 +24,6 @@
[
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AM_MKINSTALLDIRS])dnl
AC_REQUIRE([AM_NLS])dnl
dnl Perform the following tests also if --disable-nls has been given,

View file

@ -0,0 +1,18 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
fopen-safer.c for whatever reason does not exist when added by gnulib.
--- lib/Makefile.am 2021-04-11 19:01:01.265993928 +1000
+++ lib/Makefile.am 2021-04-11 19:01:40.413232722 +1000
@@ -31,7 +31,8 @@
lib_SOURCES = \
get-errno.h get-errno.c \
subpipe.h subpipe.c \
- $(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources)
+ $(bitsets_sources) $(additional_bitsets_sources) $(timevars_sources) \
+ fopen-safer.c
# Implementation of bitsets
bitsets_sources = \

View file

@ -0,0 +1,17 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
This should be declared for gnulib, but for some reason is not, most likely
use of a different version (but CVS history no longer exists).
--- lib/Makefile.am 2021-04-11 13:49:09.414805465 +1000
+++ lib/Makefile.am 2021-04-11 13:49:26.418916036 +1000
@@ -19,6 +19,7 @@
BUILT_SOURCES =
EXTRA_DIST =
+EXTRA_lib_SOURCES =
MOSTLYCLEANFILES =
lib_LIBRARIES = $(YACC_LIBRARY)

View file

@ -0,0 +1,20 @@
SPDX-FileCopyrightText: 2021 fosslinux <fosslinux@aussies.space>
SPDX-License-Identifier: GPL-2.0-or-later
This doesn't actually make sense, you can't use the built bison to bootstrap
itself. Make it use our bison instead.
--- src/Makefile.am 2021-04-10 21:37:11.570390316 +1000
+++ src/Makefile.am 2021-04-10 21:38:01.805804332 +1000
@@ -23,10 +23,6 @@
LDADD = ../lib/libbison.a $(LIBINTL)
-# Use our own Bison to build the parser. Of course, you ought to
-# keep a sane version of Bison nearby...
-YACC = ../tests/bison -y
-
bin_PROGRAMS = bison
bin_SCRIPTS = $(YACC_SCRIPT)
EXTRA_SCRIPTS = yacc