Commit graph

22 commits

Author SHA1 Message Date
Samuel Tyler
bbccded731
Use a "real" copyright line 2025-10-17 18:53:10 +11:00
fosslinux
7d50a224c6 Support file:// mirrors
Spawns a simple HTTP server to host the mirror.
Useful for testing mirror support or CI in chroot or bwrap modes.
2025-02-02 10:02:32 +11:00
Andrius Štikonas
9950b07204 Silence pylint errors. 2024-10-25 18:15:58 +01:00
Eduardo Sánchez Muñoz
5dbaeaf19b Create disk images without root
`mke2fs` has a `-d` option that allows to populate the newly created filesystem without needing to temporarily mount it. That allows to use `parted` and `mkfs.ext3` on regular files without needing root access.
2024-01-12 22:39:20 +01:00
Gábor Stefanik
b4d9c5e7cb Disk creation improvements
* Support specifying the size of the target disk image for qemu
* For bare metal, only pad the image to the next megabyte
* Use truncate() to extend images, instead of writing zeros (faster)
* Return None from get_disk() with nonexistent name
* Leave 1MiB on non-boot disks, or 1GiB on boot disks, unpartitioned
  (for proper 4K alignment and to help preserve the srcfs or boot
  partition creation)
* Fix qemu invocation when an external.img is not used
* Make -qr work with kernel bootstrap (will need kexec-fiwix fix)
2023-12-22 13:06:19 +01:00
fosslinux
ab47483a51 Linters & CI updates 2023-12-15 21:44:43 +11:00
fosslinux
05c13dd64e Modify rootfs.py infrastructure to support the new layout 2023-12-15 21:43:21 +11:00
rick-masters
4cf2b860ef Fix lint warning for unnecessary else block. 2023-11-27 14:10:37 +00:00
rick-masters
4d20284f85 Return process from run_as_root. 2023-11-27 13:55:05 +00:00
Seppo Yli-Olli
f893df52fe Add a wrapper for commmands needing sudo that checks if you are euid 0 2023-11-08 17:34:56 +02:00
Eduardo Sánchez Muñoz
c143e65154 Pass --unshare-net to bwrap when building with --external-sources
Ensures that when `--external-sources` is used, the build does not require a working internet connection.

`--unshare-net` is always passed for the sysa phase.
2023-04-13 18:52:37 +02: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
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
Dor Askayo
c9868f4312 Add -P to the losetup command
It seems to be required for partitions to be recognized.
2022-05-10 22:37:52 +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
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
fosslinux
4fb8efafe2 Use sudo for losetup -f.
This is required in some environments.
2022-03-07 19:02:12 +11:00
Andrius Štikonas
3bb72fb0f2 Use recursive umount to unmount volumes mounted during bootstrap in chroot mode. 2021-12-23 00:52:30 +00: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
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
Andrius Štikonas
8406399f47 Do not require chroot to be in PATH of non-root user. 2021-04-22 21:55:52 +01:00
Andrius Štikonas
713fd9143f Port rootfs.sh to Python 2021-04-11 00:06:24 +01:00