mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-25 16:53:59 +00:00
initram: retry mount root incase its an usb device
This commit is contained in:
parent
a5f1bed085
commit
60258b46d5
@ -53,6 +53,15 @@ find_ovl() {
|
|||||||
echo "$ovl"
|
echo "$ovl"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
retry_mount() {
|
||||||
|
# usb might need some time to settle so we retry a few times
|
||||||
|
for i in $(seq 0 19); do
|
||||||
|
mount $@ 2>&1 && return 0
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
# gotta start from somewhere :)
|
# gotta start from somewhere :)
|
||||||
echo "Alpine Init $VERSION"
|
echo "Alpine Init $VERSION"
|
||||||
|
|
||||||
@ -116,7 +125,9 @@ eend 0
|
|||||||
|
|
||||||
# check if root=... was set
|
# check if root=... was set
|
||||||
if [ -n "$KOPT_root" ]; then
|
if [ -n "$KOPT_root" ]; then
|
||||||
mount $KOPT_root $NEWROOT
|
ebegin "Mounting root"
|
||||||
|
retry_mount $KOPT_root $NEWROOT 2>/dev/null
|
||||||
|
eend $?
|
||||||
cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
|
cat /proc/mounts | while read DEV DIR TYPE OPTS ; do
|
||||||
if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
|
if [ "$DIR" != "/" -a "$DIR" != "$NEWROOT" -a -d "$DIR" ]; then
|
||||||
mkdir -p $NEWROOT/$DIR
|
mkdir -p $NEWROOT/$DIR
|
||||||
@ -136,11 +147,7 @@ if [ -n "$ALPINE_DEV_FS" ]; then
|
|||||||
mount_opts="-t $ALPINE_DEV_FS"
|
mount_opts="-t $ALPINE_DEV_FS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# usb might need some time to settle so we retry a few times
|
retry_mount $mount_opts /dev/$ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1
|
||||||
for i in $(seq 0 19); do
|
|
||||||
mount $mount_opts /dev/$ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1 && break
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
eend $?
|
eend $?
|
||||||
|
|
||||||
ebegin "Mounting loopback device for kernel modules"
|
ebegin "Mounting loopback device for kernel modules"
|
||||||
|
Loading…
Reference in New Issue
Block a user