summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-10-10 23:28:52 +0000
committerAlyssa Ross <hi@alyssa.is>2022-11-13 23:59:02 +0000
commit8c350b7a74af65b0a08b024efde6f3b87732ffe7 (patch)
tree377368aeb73c061a3e151bd36a7f517a6a409257
parentdb9b640857bef3a835d9dc4a1bfc62e260f3a7b4 (diff)
downloadspectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.tar
spectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.tar.gz
spectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.tar.bz2
spectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.tar.lz
spectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.tar.xz
spectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.tar.zst
spectrum-8c350b7a74af65b0a08b024efde6f3b87732ffe7.zip
host/rootfs: automatically grow user partition
In future, we probably want to make sure we only do this once.  I
haven't decided what the best way to do that would be.  Since we're
likely going to switch to btrfs anyway for the user partition, it's
probably not worth thinking about too much.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Message-Id: <20221010232909.1953738-13-hi@alyssa.is>
-rw-r--r--host/rootfs/default.nix10
-rw-r--r--host/rootfs/etc/s6-rc/ext/up1
2 files changed, 8 insertions, 3 deletions
diff --git a/host/rootfs/default.nix b/host/rootfs/default.nix
index 4788628..1dd24c5 100644
--- a/host/rootfs/default.nix
+++ b/host/rootfs/default.nix
@@ -6,7 +6,7 @@
 pkgs.pkgsStatic.callPackage (
 
 { lib, stdenvNoCC, nixos, runCommand, writeReferencesToFile, s6-rc, tar2ext4
-, busybox, cloud-hypervisor, cryptsetup, execline, jq, kmod
+, busybox, cloud-hypervisor, cryptsetup, execline, e2fsprogs, jq, kmod
 , mdevd, s6, s6-linux-init, socat, util-linuxMinimal, xorg
 }:
 
@@ -44,8 +44,8 @@ let
   foot = pkgsGui.foot.override { allowPgo = false; };
 
   packages = [
-    cloud-hypervisor execline jq kmod mdevd s6 s6-linux-init s6-rc socat
-    start-vm
+    cloud-hypervisor e2fsprogs execline jq kmod mdevd s6 s6-linux-init s6-rc
+    socat start-vm
 
     (cryptsetup.override {
       programs = {
@@ -57,11 +57,15 @@ let
 
     (busybox.override {
       extraConfig = ''
+        CONFIG_CHATTR n
         CONFIG_DEPMOD n
         CONFIG_FINDFS n
         CONFIG_INIT n
         CONFIG_INSMOD n
+        CONFIG_LSATTR n
         CONFIG_LSMOD n
+        CONFIG_MKE2FS n
+        CONFIG_MKFS_EXT2 n
         CONFIG_MODINFO n
         CONFIG_MODPROBE n
         CONFIG_RMMOD n
diff --git a/host/rootfs/etc/s6-rc/ext/up b/host/rootfs/etc/s6-rc/ext/up
index 4e0b9fc..c189471 100644
--- a/host/rootfs/etc/s6-rc/ext/up
+++ b/host/rootfs/etc/s6-rc/ext/up
@@ -2,4 +2,5 @@
 # SPDX-FileCopyrightText: 2021-2022 Alyssa Ross <hi@alyssa.is>
 
 if { /etc/mdev/wait ext }
+if { resize2fs /dev/ext }
 mount /dev/ext /ext