2022-04-24 04:59:17 +01:00
|
|
|
# SPDX-FileCopyrightText: 2021-22 fosslinux <fosslinux@aussies.space>
|
2022-04-13 00:08:29 +01:00
|
|
|
# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu>
|
2021-08-04 03:56:07 +01:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
src_unpack() {
|
2022-04-13 00:08:29 +01:00
|
|
|
mkdir "${pkg}"
|
2021-08-04 03:56:07 +01:00
|
|
|
default || true # Predictable link errors - not a problem
|
2024-02-09 01:47:07 +00:00
|
|
|
rm "${DISTFILES}/${pkg}.tar.xz"
|
2021-08-04 03:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
generate_autoconf_h() {
|
|
|
|
# generate include/linux/autoconf.h -- we do not have gperf rn to do it the normal way
|
|
|
|
mkdir -p include/generated
|
|
|
|
# Transform each of the CONFIG_* options that are =y into header
|
|
|
|
grep -E '=y$' .config | sed 's/=y$/ 1/' | sed 's/^/#define /' >> include/generated/autoconf.h
|
|
|
|
# Transform each of the CONFIG_* options that are unset into headers
|
|
|
|
grep -E ' is not set$' .config | sed 's/ is not set$//' | sed 's/#/#undef/' >> include/generated/autoconf.h
|
|
|
|
# Transform each of the non-boolean options into headers
|
|
|
|
grep -E '=.*$' .config | grep -v -E '=y$' | sed 's/=/ /' | sed 's/^/#define /' >> include/generated/autoconf.h
|
|
|
|
}
|
|
|
|
|
|
|
|
src_prepare() {
|
|
|
|
default
|
|
|
|
|
|
|
|
mv config .config
|
|
|
|
mkdir -p include/config
|
|
|
|
cp .config include/config/auto.conf
|
|
|
|
|
|
|
|
generate_autoconf_h
|
|
|
|
|
|
|
|
# Remove shipped files
|
|
|
|
find . -name "*_shipped*" -delete
|
Upgrade Linux kernel to 4.14.336
This is the last LTS version buildable using GCC 4.0.x. The next one,
version 4.19, requires at least GCC 4.6.
Fortunately, this is also the first version of the Linux kernel
without firmware blobs being included in /firmware, so the FSFLA
deblob scripts aren't needed anymore to ensure a fully auditable
kernel - the 3 remaining drivers that do include blobs masquerading
as source code are removed via a patch, avoiding all the other side
effects of the deblob scripts.
This doesn't compromise the trustworthiness of the bootstrapped
environment, since all the other drivers deblob would remove use
the firmware loader mechanism, which does nothing when the actual
firmware blobs aren't installed on the system separately. Features
dependent on firmware still won't work, but many drivers that load
firmware do so only optionally. This includes r8169, the driver for
the Realtek gigabit NICs found on many x86 motherboards.
This kernel is considerably larger than 4.9.10, and we build more
of it (including drivers that would previously get stripped away by
the deblob script, such as r8169), so to accommodate that, Fiwix
initrd size is increased by 64MiB, while lowering kexec space by
the same amount to ensure enough userspace memory available in Fiwix.
Fiwix's maximum open file count is also bumped from 1.5K to 2.5K.
The Documentation folder is deleted before build, to further save
space in the ramdisk.
2024-02-16 11:58:27 +00:00
|
|
|
|
|
|
|
# Remove documentation to save space
|
|
|
|
rm -rf Documentation
|
2021-08-04 03:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
src_compile() {
|
|
|
|
cp .config include/config/auto.conf
|
|
|
|
rm include/generated/autoconf.h
|
|
|
|
generate_autoconf_h
|
|
|
|
|
2021-10-12 00:43:58 +01:00
|
|
|
# Allow use of patched initramfs_list.sh (which is required anyway)
|
2023-04-10 06:30:16 +01:00
|
|
|
make "${MAKEJOBS}" ARCH=i386 prepare
|
|
|
|
PATH="${PWD}/usr:${PATH}" make "${MAKEJOBS}" ARCH=i386
|
2023-02-28 00:32:18 +00:00
|
|
|
|
|
|
|
# Clear up more space
|
|
|
|
find . -name '*.o' -delete
|
2021-08-04 03:56:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
Upgrade Linux kernel to 4.14.336
This is the last LTS version buildable using GCC 4.0.x. The next one,
version 4.19, requires at least GCC 4.6.
Fortunately, this is also the first version of the Linux kernel
without firmware blobs being included in /firmware, so the FSFLA
deblob scripts aren't needed anymore to ensure a fully auditable
kernel - the 3 remaining drivers that do include blobs masquerading
as source code are removed via a patch, avoiding all the other side
effects of the deblob scripts.
This doesn't compromise the trustworthiness of the bootstrapped
environment, since all the other drivers deblob would remove use
the firmware loader mechanism, which does nothing when the actual
firmware blobs aren't installed on the system separately. Features
dependent on firmware still won't work, but many drivers that load
firmware do so only optionally. This includes r8169, the driver for
the Realtek gigabit NICs found on many x86 motherboards.
This kernel is considerably larger than 4.9.10, and we build more
of it (including drivers that would previously get stripped away by
the deblob script, such as r8169), so to accommodate that, Fiwix
initrd size is increased by 64MiB, while lowering kexec space by
the same amount to ensure enough userspace memory available in Fiwix.
Fiwix's maximum open file count is also bumped from 1.5K to 2.5K.
The Documentation folder is deleted before build, to further save
space in the ramdisk.
2024-02-16 11:58:27 +00:00
|
|
|
install -D -m 644 arch/i386/boot/bzImage "${DESTDIR}/boot/vmlinuz"
|
2023-11-24 03:59:19 +00:00
|
|
|
install -D -m 755 usr/gen_init_cpio "${DESTDIR}${PREFIX}/bin/gen_init_cpio"
|
|
|
|
install -D -m 755 scripts/gen_initramfs_list.sh "${DESTDIR}${PREFIX}/bin/gen_initramfs_list.sh"
|
2021-08-04 03:56:07 +01:00
|
|
|
}
|