find data retrying
This commit is contained in:
@@ -39,15 +39,16 @@ cat bootfiles/syslinux.cfg | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" > $BOOT/sysl
|
||||
cat bootfiles/bootinst.bat | sed -r "s:/boot/:/$LIVEKITNAME/boot/:" | sed -r "s:\\\\boot\\\\:\\\\$LIVEKITNAME\\\\boot\\\\:" > $BOOT/bootinst.bat
|
||||
cp /boot/vmlinuz $BOOT/
|
||||
|
||||
# create compressed bundles
|
||||
for i in $MKMOD; do
|
||||
mksquashfs /$i $LIVEKITDATA/$LIVEKITNAME/$i.$BEXT -comp xz -b 512k
|
||||
done
|
||||
|
||||
if [ -d sb ]; then
|
||||
cp sb/* $LIVEKITDATA/$LIVEKITNAME/
|
||||
else
|
||||
# create compressed bundles
|
||||
for i in $MKMOD; do
|
||||
mksquashfs /$i $LIVEKITDATA/$LIVEKITNAME/$i.$BEXT -comp xz -b 512k
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# create ISO for CD image
|
||||
echo "Creating ISO file for CD boot..."
|
||||
cd "$LIVEKITDATA"
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ init_zram
|
||||
init_union "$CHANGES" "$UNION"
|
||||
|
||||
# find data dir with filesystem bundles
|
||||
DATA="$(find_data $DATAMNT)"
|
||||
DATA="$(find_data 60 $DATAMNT)"
|
||||
|
||||
# copy to RAM if needed
|
||||
|
||||
|
||||
+22
-3
@@ -193,10 +193,10 @@ device_bestfs()
|
||||
}
|
||||
|
||||
# Find LIVEKIT data by mounting all devices
|
||||
# If found, retain mounted disk
|
||||
# $1 = data directory to mount
|
||||
# If found, keep mounted, else unmount
|
||||
# $1 = data directory target (mount here)
|
||||
#
|
||||
find_data()
|
||||
find_data_try()
|
||||
{
|
||||
debug_log "find_data"
|
||||
|
||||
@@ -214,6 +214,25 @@ find_data()
|
||||
done
|
||||
}
|
||||
|
||||
# Retry finding LIVEKIT data several times,
|
||||
# until timeouted or until data is found
|
||||
# $1 = timeout
|
||||
# $2 = data directory target (mount here)
|
||||
#
|
||||
find_data()
|
||||
{
|
||||
local DATA
|
||||
|
||||
for timeout in $(seq 1 $1); do
|
||||
DATA="$(find_data_try "$2")"
|
||||
if [ "$DATA" != "" ]; then
|
||||
echo "$DATA"
|
||||
return
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
}
|
||||
|
||||
# Mount squashfs filesystem bundles
|
||||
# and add them to union
|
||||
# $1 = directory where to search for bundles
|
||||
|
||||
Reference in New Issue
Block a user