Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    一键生成可定制的Debian rootfs,支持D1/D1s riscv64(转载)

    D1系列-RISC-V
    debian rootfs
    1
    1
    309
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • whycan
      whycan晕哥 LV 9 last edited by whycan

      之前已经有一个使用debootstrap生成Debian rootfs的教程了,但我一直使用的是一个Github上的自动生成脚本来生成,优势主要是:

      更方便,跑一个脚本生成直接可用的rootfs,无需更多设置

      包括版本和预装包都完全可定制

      生成的rootfs可以直接chroot进去,所需的依赖自动安装

      最近给D1s定制rootfs,为了支持riscv64,我对原作者的脚本进行了一定的魔改,在此分享一下使用方法:

      首先clone仓库到本地:

      git clone https://github.com/SdtElectronics/debian-rootfs.git
      

      然后安装相关依赖

      apt-get install multistrap binfmt-support qemu-user-static
      

      最后运行一条命令即可生成:

      ./make-rootfs.sh ARCHITECTURE
      

      支持的ARCHITECTURE有:

      amd64
      arm64
      armel
      armhf
      i386
      mips
      mipsel
      powerpc
      powerpcspe
      ppc64el
      s390x
      riscv64
      

      注意要是想生成riscv64的rootfs,需要改用如下命令(因为risc-v目前还在Debian port源下):

      sudo ./make-rootfs.sh riscv64 multistrap_debian-ports.conf
      

      生成的rootfs在build/目录下。

      若脚本运行时出现类似错误信息:

      The following signatures couldn't be verified because the public key is not available
      

      需要手动给multistrap的文件打上这个补丁。

      更多信息,可以参考原仓库:

      https://github.com/SdtElectronics/debian-rootfs
      

      一些进阶用法:
      更改预装包:
      修改multistrap.conf中的packages字段即可。注意要生成riscv64的rootfs,需要修改的是multistrap_debian-ports.conf。
      更改版本:
      修改multistrap.conf中的suite字段即可。合法的值可以是版本名,或者是stable, testing和sid。注意要生成riscv64的rootfs,需要修改的是multistrap_debian-ports.conf。
      异构chroot:
      异构chroot所需的qemu等依赖,脚本都已经自动装好,直接chroot ./ 即可。

      原作者: @SdtEE
      链接: https://whycan.com/t_7367.html#p70238

      1 Reply Last reply Reply Quote Share 1
      • 1 / 1
      • First post
        Last post

      Copyright © 2022 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

      行为准则 | 用户协议 | 隐私权政策