Commit Graph

43 Commits

Author SHA1 Message Date
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
fosslinux e2ceb13e57 Expand sysc disk 2023-05-09 22:41:04 +10: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 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 0d4abd0223 Add autogen-5.18.16. 2022-09-29 00:00:02 +01:00
Andrius Štikonas 997cd15453 Add sed 4.8 2022-09-23 22:03:32 +01:00
Andrius Štikonas f9d83f3a35 Add grep 3.7. 2022-09-20 00:16:43 +01:00
Andrius Štikonas 9f3f65f146 Add which 2.21. 2022-09-17 11:12:10 +01:00
Dor Askayo 9bde9d1afe Rebuild musl 1.2.3 with support for dynamic linking
Now that GCC and binutils support musl's toolchain natively, musl can
have its dynamic linking support enabled without ill-effects.
2022-09-15 09:16:56 +03:00
Dor Askayo 4113d60b24 Add binutils 2.38 2022-09-14 12:36:32 +03:00
Dor Askayo 5aae443d65 Add libtool 2.4.7
Instead of using the pre-generated "bootstrap" script, execute the
relevant bootstrap operations manually. This doesn't actually change
the build output; the final package hash remains identical.
2022-09-11 09:19:16 +03:00
fosslinux 5ad055d2d3 Fix bubblewrap mode 2022-06-18 09:10:11 +10: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 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 8008de8e73 Add file downloading logic
Add urls to sysc, and modify some tarballs to http (non s) before ssl
2022-06-10 13:30:58 +10: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 fa2a09b63f Rename "chroot" to "create_disk_image" in sysc's prepare()
This better describes the action, and will make more sense with the
addition of the rootless bootstrap mode that doesn't require a disk
image either.
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 7040b550a9 Make rootfs_dir local to prepare()
It's not needed by other methods.
2022-05-23 17:45:53 +03:00
Dor Askayo 537cdb6540 Detach loopback device only if it was attached
Also change the print to better describe the action taken.
2022-05-23 17:45:53 +03:00
Dor Askayo 8c605f213a Ensure umount isn't called when self.mounted_tmpfs=False
This is accomplished by calling SysGeneral's __del__() method,
in which self.mounted_tmpfs is already checked.
2022-05-23 17:45:53 +03: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
fosslinux acf713595c Update zlib to 1.2.12 2022-05-04 11:28: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
mid-kid a937c7c80f Fix zlib-1.2.11 download 2022-04-09 17:33:45 +02:00
fosslinux b760b3eb2b Final fixes:
- All QEMU reproducibility issues resolved
- Added SPDX licensing
- Couple other small issues
- Fix guile reproducbility
2022-03-12 16:24:25 +11:00
fosslinux a1520a07fa Add xbps-0.59.1.
This also required

- merging of usr/sbin and usr/bin (which should be done anyway), because
  of a dodgy PATH searcher
- moving of zlib earlier.
2022-03-07 19:02:12 +11:00
fosslinux bdd0227fdd Add openssl 1.1.1l. 2022-03-07 19:02:12 +11:00
fosslinux a8cdecdfbd Add libarchive 3.5.2. 2022-03-07 19:02:12 +11:00
Andrius Štikonas afa162397c Add autoconf 2.71. 2021-10-10 22:55:41 +01:00
Andrius Štikonas c6c8a1eb7f Move chroot transition script inside bootstrap. 2021-10-10 16:38:52 +01:00
fosslinux a8a9056f1d Change some formats to f-strings
As pylint recommends.
2021-09-20 14:31:10 +10:00
Andrius Štikonas 8857f53cd1 GNU Guile 3.0.7 2021-09-20 14:25:54 +10:00
Andrius Štikonas de582f1866 Boehm-gc 8.0.4 2021-09-20 14:25:53 +10:00
Andrius Štikonas e1350d1745 libatomic_ops 7.6.10. 2021-09-20 14:25:53 +10:00
Andrius Štikonas bdab13eb60 libffi 3.3 2021-09-20 14:25:53 +10: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 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
fosslinux 5c88f1c87f 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.
2021-08-27 14:54:08 +10:00