diff options
author | Robert "ar" Gerus <ar@bash.org.pl> | 2013-04-30 04:02:30 +0200 |
---|---|---|
committer | Robert "ar" Gerus <ar@bash.org.pl> | 2013-04-30 04:02:30 +0200 |
commit | b41afe0687fe845e10450518f3bfdbb25ea76ae1 (patch) | |
tree | 1d972de1a803649e9482b60c3133a84d3ee98acb | |
parent | 73cf5d50274680af24e037a3a04256da06684bd3 (diff) | |
download | tar-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-x | init | 30 | ||||
-rwxr-xr-x | pv | bin | 0 -> 863944 bytes |
2 files changed, 18 insertions, 12 deletions
@@ -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 Binary files differ |