init-storage: Add retry loop for findfs
Aimee OS/aimee-os/pipeline/head This commit looks good
Details
Aimee OS/aimee-os/pipeline/head This commit looks good
Details
Occasionally, especially on a Raspberry Pi, the storage subsystem has not fully enumerated all of the disks before the `init-storage` script starts. This prevents the system from being able to boot, since the script attempts to identify the root filesystem very early. Now, we try a few times to identify the filesystem before giving up, to give the kernel a chance to discover everything.master
parent
f3c6c71bfa
commit
62035f3223
|
@ -28,6 +28,16 @@ copy_vol() {
|
|||
umount "${tmpdir}"
|
||||
}
|
||||
|
||||
find_part() {
|
||||
_i=0
|
||||
while [ $_i -lt 5 ]; do
|
||||
findfs "$1" 2>/dev/null && return
|
||||
_i=$((_i + 1))
|
||||
sleep 1
|
||||
done
|
||||
findfs "$1"
|
||||
}
|
||||
|
||||
format_dev() {
|
||||
dev="$1"
|
||||
partno=$(partition_number "${dev}")
|
||||
|
@ -140,8 +150,8 @@ setup_etc() {
|
|||
/sysroot/etc
|
||||
}
|
||||
|
||||
rootdev=$(findfs "$1")
|
||||
datapart=$(findfs "${2:-PARTLABEL=aimeeos-data}")
|
||||
rootdev=$(find_part "$1")
|
||||
datapart=$(find_part "${2:-PARTLABEL=aimeeos-data}")
|
||||
if [ -b "${datapart}" ]; then
|
||||
printf 'Found data partition: %s\n' "${datapart}" >&2
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue