赞
踩
记录一下制作生产使用的SD卡过程,官方给的文档描述的不是很清楚。
- mkdir /mnt/rootfs
- mount /dev/mmcblk1p2 /mnt/rootfs
- mount /dev/sdb1 /mnt/udisk
- mkdir /mnt/udisk/rootfs
- wget http://112.124.9.243/cn-apt-source.sh
- chmod 755 cn-apt-source.sh
- ./cn-apt-source.sh
- apt-get update
- apt-get -y install rsync
rsync -aAXv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found","/swapfile"} /mnt/rootfs/* /mnt/udisk/rootfs
- git clone https://github.com/friendlyarm/sd-fuse_s5p4418.git
- cd sd-fuse_s5p4418
- mkdir friendlycore
- ./build-rootfs-img.sh /media/udisk/rootfs friendlycore
制作完文件系统后不着急打包成emmc-img,先制作内核,把自己的设备树和内核配置好。
下载官方镜像
- wget http://112.124.9.243/dvdfiles/S5P4418/images-for-eflasher/friendlycore-images.tgz
- tar xzf friendlycore-images.tgz
- wget http://112.124.9.243/dvdfiles/S5P4418/images-for-eflasher/emmc-flasher-images.tgz
- tar xzf emmc-flasher-images.tgz
此处我用的是自己之前编译的内核(把自己的Linux文件夹拷贝到out/kernel中)
- cd sd-fuse_s5p4418
- git clone https://github.com/friendlyarm/linux.git -b nanopi2-v4.4.y --depth 1 out/kernel-s5p4418
修改build-kernel.sh 将其中的make xxdeconfig make xx等屏蔽掉,因为之前已经编译好了。(在这一步之前可能需要再执行一次build-rootfs-img)
LOGO=/home/smart4418/Desktop/logo.bmp ./build-kernel.sh friendlycore
编译自己的镜像文件
sudo ./mk-emmc-image.sh friendlycore
使用dd命令烧录到一张新的sd卡中
dd if=out/s5p4418-eflasher-friendlycore-xenial-4.4-xxxx.img of=/dev/sdc bs=32M
4418打包顺序是:
./build-rootfs-img.sh /media/udisk/rootfs/ friendlycore
LOGO=/home/smart4418/Desktop/logo.bmp ./build-kernel.sh friendlycore
sudo ./mk-emmc-image.sh friendlycore
dd if=out/s5p4418-eflasher-friendlycore-xenial-4.4-xxxx.img of=/dev/sdc bs=32M
6818打包顺序是:
./build-rootfs-img.sh /media/udisk/rootfs/ friendlycore-arm64
LOGO=/home/easen/Desktop/logo.bmp ./build-kernel.sh friendlycore-arm64
./mk-emmc-image.sh friendlycore-arm64
- mv out/s5p6818-eflasher-friendlycore-xenial-4.4-arm64-yyyymmdd.img out/s5p6\
- 818-eflasher-friendlycore-xenial-4.4-arm64-AppName-Version.img
打包根文件目录的另一种方式,不需要设置是否为overlay filesystem。首先挂载好U盘到板子/mnt/rootfs/目录。切换到Root,命令如下:
- tar --warning=no-file-changed -cvpzf /mnt/rootfs/rootfs.tar.gz \
- --exclude=/rootfs.tar.gz \
- --exclude=/mnt/rootfs/rootfs.tar.gz \
- --exclude=/var/lib/docker/runtimes \
- --exclude=/etc/firstuser \
- --exclude=/etc/friendlyelec-release \
- --exclude=/usr/local/first_boot_flag \
- --one-file-system /
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。