pull/5/head
Tomas M 2012-09-19 01:54:29 -05:00
parent 6b807b31cb
commit 9941a7eef9
2 changed files with 15 additions and 3 deletions

View File

@ -25,7 +25,7 @@ init_zram
init_union "$CHANGES" "$UNION" init_union "$CHANGES" "$UNION"
# find data dir with filesystem bundles # find data dir with filesystem bundles
DATA="$(find_data 60 $DATAMNT)" DATA="$(find_data 60 "$DATAMNT")"
# copy to RAM if needed # copy to RAM if needed

View File

@ -42,6 +42,12 @@ log()
echo "$@" 2>/dev/null >>/var/log/livedbg echo "$@" 2>/dev/null >>/var/log/livedbg
} }
echolog()
{
echo "$@"
log "$@"
}
# show information about the debug shell # show information about the debug shell
show_debug_banner() show_debug_banner()
{ {
@ -198,12 +204,12 @@ device_bestfs()
# #
find_data_try() find_data_try()
{ {
debug_log "find_data" debug_log "find_data_try"
local DEVICE FS MNT local DEVICE FS MNT
mkdir -p "$1" mkdir -p "$1"
blkid | sort | cut -d: -f 1 | while read DEVICE; do blkid | sort | cut -d: -f 1 | grep -E -v "/loop|/ram|/zram" | while read DEVICE; do
FS="$(device_bestfs "$DEVICE")" FS="$(device_bestfs "$DEVICE")"
mount -r "$DEVICE" "$1" $FS mount -r "$DEVICE" "$1" $FS
if [ -d "$1/$LIVEKITNAME" ]; then if [ -d "$1/$LIVEKITNAME" ]; then
@ -221,16 +227,22 @@ find_data_try()
# #
find_data() find_data()
{ {
debug_log "find_data"
local DATA local DATA
echo -n "Looking for $LIVEKITNAME data .." >&2
for timeout in $(seq 1 $1); do for timeout in $(seq 1 $1); do
echo -n "." >&2
DATA="$(find_data_try "$2")" DATA="$(find_data_try "$2")"
if [ "$DATA" != "" ]; then if [ "$DATA" != "" ]; then
echo "$DATA" echo "$DATA"
echo "" >&2
return return
fi fi
sleep 1 sleep 1
done done
echo "" >&2
} }
# Mount squashfs filesystem bundles # Mount squashfs filesystem bundles