Commit Graph

26 Commits

Author SHA1 Message Date
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
rick-masters 5aa58e34e0 Add -F flag to mkfs to avoid prompt to proceed. 2024-01-29 23:51:52 +00:00
fosslinux 34e4bf9bcc
Merge pull request #381 from eduardosm/disk-images-without-root
Create disk images without root
2024-01-24 01:40:13 +00:00
Gábor Stefanik 2023432c5e Use builder-hex0 stages from submodule
This ends the reliance on the precompiled stage1 image in ootstrap-seeds,
and the locally committed copy of the stage2 hex0 code. Instead, both
stages are taken from the new builder-hex0 submodule, with stage1 compiled
by generator.py on the fly. The local copy of stage2 is dropped.

This way, updating to a newer builder-hex0 becomes much easier: just update
the submodule.
2024-01-21 19:18:21 +01:00
Eduardo Sánchez Muñoz 3f41cab6f7 Only copy no-network distfiles to "init" when `--external-source` is passed (with kernel bootstrap)
All distfiles are still copied to "external"
2024-01-12 22:39:21 +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
Andrius Štikonas 754d967b29
Merge pull request #406 from rick-masters/fix-qemu-linux-str-concat
Account for int and NoneType in string concatenations.
2024-01-10 22:39:55 +00:00
Andrius Štikonas 969f42155b
Merge pull request #404 from rick-masters/add-curl-header-for-download
Add curl header to bypass suspected savannah throttling.
2024-01-10 22:36:48 +00:00
rick-masters 82235e5bd0 Account for int and NoneType in string concatenations. 2024-01-10 18:03:50 +00:00
rick-masters 7a0f03678c Add curl header to bypass suspected savannah throttling. 2024-01-10 17:46:15 +00:00
rick-masters 468aeb07a7 Convert status_code to string for error message. 2024-01-10 17:32:06 +00:00
Gábor Stefanik 81e3123262 Rename tmpdir to target and always preserve it, dropping --preserve
There is nothing temporary about our "tmpdir" - its sole purpose is to
contain the final product of the bootstrap process. Thus, removing it
at the end of bootstrap amounts to doing the entire process for nothing.

To remedy this, --tmpdir is renamed --target, keeping the -t short form,
and defaulting to "target" instead of "tmp" to make its purpose clearer.
The --preserve option is removed, as the target is now always preserved.
2023-12-26 16:34:04 +01:00
Gábor Stefanik f67c7d1144 Tolerate externals/distfiles already existing (needed for CI) 2023-12-26 13:01:24 +11:00
Gábor Stefanik 896c618bd1 Re-copy distfiles on generator.reuse() 2023-12-26 13:01:24 +11:00
Gábor Stefanik 9ed4ae9a59 Support reusing existing directory for multipass bootstrapping 2023-12-26 13:01:24 +11:00
Gábor Stefanik ab9455f918 Fix warnings in existing code revealed by newer pylint 2023-12-22 13:08:23 +01:00
Gábor Stefanik be1333ee8b Make tmpdir a method parameter of prepare()
Fixes pylint errors.
2023-12-22 13:08:20 +01:00
Gábor Stefanik b45e1f81ae Fix failure with --external-sources 2023-12-22 13:07:45 +01:00
Gábor Stefanik 32dc4c702b More verbose error message on HTTP errors 2023-12-22 13:07:45 +01:00
Gábor Stefanik 55d3c36e09 Move kernel-bootstrap source image out of the directory it's generated from
This way, an incomplete version of the image itself won't get included
in srcfs anymore.
2023-12-22 13:07:45 +01:00
Gábor Stefanik 3305f2a41b Use manifest to deduce pre-network sources list
No need to maintain a separate pre-network-sources file anymore,
the list is instead derived from the bootstrap manifest via the
source manifest.
2023-12-22 13:07:04 +01:00
Gábor Stefanik a68ae62f9e Download distfiles only when needed, based on manifest
Unless --external-sources is given, only download distfiles that
need to be included in srcfs. The rest will be downloaded anyway
by the bootstrap system once it gets network access.

To accomplish this, instead of searching steps for sources files,
we now parse steps/manifest. As a side effect, source_manifest.py
now outputs source files in the order they appear in the manifest.
2023-12-22 13:07:04 +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
Gábor Stefanik dc62d8242c Create external.img only when needed 2023-12-22 12:10:09 +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