1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-16 21:05:10 +03:00
pmbootstrap/pmb/helpers
Casey Connolly ecf1d54e39 WIP: install: rootless disk image
Refactor the install code to stop using loop devices and instead create
and manipulate a disk image directly. Both ext4 and vfat have mechanisms
for formatting and populating partitions at an offset inside an image,
other filesystems likely do as well but so far have not been implemented
or tested.

With this "pmbootstrap install" works for standard EFI disk images (e.g.
QEMU, X64 or trailblazer) entirely rootless.

Since the creation of the disk images happens in the same user namespace
as everything else, the resulting disk images have correct ownership and
permissions even though from the host perspective they are all subuids.

This gets image building working properly *for the default case*. We can
now build disk images! In particular, we can build disk images with a 4k
sector size even on a host with a 512 byte sector size (or block size in
the filesystem). This is surprisingly hard for some reason since not all
libfdisk tools have the right flags. Thankfully sfdisk does.

In addition, we now generate UUIDs ourselves, to break the loop between
generating fstab and running mkfs (since we also populate the disk image
/with/ mkfs, we need to already know the UUID when we run it...).

Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
2025-06-13 21:47:42 +02:00
..
__init__.py Bump copyright to 2023 2023-01-22 19:18:06 +01:00
apk.py pmb.helpers.apk: Avoid concatenation 2025-05-25 11:39:14 +02:00
apk_static.py pmb: Add more types and fix type errors (MR 2514) 2024-12-20 16:29:33 +01:00
aportupgrade.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
args.py WIP: install: rootless disk image 2025-06-13 21:47:42 +02:00
cli.py helpers.cli: Fix regex validation (MR 2557) 2025-02-27 00:24:08 +01:00
devices.py pmb: Split devices by category during codename selection 2025-05-25 19:26:57 +02:00
exceptions.py pmb: Remove unnecessary pass statements (MR 2537) 2025-02-02 22:48:50 +01:00
file.py pmb: Add more type hints (MR 2513) 2024-12-19 18:52:25 +01:00
frontend.py WIP: install: rootless disk image 2025-06-13 21:47:42 +02:00
git.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
http.py Add option to auto-select the best mirror 2025-04-11 17:27:33 +02:00
lint.py pmb: Rename pmb:gpu-accel and deviceinfo_gpu_accelerated 2025-05-08 17:33:11 +02:00
locale.py pmb.helpers.locale: Use frozenset for primary_layouts (MR 2525) 2025-01-15 22:35:02 +01:00
logging.py pmb.helpers.logging: Fix type for args 2025-05-25 19:26:57 +02:00
mount.py WIP: install: rootless disk image 2025-06-13 21:47:42 +02:00
other.py unshare binfmt 2025-05-30 21:29:27 +02:00
package.py pmb: Reformat with Ruff 0.9 (MR 2525) 2025-01-15 22:35:02 +01:00
pkgrel_bump.py pmb: Add lots of type hints (MR 2464) 2024-10-30 12:39:45 +01:00
pmaports.py pmb.helpers.pmaports: Clean up some strings 2025-05-25 19:26:52 +02:00
repo.py core: Arch: add .supported_binary() (MR 2474) 2025-02-27 01:29:30 +01:00
repo_missing.py pmb: Use unpacking operator to concatenate collections (MR 2525) 2025-01-15 22:35:02 +01:00
run.py remove sudo wrapper 2025-05-30 13:23:00 +02:00
run_core.py remove sudo timer 2025-05-30 13:22:59 +02:00
status.py show the status output on failure (MR 2472) 2024-11-04 10:15:59 +09:00
test_devices.py pmb: Split devices by category during codename selection 2025-05-25 19:26:57 +02:00
toml.py pmb: Add lots of type hints (MR 2464) 2024-10-30 12:39:45 +01:00
ui.py pmb.helpers.ui: Add must_exist argument to check_option() (MR 2530) 2025-01-16 12:22:28 +01:00