Commit Graph

92 Commits

Author SHA1 Message Date
fosslinux 05c13dd64e Modify rootfs.py infrastructure to support the new layout 2023-12-15 21:43:21 +11:00
MaxHearnden 773cc5405c add comma to list in sysa.py 2023-11-28 22:50:47 +00:00
rick-masters 8604871997 Pull builder-hex0-x86-stage1 from updated stage0-posix and lint fixes. 2023-05-18 10:59:46 +00:00
rick-masters a2fcf1ced9 Complete the kernel bootstrap by adding kexec of Linux from Fiwix.
A tiny bootloader bootstrap has been added to compile the builder-hex0 kernel from hex0 source.
The boot compiler is builder-hex0-x86-stage1.hex0 and builder-hex0-x86-stage1.bin.
The builder-hex0 kernel is now named builder-hex0-x86-stage2.hex0.
The inclusion of a binary seed resolves the problem with the previous strategy which used an
architecture-specific hex0 compiler.

If sysb detects a full disk (i.e. DISK=sda) it now partitions the disk unconditionally because
previously fdisk was reporting existing but empty partitions which resulted in no
parititions being created.

e2fsprogs is now built with --disable-tls because musl was built on Fiwix without full threading
support and mkfs.ext4 was crashing without disabling thread local storage.

kexec-linux writes the linux kernel and initramfs to a RAM drive on Fiwix which ensure
a pre-allocated contiguous memory block. The following is written to the ram drive:
a 32-bit number which is the size of the kernel in bytes, a 32-bit number which is the size
of the initramfs in bytes, followed by the Linux kernel image, followed by the initramfs.

kexec-fiwix invokes a sync syscall to ensure all writes are flushed to
the ram drive and then initiates the kexec by shutting down Fiwix with a reboot syscall.
Fiwix knows whether and how to perform the kexec based on kernel parameters passed to it.
2023-05-10 14:33:42 +00:00
rick-masters 986459c707 Remove unused variable. 2023-04-03 18:28:17 +00:00
rick-masters 96fd7ad3e1 Use os.walk instead of homegrown find_tree. 2023-04-03 18:12:01 +00:00
rick-masters ecf99ab08b Implement kernel bootstrap up to building Linux. 2023-03-31 18:08:50 +00:00
fosslinux bca80e53d0 Temporarily silence a (not-new) warning from pylint 2023-03-16 08:29:00 +11:00
fosslinux 73acbedf16 Fix inclusion of distfiles superflously 2023-03-06 17:34:08 +11:00
fosslinux 51b0bf8405 Rework tmpdir & associated a bit.
- Split out tmpdir logic into a separate entity & add the appropriate
  arguments and checks.
- sysb can be removed since there is now no associated logic.
- Move disk/etc logic into tmpdir.py.
2023-01-28 16:51:00 +11:00
Dor Askayo a1c8c0312c Download source files using a source manifest 2023-01-13 23:38:18 +02:00
Dor Askayo 693d01dc1b Set git_dir/sys_dir/cache_dir statically
This allows accessing their values without requiring a class instance.
2023-01-13 16:21:56 +02:00
fosslinux f4ebc241ac Fix linters (whoops!) 2023-01-07 19:12:50 +11:00
fosslinux 6f76fd2071 Add early preseed
Speeds up development cycle, allows for the pre-kaem stages to be
extracted as a tarball
2023-01-05 20:44:19 +11:00
fosslinux 10a55522a2 Change sources getting method.
- Rather than defining the urls where they are gotten (python sysa,
  python sysc, inside sysc), a spec file is now used that is easily
  interpretable and tool-independent.
- This is interpreted by rootfs.py and inside sysc.
- This is also used to make sources available and extract sources.
- Manual dirname selection is no longer required as is tarball renaming
  upon download - all of this is handled automatically.

Fixes #188
2022-10-02 09:48:20 +11:00
Andrius Štikonas 483bf555aa Fix outdated info in the comment. 2022-06-19 23:57:32 +01:00
fosslinux 25f37ba926 Various fixes from rebase
This took a while so a bunch of stuff got broken in rebase.
2022-06-18 09:10:11 +10:00
fosslinux b614b3021d Add dhcpcd 9.4.1 2022-06-10 13:33:16 +10:00
fosslinux 0ce50a6393 Add options for;
- disk to be created (blank disk given to live-bootstrap) (default)
- disk to already exist but sources downloaded within live-bootstrap
- sources to be downloaded outside live-bootstrap (non-blank disk given
  to live-bootstrap)

Also migrate sysb to use sys_transfer in QEMU mode also.

Note that this means copy_sysc is now irrelevant. sysc is *always*
sourced from sysa.
2022-06-10 13:33:16 +10:00
fosslinux 6ea1b8e295 Add e2fsprogs 1.45.7
Additionally, fix downloading in chunks for some files.
2022-06-10 13:30:58 +10:00
fosslinux 060f44e5a5 Add curl 7.83.0 2022-06-10 13:30:58 +10:00
Andrius Štikonas d84bb236a4 Add an argument to rootfs.py to preseed bootstrap with binary packages. 2022-05-29 00:04:57 +01:00
Dor Askayo 8330ab4504 Add an option to avoid creating a tmpfs in prepare()
Root access is required for creating tmpfs mounts in the context of
the current mount namespace, and creating a tmpfs in the context of a
new mount namespace is less useful because a process in the parent
namespace can't easily access it.

So add an option to avoid creating tmpfs mounts, which will be used by
the rootless bootstrap mode for now.

In addition, when tmp directories aren't mounted as tmpfs, their
contents can't be removed using os.umount(). So instead remove them
recursively using shutil.rmtree().
2022-05-27 11:45:09 +03:00
Dor Askayo 6d357226a9 Call prepare() externally to the sysa and sysc classes
This keeps the prepartion and bootstrap initiation logic in the same
place for each bootstrap mode, and allows each mode to specify its
own requirements and expectations from the different bootstrap steps.
2022-05-23 17:45:53 +03:00
Dor Askayo a7c7ddf977 Split "chroot" into "copy_sysc" and "create_initramfs" in sysa's prepare()
These better describe the actions, and will make more sense with the
addition of the rootless bootstrap mode which would make use of these
preparation steps.
2022-05-23 17:45:53 +03:00
Dor Askayo 7075c901a9 Move sysa's initramfs creation into prepare() 2022-05-23 17:45:53 +03:00
Dor Askayo c429cf9dd7 Keep chroot indication only in prepare()
It's not actually needed by other methods.
2022-05-23 17:45:53 +03:00
Dor Askayo 7adff2dcd3 Update mes to the latest git snapshot
This should include a fix for S_ISUID that we "lost" when switching
away from mes-m2's libc.

See http://git.savannah.gnu.org/cgit/mes.git/commit/?id=ce54ccc2c04b0a6ec9105522e4b8b4cc278c5106
2022-05-21 21:48:23 +03:00
Andrius Štikonas 3fd451a909 Swamp make and gzip. 2022-05-14 19:40:52 +01:00
Andrius Štikonas e4f5342ee4 Swap make and tar. 2022-05-14 12:42:03 +01:00
Andrius Štikonas b9079045db Swap sed and make.
This allows to use makefile rather than kaem script for building sed.
Makefiles for musl and mes are unified into one makefile with some
conditional code.
2022-05-14 12:41:27 +01:00
Andrius Štikonas 98ba2759b2 Upgrade musl to 1.2.3. 2022-05-12 00:41:17 +01:00
Andrius Štikonas 424aa5be38 Move from mes-m2 to mes-0.24. 2022-05-05 23:59:52 +01:00
fosslinux f1600467a7 Variety of improvements
- Rename sources to distfiles for clarity.
- Per sys(a/c) distfiles to reduce rootfs.py processing and reduce RAM
  usage in sysa.
- Canonicalise early kaem mes/tcc files to kaem script conventions.
- Cleanup unused setup in python.
2022-05-05 17:44:47 +10:00
Andrius Štikonas 5b032cb46c rootfs.py refactoring.
Switch to bzip2 packages
Move most of the preprocessing done by rootfs.py
into kaem and bash scripts inside live-bootstrap.
2022-04-21 00:49:56 +01:00
Andrius Štikonas 7a8567dc78 Rename /after to /sysa. 2022-04-11 18:53:35 +01:00
fosslinux 634ec99771 Rename perl5.004_05 and perl5.005_03
The underscores cause problems later, as _ is a delimiter for "revision
number" in packaging.
2022-03-07 19:02:12 +11:00
Dor Askayo f18504b509 Update mes-m2 2022-01-02 11:16:08 +02:00
Andrius Štikonas 620e10d4be Update stage0-posix. 2021-12-28 11:51:15 +00:00
Andrius Štikonas 9d3b1e2723 Update mes-m2. 2021-12-23 17:59:54 +00:00
Andrius Štikonas cd93a07481 Update mes-m2 and stage0-posix. 2021-11-06 00:07:13 +00:00
Andrius Štikonas 32ec57d62d Unhardcode x86 from initial steps. 2021-10-20 21:16:05 +01:00
fosslinux 98ea0a4c2e Don't use deblob-check
Generally, this is bad, because reduces featureset of kernel.
However, we don't use any blobbed features anyway.

1. This allows much lower RAM usage.
2. Speeds up deblobbing from hours -> seconds.

This nukes blobbed files instead of replacing blobs.
2021-10-13 17:57:50 +01:00
fosslinux 306dac7ba6 Add prompts when particular options are not given in config files 2021-10-13 00:42:21 +01:00
Andrius Štikonas c6c8a1eb7f Move chroot transition script inside bootstrap. 2021-10-10 16:38:52 +01:00
Andrius Štikonas e3d0191949 Update stage0-posix. 2021-10-08 20:55:06 +01:00
fosslinux 04180f5672 Various fixes + cleanup.
- Add parts.rst documentation for Linux kernel.
- Completely fix problems caused by new bootstrap, update checksums for
  /usr.
- Globalise populate_device_nodes.
- Enable deblobbing.
2021-09-14 14:59:08 +10:00
fosslinux d429c48d76 Update the linux kernel for sysb/c to 4.9.10.
- We do not use latest 4.9.x because it relies on a new version of
  binutils, while older versions do not. (Note: we should be able to go
  a bit newer but I didn't bother testing >50 versions to figure this
  out).
- We do not use newer kernel versions because they require one or more
  of (new perl, new binutils, new make, new gcc, new bison, new tar).
- sysb and sysc are updated to use the SATA (libata) subsystem (aka sda)
  instead of IDE-emulating SATA subsystem (aka hda) which is now
  available to us.
- While theoretically according to docs 4.9 should work OOTB with our
  version of binutils this is not the case, so we have to do a bit of
  (interesting) patching. But this does not break anything.
- Thankfully serial support in 4.9 is not screwed over like it is in 2.6
  so we can revert to that.
- 4.9 has the linux-libre project at our disposal, instead of gNewSense.
  So we use this. Unfortunatley that takes forever because we have to
  use sed because our version of gawk is too old/buggy. :( I plan to
  introduce very shortly 1. parallelism 2. 'sysc snapshot' which will
  start from sysc to avoid this. I do not want to use linux-libre
  tarballs because they make modificiations directly from this script
  (aka not easily verifiable, use the source!) and this script allows
  for much greater flexibility.
- We compile the initramfs ahead-of-build using the in-tree cpio
  generator instead of also building cpio to use less packages. We do
  NOT build the initramfs into the kernel like 2.6 (unsupported).
- Oh and fix a kexec-tools checksum.
2021-09-13 13:43:36 +10:00
fosslinux 1e19193408 Add make 3.82 (sysa) 2021-08-27 14:54:08 +10:00
fosslinux b93a931a53 Move to /usr prefix.
- This is much more standard and replaces /image in sysa and is the
  standard in sysc (avoids many issues).
- GCC needs to have a file created for some unknown reason.
- Checksums updated.
2021-08-27 14:54:08 +10:00