Skip to content

A rootless Android app that boots Alpine Linux: run containers (Podman/Docker/LXC) and GUI desktop apps.

fix(init): resize the persistent filesystem after storage.img grows

ExTv585ce498d7a8
diff --git a/Dockerfile b/Dockerfile
index 3eedba7..e7a6b0a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -199,7 +199,7 @@ FROM --platform=linux/arm64/v8 alpine:3.24 AS rootfs-builder
RUN apk update && apk add --no-cache \
bash busybox busybox-extras ttyd podman \
netavark aardvark-dns fuse-overlayfs slirp4netns iptables ip6tables \
- shadow-uidmap ca-certificates crun curl e2fsprogs util-linux openrc \
+ shadow-uidmap ca-certificates crun curl e2fsprogs e2fsprogs-extra util-linux openrc \
dropbear ncurses-terminfo-base musl-locales kmod fastfetch
COPY init-podroid /init
RUN chmod +x /init
diff --git a/init-podroid b/init-podroid
index afe8c13..30d7cc2 100755
--- a/init-podroid
+++ b/init-podroid
@@ -63,6 +63,12 @@ if ! mount -t ext4 -o rw,noatime,commit=1,barrier=1 /dev/vda /mnt/persist 2>/dev
|| { echo "FATAL: persistent ext4 (/dev/vda) mount failed" > /dev/console; ls -l /dev/vd* > /dev/console 2>&1; exec sh; }
fi
+# Android grows storage.img in place when the user raises the storage size;
+# the ext4 inside still has its old size until it is resized. Online resize is
+# a no-op when nothing changed and must never stop the boot.
+resize2fs /dev/vda >/dev/null 2>&1 \
+ || echo "WARN: resize2fs /dev/vda failed; storage keeps its previous size" > /dev/console
+
echo "Mounting system..." > /dev/console
mount -t squashfs -o ro /dev/vdb /mnt/lower \
|| { echo "FATAL: squashfs (/dev/vdb) mount failed" > /dev/console; ls -l /dev/vd* > /dev/console 2>&1; exec sh; }