Begin persistent storage implementation
All checks were successful
Aimee OS/aimee-os/pipeline/head This commit looks good
All checks were successful
Aimee OS/aimee-os/pipeline/head This commit looks good
Most of the logic in the `init-storage` script is the same as it was in Aimee OS v1 (Gentoo). The major difference is now we are initializing the data volume in the initramfs instead of in the real OS. This allows us to make all of `/etc` writable via OverlayFS, instead of having only certain sub-directories writable via bind-mounts. Buildroot doesn't really have any tools for building an initramfs, unfortunately. It does have a bit of infrastructure for running `dracut`, but I'd really rather avoid having that much complexity in the initramfs; all we need is to run the `init-storage` script and then switch root. Instead, the `mkinitramfs.sh` script, called in the post-build stage, creates the CPIO archive from files in the target directory. The only particularly interesting bit is how it resolves shared library dependencies, to make sure the appropriate resources are available for the requisite commands. I briefly considered building a statically-linked BusyBox just for the initramfs. Since it doesn't provide several important tools like `btrfs`/`mkfs.btrfs`, I had to implement the dynamic link resolution function anyway. It made sense, then, to copy Dash and the necessary Coreutils binaries themselves.
This commit is contained in:
8
package/aimee-os-utils/Config.in
Normal file
8
package/aimee-os-utils/Config.in
Normal file
@@ -0,0 +1,8 @@
|
||||
config BR2_PACKAGE_AIMEE_OS_UTILS
|
||||
bool
|
||||
select BR2_PACKAGE_BTRFS_PROGS
|
||||
select BR2_PACKAGE_UTIL_LINUX
|
||||
select BR2_PACKAGE_UTIL_LINUX_BINARIES
|
||||
select BR2_PACKAGE_UTIL_LINUX_MOUNTPOINT
|
||||
select BR2_PACKAGE_UTIL_LINUX_PARTX
|
||||
select BR2_PACKAGE_UTIL_LINUX_SWITCH_ROOT
|
||||
21
package/aimee-os-utils/aimee-os-utils.mk
Normal file
21
package/aimee-os-utils/aimee-os-utils.mk
Normal file
@@ -0,0 +1,21 @@
|
||||
################################################################################
|
||||
#
|
||||
# Aimee OS Utils
|
||||
#
|
||||
################################################################################
|
||||
|
||||
AIMEE_OS_UTILS_VERSION = 2.0
|
||||
AIMEE_OS_UTILS_LICENSE = GPL-3.0+
|
||||
AIMEE_OS_UTILS_DEPENDENCIES = \
|
||||
host-fakeroot \
|
||||
btrfs-progs \
|
||||
|
||||
AIMEE_OS_UTILS_SOURCE =
|
||||
|
||||
define AIMEE_OS_UTILS_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m u=rw,go=r \
|
||||
$(AIMEE_OS_UTILS_PKGDIR)/var.mount \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/var.mount
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
12
package/aimee-os-utils/var.mount
Normal file
12
package/aimee-os-utils/var.mount
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=/var
|
||||
DefaultDependencies=no
|
||||
Conflicts=umount.target
|
||||
Before=local-fs.target umount.target
|
||||
After=swap.target
|
||||
|
||||
[Mount]
|
||||
What=PARTLABEL=aimeeos-data
|
||||
Where=/var
|
||||
Type=btrfs
|
||||
Options=subvol=var,nosuid,nodev,noexec
|
||||
Reference in New Issue
Block a user