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

  • 1
  • Question
  • Updated 5 months ago
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?
Photo of song yang

song yang

  • 110 Points 100 badge 2x thumb

Posted 5 months ago

  • 1
Photo of Scott Emery

Scott Emery, Official Rep

  • 950 Points 500 badge 2x thumb
To "untar" a tar file you need to use the -f option to specify the tar file name. Like this:
tar -xvf sysroot.tar
Photo of Curt Brune

Curt Brune, Employee

  • 240 Points 100 badge 2x thumb
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.