Chapter 6 File System Customization

From project/image/configs/i2m/ As you can know, the minimum file system consists of
project/image/rootfs/rootfs.tar.gz and project/image/busybox/busybox-1.20.2-arm-linux-gnueabihf-glibc-8.2.1-dynamic.tar.gz

# vi project/image/configs/i2m/

BUSYBOX from project/configs/nvr/i2m/8.2.1/spinand.glibc.011a.64

.PHONY: rootfs root app
rootfs:root app
    cd rootfs; tar xf rootfs.tar.gz -C $(OUTPUTDIR)
    #tar xf busybox/$(BUSYBOX).tar.gz -C $(OUTPUTDIR)/rootfs
    tar xf $(LIB_DIR_PATH)/package/$(LIBC).tar.gz -C $(OUTPUTDIR)/rootfs/lib
    mkdir -p $(miservice$(RESOUCE))/lib
    cp $(LIB_DIR_PATH)/mi_libs/dynamic/* $(miservice$(RESOUCE))/lib/
    cp $(LIB_DIR_PATH)/ex_libs/dynamic/* $(miservice$(RESOUCE))/lib/

Therefore, we can customize the file system by customizing project/image/rootfs/rootfs.tar.gz and project/image/busybox/busybox-1.20.2-arm-linux-gnueabihf-glibc-8.2.1-dynamic.tar.gz.
In the second chapter, the compilation of builderroot is introduced. After compilation, generated output/images/rootfs.tar, execute the following command to repackage:

# mkdir output/images/rootfs
# tar -xvf output/images/rootfs.tar -C output/images/rootfs
# cd output/images/
# tar -cvf rootfs.tar.gz rootfs

Note:Please compress rootfs in the same level directory as rootfs, otherwise it will cause compilation error

  • Replace target file system
    # cp output/images/rootfs.tar.gz  ../project/image/rootfs/rootfs.tar.gz -f
  • Close busybox
    Since the file system compiled with builderroot already contains busybox, the original busybox is no longer needed.
    # vi project/image/configs/i2m/
  • compilation
    # ./ -f nand -p ssd201
文档更新时间: 2021-10-08 10:46   作者:Aeeditor