v0.3 - Now with extra progressbar!

master
Robert "ar" Gerus 2013-04-30 04:02:30 +02:00
parent 73cf5d5027
commit b41afe0687
2 changed files with 18 additions and 12 deletions

30
init
View File

@ -43,7 +43,7 @@ isok $?
info "looking for device with rootfs"
for var in $(cat /proc/cmdline); do
if [[ ${var/=*} = rootfs_location_uuid ]]; then
uuid=${var/*=}
uuid="${var/*=}"
fi
done
device=$(findfs UUID=${uuid})
@ -53,12 +53,24 @@ isok $?
info "getting rootfs filename"
for var in $(cat /proc/cmdline); do
if [[ ${var/=*} = rootfs_filename ]]; then
filename=${var/*=}
filename="${var/*=}"
fi
done
if [[ -z ${filename} ]]; then
info "going with default"
filename=rootfs.tar.xz
info "going with default: rootfs.tar.xz"
filename="rootfs.tar.xz"
fi
isok 0
info "getting root tmpfs size"
for var in $(cat /proc/cmdline); do
if [[ ${var/=*} = rootfs_size ]]; then
size=${var/*=}
fi
done
if [[ -z ${size} ]]; then
info "going with default: 4G"
size="4G"
fi
isok 0
@ -67,7 +79,7 @@ info "trying to mount ${device}"
isok $?
info "trying to mount root tmpfs"
/busybox mount -n -o size=4G -t tmpfs roottmpfs /roottmpfs
/busybox mount -n -o size=${size} -t tmpfs roottmpfs /roottmpfs
isok $?
info "checking if ${filename} exists"
@ -75,13 +87,7 @@ info "checking if ${filename} exists"
isok $?
info "unpacking; will take some time"
(
/busybox tar -C /roottmpfs -xJf /mnt/${filename}
isok $?
) &
# progress dots
echo ""
while [[ ! -z "$(jobs)" ]]; do echo -n .; jobs>/dev/null ; sleep 1; done
/pv /mnt/${filename} | /busybox tar -C /roottmpfs -xJf -
info "unmounting rootfs package location"
/busybox umount -n /mnt

BIN
pv Executable file

Binary file not shown.