how can i extract the sysroot.tar inside cumulus-linux-3.4.0-vx-amd64.bin?


After extract the "cumulus-linux-3.4.0-vx-amd64.bin"

#./cumulus-linux-3.4.0-vx-amd64.bin extract ./

I found a "sysroot.tar" was extracted out.

# ll
total 451560
-rw-r--r-- 1 4000 4000 299 Aug 23 16:02 control
-rwxr-xr-x 1 root root 154151382 Aug 24 18:27 cumulus-linux-3.4.0-vx-amd64.bin
-rwxr-xr-x 1 root root 154161622 Sep 10 23:04 cumulus-linux-3.4.1-vx-amd64.bin
drwxr-xr-x 5 4000 4000 80 Aug 11 11:18 embedded-installer
-rw-r--r-- 1 4000 4000 12671560 Aug 23 16:02 initrd
-rw-r--r-- 1 4000 4000 4141184 Aug 23 16:02 kernel
-rw-r--r-- 1 4000 4000 137256476 Aug 23 16:02 sysroot.tar

it seems "sysroot.tar" is a xz compressed file
# file ./sysroot.tar./sysroot.tar: XZ compressed data

"tar -x --xz ./sysroot.tar" hang without any message.

I also tried to "xz -d ./sysroot.tar", but failed with
# mv ./sysroot.tar ./sysroot.tar.xz
# xz -d ./sysroot.tar.xz
xz: ./sysroot.tar.xz: Unexpected end of input

any idea?

2 replies

Userlevel 3
To "untar" a tar file you need to use the -f option to specify the tar file name. Like this:
tar -xvf sysroot.tar
Userlevel 1
Despite what the file extension says, the sysroot.tar file is not a tar archive.

It is an XZ compressed btrfs file system image with an 8 byte header appended.

You can uncompress the image like this:

head -c -8 sysroot.tar | xz -d -c > sysroot.img

Next loop back mount system.img, then mount the loopback device as a btrfs file system.

Reply