Commit Graph

19 Commits

Author SHA1 Message Date
Gábor Stefanik c5eb402eeb Add checksum protection to script-generator 2024-04-16 10:20:39 +02:00
Gábor Stefanik 70fdbebd9c Upgrade mes to 0.26
This can successfully build a working tcc-mes, but then fails
creating unified-libc.c for subsequent tcc bootstrapping.
2024-04-15 22:11:39 +02:00
pyy 5e11d2a592 update submodule stage0-posix to latest: updated unxz sources for amd64 aarch64 etc. 2024-03-07 17:09:31 +01:00
Gábor Stefanik 11d3605b08 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-17 15:37:33 +01:00
Gábor Stefanik 65953732a0 Support early xz/lzma decompression, and use it wherever possible 2024-02-14 14:34:16 +01:00
Gábor Stefanik 5945bdc1e8 Replace Fiwix filelist with parsing builder-hex0's FS structures
And while we're at it, use a more sustainable way of getting the
address of the next file to be written to.

Since builder-hex0 doesn't distinguish directories from zero-length
files, this has a limitation that it won't copy any zero-length
files or empty directories. Only one such file is important for the
bootstrap process (mes/config.h), which is recreated using an
improve step.
2024-02-06 12:30:24 +01:00
Gábor Stefanik d50ecd58e8 Improve pseudo-interactive prompts using the early bash
By wrapping $(cat) in an eval, redirections and other advanced
syntax can now work in the early prompts.
Also, since "set -E" is broken is the early bash, fall back to
using "set -e" and an EXIT trap, until we can upgrade to a bash
version that already has working "set -E", or perhaps backport
it to 2.05b.
2024-02-05 10:02:34 +01:00
Andrius Štikonas 3e2663b3bd
Merge pull request #419 from fosslinux/live-system-nochange
Live system nochange
2024-01-27 00:59:33 +00:00
fosslinux bbe121f382 Add uninstall directive to manifest
Allows for removal of old files or packages
2024-01-26 10:29:18 +11:00
fosslinux 8cc26fa60a Remove old relic of "maint"
Never actually used in the manifest, and shouldn't have been there
2024-01-26 10:29:18 +11:00
Gábor Stefanik 071f6c2d40 Fix typo in script-generator causing wrong traps in new Bash
When renaming using_bash to bash_build, I accidentally removed the
+ sign from the assignment, causing bash_build > 1 to never match,
resulting in old-style Ctrl+D traps even in the new Bash.

This patch restores the intended += behavior.
2024-01-24 10:29:51 +01:00
fosslinux 31753cccb5
Merge pull request #386 from Googulator/debug-trap
Support interactive issue resolution prompts
2024-01-10 07:15:33 +00:00
Gábor Stefanik a0f13c0ed2 Support interactive issue resolution prompts
This adds a new flag, -i / --interactive, which enables opening a
Bash prompt whenever something goes wrong in the bootstrap. This is
highly useful when developing or debugging live-bootstrap, but it
needs to be off by default, for use in automated processes.

In the future, asking for variables at runtime could (and perhaps
should) also be gated behind this flag.
2024-01-08 12:54:23 +01:00
fosslinux e44748cce1
Merge pull request #387 from Googulator/swap-support
Support swap files in qemu or bare-metal mode
2024-01-08 10:52:05 +00:00
Gábor Stefanik 9384a5d432 Support "!=" comparisons in script-generator 2024-01-02 00:14:00 +01:00
Gábor Stefanik f9cf916e5e Fix uninitialized variables in script-generator 2024-01-02 00:11:29 +01:00
Eduardo Sánchez Muñoz fc6aee0c5f Avoid double slash (`//`) in generated scripts
e.g., put `bash /steps/1.sh` instead of `bash /steps//1.sh`
2023-12-27 12:32:55 +01:00
fosslinux ab47483a51 Linters & CI updates 2023-12-15 21:44:43 +11:00
fosslinux 6ed2e09f3a Remove the notion of "sys*"
- This idea originates from very early in the project and was, at the
  time, a very easy way to categorise things.
- Now, it doesn't really make much sense - it is fairly arbitary, often
  occuring when there is a change in kernel, but not from builder-hex0
  to fiwix, and sysb is in reality completely unnecessary.
- In short, the sys* stuff is a bit of a mess that makes the project
  more difficult to understand.
- This puts everything down into one folder and has a manifest file that
  is used to generate the build scripts on the fly rather than using
  coded scripts.
- This is created in the "seed" stage.

stage0-posix -- (calls) --> seed -- (generates) --> main steps

Alongside this change there are a variety of other smaller fixups to the
general structure of the live-bootstrap rootfs.

- Creating a rootfs has become much simpler and is defined as code in
  go.sh. The new structure, for an about-to-be booted system, is

/
-- /steps (direct copy of steps/)
-- /distfiles (direct copy of distfiles/)
-- all files from seed/*
-- all files from seed/stage0-posix/*

- There is no longer such a thing as /usr/include/musl, this didn't
  really make any sense, as musl is the final libc used. Rather, to
  separate musl and mes, we have /usr/include/mes, which is much easier
  to work with.
- This also makes mes easier to blow away later.
- A few things that weren't properly in packages have been changed;
  checksum-transcriber, simple-patch, kexec-fiwix have all been given
  fully qualified package names.
- Highly breaking change, scripts now exist in their package directory
  but NOT WITH THE packagename.sh. Rather, they use pass1.sh, pass2.sh,
  etc. This avoids manual definition of passes.
  - Ditto with patches; default directory is patches, but then any patch
    series specific to a pass are named patches-passX.
2023-12-15 21:43:19 +11:00