Skip to content

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

perf(rootfs,initramfs): tighten network retry 30s→0.5s, drop ready sleeps, dead fsck loop

ExTvd94cc2772a3d
diff --git a/build-rootfs/files/etc/init.d/podroid-network b/build-rootfs/files/etc/init.d/podroid-network
index 991c41a..82b83f7 100644
--- a/build-rootfs/files/etc/init.d/podroid-network
+++ b/build-rootfs/files/etc/init.d/podroid-network
@@ -12,11 +12,11 @@ start() {
echo "Configuring containers..." > /dev/console
ip link set lo up 2>/dev/null
NETIF=""
- for _i in $(seq 1 150); do
+ for _i in $(seq 1 10); do
NETIF=$(ip -o link show 2>/dev/null | awk -F': ' '{print $2}' | \
grep -vE '^(lo|dummy[0-9]*|veth|podman|cni-|docker)' | head -1)
[ -n "$NETIF" ] && break
- sleep 0.2
+ sleep 0.05
done
if [ -n "$NETIF" ]; then
ip link set "$NETIF" up
diff --git a/build-rootfs/files/etc/init.d/podroid-ready b/build-rootfs/files/etc/init.d/podroid-ready
index 199e5a6..a7e90c1 100644
--- a/build-rootfs/files/etc/init.d/podroid-ready
+++ b/build-rootfs/files/etc/init.d/podroid-ready
@@ -10,9 +10,7 @@ start() {
# By the time we run, dropbear has started (we depend on it).
# Emit the boot stages PodroidQemu.detectBootStage() expects.
echo "Starting SSH..." > /dev/console
- sleep 0.2
echo "Almost ready..." > /dev/console
- sleep 0.3
echo "Ready!" > /dev/console
return 0
}
diff --git a/init-podroid b/init-podroid
index 6e2a029..2d0ad51 100755
--- a/init-podroid
+++ b/init-podroid
@@ -25,10 +25,10 @@ mkdir -p /mnt/persist /mnt/lower /mnt/overlay
# nobarrier: write barriers are unnecessary inside the VM because QEMU's
# cache=writeback layer already gives us host-level barriers on flush.
# Saves journal-commit syscalls on every metadata change.
-for _try in 1 2; do
- if mount -t ext4 -o rw,noatime,commit=60,barrier=0 /dev/vda /mnt/persist 2>/dev/null; then break; fi
+if ! mount -t ext4 -o rw,noatime,commit=60,barrier=0 /dev/vda /mnt/persist 2>/dev/null; then
e2fsck -y /dev/vda >/dev/null 2>&1 || mkfs.ext4 -q -F /dev/vda
-done
+ mount -t ext4 -o rw,noatime,commit=60,barrier=0 /dev/vda /mnt/persist
+fi
mount -t squashfs -o ro /dev/vdb /mnt/lower