summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert "ar" Gerus <ar@bash.org.pl>2013-04-30 04:02:30 +0200
committerRobert "ar" Gerus <ar@bash.org.pl>2013-04-30 04:02:30 +0200
commitb41afe0687fe845e10450518f3bfdbb25ea76ae1 (patch)
tree1d972de1a803649e9482b60c3133a84d3ee98acb
parent73cf5d50274680af24e037a3a04256da06684bd3 (diff)
downloadtar-xz-loading-initramfs-b41afe0687fe845e10450518f3bfdbb25ea76ae1.tar.gz
tar-xz-loading-initramfs-b41afe0687fe845e10450518f3bfdbb25ea76ae1.tar.bz2
tar-xz-loading-initramfs-b41afe0687fe845e10450518f3bfdbb25ea76ae1.tar.xz
tar-xz-loading-initramfs-b41afe0687fe845e10450518f3bfdbb25ea76ae1.zip
v0.3 - Now with extra progressbar!
-rwxr-xr-xinit30
-rwxr-xr-xpvbin0 -> 863944 bytes
2 files changed, 18 insertions, 12 deletions
diff --git a/init b/init
index 4f8703b..e5dfccd 100755
--- a/init
+++ b/init
@@ -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
diff --git a/pv b/pv
new file mode 100755
index 0000000..1e6c901
--- /dev/null
+++ b/pv
Binary files differ