Skip to content

Commit 8385fb4

Browse files
committed
Added support for rootfs without compression
1 parent 1defd86 commit 8385fb4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

cli.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
################################################################################
88

9-
VERSION="2.3.0"
9+
VERSION="2.4.0"
1010

1111
################################################################################
1212
# Common
@@ -815,6 +815,17 @@ rootfs_import()
815815
container_mounted || container_mount root || return 1
816816
817817
case "${rootfs_file}" in
818+
*tar)
819+
msg -n "Importing rootfs from tar archive ... "
820+
if [ -e "${rootfs_file}" ]; then
821+
tar xf "${rootfs_file}" -C "${CHROOT_DIR}"
822+
elif [ -z "${rootfs_file##http*}" ]; then
823+
wget -q -O - "${rootfs_file}" | tar x -C "${CHROOT_DIR}"
824+
else
825+
msg "fail"; return 1
826+
fi
827+
is_ok "fail" "done" || return 1
828+
;;
818829
*gz)
819830
msg -n "Importing rootfs from tar.gz archive ... "
820831
if [ -e "${rootfs_file}" ]; then
@@ -849,7 +860,7 @@ rootfs_import()
849860
is_ok "fail" "done" || return 1
850861
;;
851862
*)
852-
msg "Incorrect filename, supported only gz, bz2 or xz archives."
863+
msg "Incorrect filename, supported only tar, tar.gz, tar.bz2 or tar.xz archives."
853864
return 1
854865
;;
855866
esac

0 commit comments

Comments
 (0)