linux内核压缩包解压方法,Squashfs文件解压缩及”xz compression”报错问题解决

本文介绍了如何解压使用XZ压缩算法的Squashfs文件。当遇到“Filesystem uses xz compression, this is unsupported by this version”的错误时,需要更新或编译带有XZ支持的unsquashfs工具。通过下载最新版本的squashfs源码,启用XZ_SUPPORT选项并重新编译,可以成功解压缩XZ压缩的Squashfs镜像。" 50658624,3747283,DirectX 11 学习:创建基本窗口与环境初始化,['directx'],"['DirectX 11', '初始化', '渲染', '窗口', 'ID3D11Device', 'ID3D11DeviceContext', 'IDXGISwapChain', '渲染目标', '视口', '资源清理']

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、普通squashfs文件解压缩及查看

(1) 可使用unsuqashfs命令直接解压缩。

[root@localhost squashfs]# unsquashfs squashfs.img

(2)也可mount到临时目录

[root@localhost squashfs]# mount -o loop squashfs.img -t squashfs temp/

2、XZ算法压缩后的squashfs.img解压缩与查看

下载Fedora 15 Live CD后,尝试解压缩ISO中的squashfs.img文件,发现无法mount,也无法通过unsquashfs命令解压缩。提示“Filesystem uses xz compression, this is unsupported by this version”。但下载到的最新squashfs 4.2版本,提示XZ压缩算法的。

[root@localhost ~]# mount -o loop /boot/Fedora-15-x86_64-Live-Desktop.iso /mnt/

[root@localhost ~]# ls /mnt/

EFI  GPL  isolinux  LiveOS

[root@localhost ~]# cd /mnt/LiveOS/

[root@localhost LiveOS]# ls

livecd-iso-to-disk  osmin.img  squashfs.img

[root@localhost squashfs]# file squashfs.img

squashfs.img: Squashfs filesystem, little endian, version 4.0, 578519788 bytes, 3 inodes, blocksize: 131072 bytes, created: Fri May 13 15:49:05 2011

[root@localhost squashfs]# mount -o loop squashfs.img -t squashfs temp/

mount: wrong fs type, bad option, bad superblock on /dev/loop1,

missing codepage or helper program, or other error

In some cases useful info is found in syslog – try

dmesg | tail  or so

[root@localhost squashfs]#

[root@localhost squashfs]# unsquashfs squashfs.img

Filesystem uses xz compression, this is unsupported by this version

Decompressors available:

gzip

下载最新的squashfs工具,发现Makefile有个选项,“#XZ_SUPPORT = 1”,选择打开XZ_SUPPORT=1,保存退出。重新编译后,就可以解压缩使用XZ算法压缩的squashfs.img文件了。

http://sourceforge.net/projects/squashfs/files/

[root@localhost squashfs]#

########### Building XZ support #############

#

# LZMA2 compression.

#

# XZ Utils liblzma (http://tukaani.org/xz/) is supported

#

# To build using XZ Utils liblzma – install the library and uncomment

# the XZ_SUPPORT line below.

#

#XZ_SUPPORT = 1

[root@localhost squashfs-tools]# make clean && make && make install

[root@localhost squashfs]#

[root@localhost squashfs]# unsquashfs squashfs.img

Parallel unsquashfs: Using 16 processors

1 inodes (32768 blocks) to write

[= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = /] 32768/32768 100%

created 1 files

created 2 directories

created 0 symlinks

created 0 devices

created 0 fifos

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值