• apt-get install 本地私有仓库创建


    此方案分三步实现,第一步准备deb升级包,第二步建立本地仓库,第三步客户端安装更新。

      1. 准备 deb 安装包.

    操作中需要升级内核、 U-Boot或者rootfs,事先准备好修改好的相关文件:如uboot.img trust.img boot.img rootfs.img 

    deb 是 Debian Linux 的软件包格式,首先创建 deb 工作目录,然后在 deb 目录中创建相应的目录和文件,我们需要更新firmware,则创建一个update-firmware的文件夹,然后在该文件夹下创建DEBIAN和user目录:

    mkdir deb

    cd deb

    mkdir update-firmware    # 创建 update-firmware 目录

    cd update -firmware

    mkdir DEBIAN    # 创建 DEBIAN 目录,这个目录是必须要有。

    mkdir -p user/share/{ kernel,uboot,rootfs#创建相关升级文件存放的目录

    mv ~/boot.img ~/deb/update-firmware/user/share/kernel  # 将相应文件放到相应的目录

    mv ~/uboot.img ~/deb/update-firmware/user/share/uboot

    mv ~/trust.img ~/deb/update-firmware/user/share/uboot

    mv ~/rootfs.img ~/deb/update-firmware/user/share/rootfs

    DEBIAN 目录下存放的文件是 deb 包安装的控制文件以及相应的脚本文件。打包最关键的是在 DEBIAN 目录下创建一个 control 文件 和脚本文件 postinst

    control 文件内容如下,用于记录软件标识,版本号,平台,依赖信息等数据。

    Package: update-firmware # 文件目录名

    Version: 4.0    # 版本号

    Architecture: arm64 # 架构

    Maintainer: neg   # 维护人员,自定义即可

    Installed-Size: 1

    Section: test

    Priority: optional

    Descriptionon: This is a update firmware

    postinst 文件内容如下,就是将需要更新的内核和 U-Boot 文件用 dd 命令写进对应分区的脚本:

    echo "-----------uboot updating------------"

    dd conv=fsync,notrunc if=/user/share/uboot/uboot.img of=/dev/disk/by-partlabel/uboot

    echo "-----------trust updating------------"

    dd conv=fsync,notrunc if=/user/share/uboot/trust.img of=/dev/disk/by-partlabel/trust

    echo "-----------kernel updating------------"

    dd conv=fsync,notrunc if=/user/share/kernel/boot.img of=/dev/disk/by-partlabel/boot

    说明:postinst 脚本,是在解包数据后运行的脚本。

  • 相关阅读:
    网站数据加密之Hook通用方案
    前端JS必用工具【js-tool-big-box】学习,检测浏览器当前切换状态
    Torch基础(二)
    springboot整合rabbitmq入门(三)
    剑指offer 47:礼物的最大价值
    C++设计模式----装饰器模式
    ModelCenter—多学科设计优化软件
    CSAPP 8.4 进程,shell
    贪心算法——单源最短路径(Dijkstra算法)
    SpringBoot笔记
  • 原文地址:https://blog.csdn.net/wgypaul/article/details/127554883