当前位置: 首页 > news >正文

T113-S3-buildroot文件系统tar解压缩gz文件

目录

前言

一、现象描述

二、解决方案

三、tar解压缩.gz文件

总结


前言

        本文主要介绍全志T113-S3平台官方SDK,buildroot文件系统tar不支持.gz文件解压缩的问题以及如何配置buildroot文件系统解决该问题的方法介绍。

一、现象描述

        在buildroot文件系统中,使用tar -xzf UpdateShImage.tgz命令解压UpdateShImage.tgz压缩包报错,tar: invalid option -- 'z',如提示所示,表示tar不支持使用带z参数解压,如下所示:

# tar -xzf UpdateShImage.tgz
tar: invalid option -- 'z'
BusyBox v1.29.3 (2023-08-30 11:23:50 CST) multi-call binary.Usage: tar c|x|t [-hvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [--exclude PATTERN]... [FILE]...Create, extract, or list files from a tar filec       Createx       Extractt       List-f FILE Name of TARFILE ('-' for stdin/out)-C DIR  Change to DIR before operation-v      Verbose-O      Extract to stdout-o      Don't restore user:group-k      Don't replace existing files-h      Follow symlinks-T FILE File with names to include-X FILE File with glob patterns to exclude--exclude PATTERN       Glob pattern to exclude
#

二、解决方案

        进入buildroot编译输出目录,对busybox进行配置,如下步骤所示:

        1、进入buildroot编译输出目录:

cftc@cftc-ubuntu:t113-s3_V1.1-V2.1$ cd out/t113/evb1_auto/longan/buildroot/
cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$ pwd
/home/cftc/workspace/QZ/t113-s3_V1.1-V2.1/out/t113/evb1_auto/longan/buildroot
cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$

        2、终端输入busybox配置命令, make busybox-menuconfig,进入Archival Utilities  ---> 

[*] Make tar, rpm, modprobe etc understand .gz data ,按空格键选中 .gz data该项即可,如下图所示:

        3、busybox配置保存。输入make busybox-update-config即可保存配置文件,如下图所示:

cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$ make busybox-update-config
cp -f /home/cftc/workspace/QZ/t113-s3_V1.1-V2.1/out/t113/evb1_auto/longan/buildroot/build/busybox-1.29.3/.config package/busybox/busybox.config
cftc@cftc-ubuntu:buildroot$
cftc@cftc-ubuntu:buildroot$

三、tar解压缩.gz文件

        使用tar -czf / tar -xzf解压缩文件如下所示:

liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$ tar -czf UpdateShImage.tgz UpdateShImage/
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$ ls -l
total 10568
drwxr-xr-x 2 liubin liubin     4096 10月 23 16:14 UpdateShImage
-rw-rw-r-- 1 liubin liubin 10815835 10月 25 23:01 UpdateShImage.tgz
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$ rm -rf UpdateShImage
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$ tar -zxf UpdateShImage.tgz
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$ ls -l
total 10568
drwxr-xr-x 2 liubin liubin     4096 10月 23 16:14 UpdateShImage
-rw-rw-r-- 1 liubin liubin 10815835 10月 25 23:01 UpdateShImage.tgz
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$
liubin@CompileServer:~/workspace/UpdateShImage/RA1000$


总结

   修改之后的固件,tar会多出一个参数z (De)compress using gzip,tar zcvf 或tar cvf都可以压缩,执行tar xvf 或者tar zxvf 都可以解压,不要带z也可以解压缩,可能是config里面有CONFIG_FEATURE_TAR_AUTODETECT=y会自动检测。
 

http://www.lryc.cn/news/206052.html

相关文章:

  • 软件测试面试题:压测时,QPS一直上不去,如何排查?
  • 探索JavaScript ES6+新特性
  • Elasticsearch常见错误
  • mysql源码编译安装
  • On Moving Object Segmentation from Monocular Video with Transformers 论文阅读
  • [AutoSar NVM] 存储架构
  • ES10 新特性
  • 宝塔安装脚本
  • gulp打包vue3+jsx+less插件
  • 华为ICT——第四章深度学习和积卷神经
  • MongoDB 学习笔记(基础)
  • 【TGRS 2023】RingMo: A Remote Sensing Foundation ModelWith Masked Image Modeling
  • 性能测试 —— 生成html测试报告、参数化、jvm监控
  • 堆(二叉树,带图详解)
  • vue3 code format bug
  • 7-3、S曲线生成器【51单片机控制步进电机-TB6600系列】
  • CDC实时数据同步
  • javaEE -10(11000字详解5层重要协议)
  • 360智慧生活旗舰产品率先接入“360智脑”能力实现升级
  • 【系统架构设计】 架构核心知识: 2 云原生架构
  • Unity - 导出的FBX模型,无法将 vector4 保存在 uv 中(使用 Unity Mesh 保存即可)
  • 【疯狂Java】数组
  • leetcode 503. 下一个更大元素 II、42. 接雨水
  • 【德哥说库系列】-PostgreSQL跨版本升级
  • rust学习——智能指针
  • 系列一、Spring Framework
  • PULP Ubuntu18.04
  • Docker harbor私有仓库部与管理
  • 解决虚拟机联网问题
  • Unity 自定义小地图