From 2027ebc82efae07215af1e1e78c6f8c7584f9175 Mon Sep 17 00:00:00 2001 From: xiexiaobao Date: Sat, 27 Jun 2026 15:32:55 +0800 Subject: [PATCH] fix: expand-overlay START=98 to run before dockerd(99) --- package/diy/expand-overlay/files/expand-overlay.init | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/package/diy/expand-overlay/files/expand-overlay.init b/package/diy/expand-overlay/files/expand-overlay.init index d37923b5ae..c303b49a61 100644 --- a/package/diy/expand-overlay/files/expand-overlay.init +++ b/package/diy/expand-overlay/files/expand-overlay.init @@ -1,9 +1,9 @@ #!/bin/sh /etc/rc.common # /etc/init.d/expand-overlay # Stage 2: Resize p3 filesystem, format & mount p4, configure Docker. -# Runs at START=99, after overlay is mounted and most services started. +# Runs at START=98 (before dockerd at 99) so Docker picks up data_root. -START=99 +START=98 boot() { local flag="/etc/resize2fs.done" @@ -11,7 +11,6 @@ boot() { # ---- Stage 2a: Resize p3 filesystem ---- if [ ! -f "$flag" ]; then - # Wait for stage1 (uci-defaults) to finish local i=0 while [ ! -f "/etc/expand-overlay.done" ] && [ $i -lt 30 ]; do sleep 1 @@ -26,27 +25,20 @@ boot() { # ---- Stage 2b: Format and mount p4 data partition ---- if [ ! -f "$p4flag" ]; then - # Check if p4 is marked with RESET (needs formatting) if dd if=/dev/mmcblk2p4 bs=5 count=1 2>/dev/null | grep -qF "RESET"; then - # Format p4 as ext4 mkfs.ext4 -F -L data /dev/mmcblk2p4 2>/dev/null fi - # Mount p4 to /mnt/data mkdir -p /mnt/data mount /dev/mmcblk2p4 /mnt/data 2>/dev/null - # Create Docker directory on data partition mkdir -p /mnt/data/docker - # Point Docker to data partition uci -q set dockerd.globals.data_root="/mnt/data/docker" uci -q commit dockerd - # Add to fstab for auto-mount on future boots if ! grep -q "mmcblk2p4" /etc/config/fstab 2>/dev/null; then block detect > /dev/null 2>&1 - # block detect creates entries, we update the last one local idx=$(( $(uci show fstab | grep -c "fstab.@mount") - 1 )) [ "$idx" -ge 0 ] && uci -q set fstab.@mount[$idx].target="/mnt/data" uci -q commit fstab