|
|
(68 intermediate revisions by 3 users not shown) |
Line 1: |
Line 1: |
| [[How to make your own SD-bootable ROM/zh|查看中文]] | | [[How to make your own SD-bootable ROM/zh|查看中文]] |
| | | |
− | ==Change the files in rootfs.img and boot.img== | + | ==Make Image Files for RK3399== |
− | <syntaxhighlight lang="bash">
| + | Refer to this repo: https://github.com/friendlyarm/sd-fuse_rk3399 |
− | apt install android-tools-fsutils
| + | |
− | simg2img rootfs.img r.img
| + | |
− | mount -t ext4 -o loop r.img /mnt
| + | |
− | … To Change Something …
| + | |
− | umount /mnt
| + | |
− | img2simg r.img rootfs.img
| + | |
− | </syntaxhighlight>
| + | |
| | | |
− | ==Make Linux Image Files for 4418/6818== | + | ==Make Image Files for S5P4418== |
− | The key point is to make the boot section in the SD card to a boot.img and the rootfs section in the SD card to a rootfs.img and replace the corresponding files in an eflasher. Run the following commands on a PC host:<br />
| + | Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p4418<br /> |
− | 1) Download https://github.com/friendlyarm/debian_nanopi2;<br />
| + | |
− | 2) Copy all the files in your SD card's boot section to "debian_nanopi2/boot" and all the files in your SD card's rootfs section to "debian_nanopi2/rootfs";<br />
| + | |
− | You can make changes in these two directories according to your requirements.<br />
| + | |
− | We suggest you remove the "etc/fs.resized" file under the rootfs directory to allow system's automatic file system extension.<br />
| + | |
− | 3) Make an img file with the make_ext4fs utility under "debian_nanopi2":
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | ./tools/make_ext4fs -s -l 67108864 -a root -L boot boot.img boot
| + | |
− | ./tools/make_ext4fs -s -l 3670016000 -a root -L rootfs rootfs.img rootfs
| + | |
− | </syntaxhighlight>
| + | |
− | one thing you should be aware of is that the size of the .img file needs to be larger than the rootfs directory size, <br />
| + | |
− | below are the image size values for each system we’ve provided:<br />
| + | |
− | lubuntu: 5368709120<br />
| + | |
− | debian: 3670016000<br />
| + | |
− | friendlycore: 3670016000<br />
| + | |
| <br /> | | <br /> |
− | 4) Copy the newly generated boot.img and rootfs.img to the "core-gte" directory of an eflasher's FAT section and replace the corresponding files. This eflasher will be ready for use<br />
| + | Example: <br /> |
− | | + | |
− | ==Make Linux Image Files for H3==
| + | |
− | If you have compiled a U-boot, Linux kernel and a file system, and want to make a your own Linux image (ROM) with these files you can refer to the following steps:<br>
| + | |
− | Download a package "rom-maker-lite.tar.gz" : [https://pan.baidu.com/s/1zTBw-TfOyQqkvB9b0YhVOg download link], extract it in host PC running Ubuntu and you will get the following two directories:
| + | |
| <syntaxhighlight lang="bash"> | | <syntaxhighlight lang="bash"> |
− | $ ls
| + | mkdir test |
− | bsp-prebuilt rom-maker-lite
| + | cd test |
| + | git clone https://github.com/friendlyarm/sd-fuse_s5p4418 |
| + | cd sd-fuse_s5p4418/ |
| + | tar xzf /mnt/dvd/S5P4418/images-for-eflasher/friendlycore-images.tgz |
| + | tar xzf /mnt/dvd/S5P4418/images-for-eflasher/emmc-flasher-images.tgz |
| + | tar xzf /mnt/dvd/S5P4418/rootfs/rootfs-friendlycore-20190718.tgz |
| + | sed "s/\${BOARD}/XXYYZZ/g" friendlycore/rootfs/etc/rc.local -i |
| + | ./build-rootfs-img.sh friendlycore/rootfs friendlycore/rootfs.img |
| + | ./mk-emmc-image.sh friendlycore |
| + | dd if=out/s5p4418-eflasher-friendlycore-20190730.img of=/dev/sdX bs=32M |
| </syntaxhighlight> | | </syntaxhighlight> |
− | The "bsp-prebuilt" directory has prebuilt BSP files such as U-boot, Linux kernel and etc.<br>
| |
− | The "rom-maker-lite" directory has some script utilities which can be used to make a ROM that boots from an SD card.
| |
| | | |
− | Copy all the files under the "bsp-prebuilt" directory to the "rom-maker-lite" directory:
| + | ==Make Image Files for S5P6818== |
− | <syntaxhighlight lang="bash">
| + | Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p6818 |
− | $ cd rom-maker-lite
| + | |
− | $ cp ../bsp-prebuilt/* ./ -r
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | Currently the script utilities under the "rom-maker-lite" directory can be only used to make Linux ROMs for H3/H5. You can check its usage by running the "./mkimage.sh" script:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh
| + | |
− | Usage:
| + | |
− | $ cp ../bsp-prebuilt/* ./ -r
| + | |
− | $ ./mkimage.sh <prepare type> <partmap> <misc dir> <partition1 dir> <partition2 dir>
| + | |
− | prepare type:
| + | |
− | p1: prepare misc(bootloader) + partition1.img(fat32 boot) + partition2.img(ext4 rootfs)
| + | |
− | p2: prepare misc(bootloader) + partition1.img(fat32 boot) + partition2.img(ext4 rootfs) + partition3.img(fat32 eflashed material)
| + | |
− | p3: prepare misc(bootloader) + partition1.img(ext4 boot) + partition2.img(ext4 rootfs)
| + | |
− | p4: prepare misc(andorid split img)
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | ::{| class="wikitable"
| + | |
− | |-
| + | |
− | |Parameter||Comment
| + | |
− | |-
| + | |
− | |<prepare type> || specifies a ROM type. For H3/H5 p1 means to make a FriendlyCore/Ubuntu/Debian ROM and p2 means to make an Eflasher ROM.
| + | |
− | |-
| + | |
− | |<partmap> || specifies a partmap that is needed for making a ROM. A partmap file specifies a ROM Image's partition and components. Different platforms or different BSPs for the same platform use different partmap files.
| + | |
− | |-
| + | |
− | |<misc dir> || specifies a bootloader's path for H3/H5.
| + | |
− | |-
| + | |
− | |<partition1 dir> || specifies the boot partition's path for H3/H5.
| + | |
− | |-
| + | |
− | |<partition2 dir> || specifies the rootfs's path for H3/H5.
| + | |
− | |-
| + | |
− | |}
| + | |
− | | + | |
− | <br>
| + | |
− | * <b>Make Uboot-2017 + Linux-4.14 ROM for H3</b>
| + | |
− | All FriendlyElec's H3 boards work with a Uboot-2017 + Linux-4.14 ROM. So the steps to generate a ROM based on a BSP are the same for all FriendlyElec boards.<br>
| + | |
− | If you have a bootable SD card with FriendlyCore the rootfs directory in the SD card should have all the files you need. Insert this SD card to a host PC, mount the SD card's rootfs directory (in our test it was mounted at /media/SD/rootfs) and make a ROM following the steps below:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p1 partmap/h3_linux-4.14/partmap.txt misc/uboot-2017_h3/ part1/boot_linux-4.14_h3/ /media/SD/rootfs
| + | |
− | </syntaxhighlight>:
| + | |
− | Replace the existing files under the directories (misc/uboot-2017_h3、part1/boot_linux-4.14_h3) with your new files. FriendlyElec will periodically update files. You can list all the files by commanding "tree":
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree misc/uboot-2017_h3/ part1/boot_linux-4.14_h3/
| + | |
− | misc/uboot-2017_h3/
| + | |
− | └── u-boot-sunxi-with-spl.bin
| + | |
− | part1/boot_linux-4.14_h3/
| + | |
− | ├── boot.cmd
| + | |
− | ├── boot.scr
| + | |
− | ├── rootfs.cpio.gz
| + | |
− | ├── sun8i-h2-plus-nanopi-duo.dtb
| + | |
− | ├── sun8i-h3-nanopi-duo2.dtb
| + | |
− | ├── sun8i-h3-nanopi-m1.dtb
| + | |
− | ├── sun8i-h3-nanopi-m1-plus.dtb
| + | |
− | ├── sun8i-h3-nanopi-neo-air.dtb
| + | |
− | ├── sun8i-h3-nanopi-neo-core.dtb
| + | |
− | ├── sun8i-h3-nanopi-neo.dtb
| + | |
− | └── zImage
| + | |
− | </syntaxhighlight>
| + | |
− | For all the FriendlyElec's H3 boards that works with Linux-4.14 BSP they use the same partmap file which is "partmap/h3_linux-4.14/partmap.txt".<br>
| + | |
− | After running the mkimage.sh script a "out/SD-bootable-p1" directory will be generated and it will have the following files:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree out/
| + | |
− | out/
| + | |
− | ├── SD-bootable-p1
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ └── u-boot-sunxi-with-spl.bin
| + | |
− | ├── SD-bootable-p1.img
| + | |
− | | + | |
− | </syntaxhighlight>
| + | |
− | The "part1/boot_linux-4.14_h3/" directory will be made to a boot.img, the "part2/rootfs_demo/" directory will be made to a rootfs.img and the SD-bootable-p1.img will be the new ROM.
| + | |
− | <!--
| + | |
− | 您可以通过如下命令迅速将其烧写到SD卡中以进行测试:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-p1/your_company/partmap.txt
| + | |
− | </syntaxhighlight>
| + | |
− | 注意: 请将/dev/sdX替换为实际的SD卡设备节点。
| + | |
− | -->
| + | |
− | You can use the win32diskimager utility under Windows or command "dd" under Linux to flash a SD-bootable-p1.img to an SD card.
| + | |
− | | + | |
− | <br>
| + | |
− | * <b>Make Uboot-2011 + Linux-3.4 ROM for H3</b>
| + | |
− | Let's take FriendlyElec's NanoPi M1 as an example, run the following command:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p1 partmap/h3_linux-3.4/partmap.txt misc/uboot-2011_m1/ part1/boot_linux-3.4_m1/ part2/rootfs_demo/
| + | |
− | </syntaxhighlight>
| + | |
− | Replace the existing files under the directories with your new files.<br>
| + | |
− | For all the FriendlyElec's H3 boards that works with Linux-3.4 BSP they use the same partmap file which is "partmap/h3_linux-3.4/partmap.txt".<br>
| + | |
− | So if you want to make a ROM for a NanoPi M1 Plus you can run the following command:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p1 partmap/h3_linux-3.4/partmap.txt misc/uboot-2011_m1-plus/ part1/boot_linux-3.4_m1-plus/ part2/rootfs_demo/
| + | |
− | </syntaxhighlight>
| + | |
− | This applies to the NanoPi NEO / NanoPi NEO Air too.
| + | |
− | | + | |
− | <br>
| + | |
− | * <b>Make Uboot-2017 + Linux-4.14 Eflasher ROM for H3</b>
| + | |
− | In order to make an Eflasher ROM you need to have an existing FriendlyCore ROM. A Uboot-2017 + Linux-4.14 FriendlyCore image has the following files:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree out/
| + | |
− | out/
| + | |
− | ├── SD-bootable-p1
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ └── u-boot-sunxi-with-spl.bin
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | If you have a bootable SD card with Eflasher, insert the SD card to a host PC, mount the SD card's rootfs directory(in our test it was mounted at the "/media/SD/rootfs-eflasher" directory) and run the following command to generate an Eflasher ROM:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p2 partmap/h3_eflasher-4.14/partmap.txt misc/uboot-2017_h3/ part1/boot_linux-4.14_h3/ /media/SD/rootfs-eflasher out/SD-bootable-p1/
| + | |
− | </syntaxhighlight>
| + | |
− | After running the mkimage.sh script an "out/SD-bootable-p2" directory will be generated and it will have the following files:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree out/
| + | |
− | out/
| + | |
− | ├── SD-bootable-p1
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ └── u-boot-sunxi-with-spl.bin
| + | |
− | ├── SD-bootable-p1.img
| + | |
− | ├── SD-bootable-p2
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── friendlyarm.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ └── u-boot-sunxi-with-spl.bin
| + | |
− | └── SD-bootable-p2.img
| + | |
− | </syntaxhighlight>
| + | |
− | The SD-bootable-p2.img file will be the newly generated Eflasher ROM. What OS the "out/SD-bootable-p1/" contains will be the OS in this Eflasher ROM.
| + | |
− | <!--
| + | |
− | 通过如下命令迅速将其烧写到SD卡中以进行测试:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-p2/your_company/partmap.txt
| + | |
− | </syntaxhighlight>
| + | |
− | 注意: 请将/dev/sdX替换为实际的SD卡设备节点。
| + | |
− | -->
| + | |
− | You can use the win32diskimager utility under Windows or command "dd" under Linux to flash a SD-bootable-p2.img to an SD card.
| + | |
− | | + | |
− | ==制作H5 平台的Linux ROM==
| + | |
− | 如果您定制了U-boot、Linux内核、文件系统,并且想基于自己定制的文件制作Linux系统映像文件 (以下简称为ROM文件),可以参考如下操作:<br>
| + | |
− | 下载压缩包rom-maker-lite.tar.gz: [https://pan.baidu.com/s/1zTBw-TfOyQqkvB9b0YhVOg 点击下载],然后在PC机 Ubuntu系统里解压得到如下2个目录:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ls
| + | |
− | bsp-prebuilt rom-maker-lite
| + | |
− | </syntaxhighlight>
| + | |
− | bsp-prebuilt目录里包含了预先编译好的BSP系统文件,例如U-boot / Linux内核等。<br>
| + | |
− | rom-maker-lite则包含了一些脚本工具,使用这些脚本工具可以制作出能从SD启动的ROM文件。
| + | |
− | | + | |
− | 解压完毕后,将bsp-prebuilt里的系统文件拷贝到rom-maker-lite中:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ cd rom-maker-lite
| + | |
− | $ cp ../bsp-prebuilt/* ./ -r
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | rom-maker-lite目前支持为 H3/H5 系列的开发板制作Linux平台的ROM文件,执行./mkimage.sh可以查看帮助信息:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh
| + | |
− | Usage:
| + | |
− | $ cp ../bsp-prebuilt/* ./ -r
| + | |
− | $ ./mkimage.sh <prepare type> <partmap> <misc dir> <partition1 dir> <partition2 dir>
| + | |
− | prepare type:
| + | |
− | p1: prepare misc(bootloader) + partition1.img(fat32 boot) + partition2.img(ext4 rootfs)
| + | |
− | p2: prepare misc(bootloader) + partition1.img(fat32 boot) + partition2.img(ext4 rootfs) + partition3.img(fat32 eflashed material)
| + | |
− | p3: prepare misc(bootloader) + partition1.img(ext4 boot) + partition2.img(ext4 rootfs)
| + | |
− | p4: prepare misc(andorid split img)
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | ::{| class="wikitable"
| + | |
− | |-
| + | |
− | |参数||说明
| + | |
− | |-
| + | |
− | |<prepare type> || 用于指定做ROM前的准备方式,对于H3/H5系列的开发板,p1表示FriendlyCore/Ubuntu/Debian系列的ROM,p2标志制作Eflasher系列的ROM。
| + | |
− | |-
| + | |
− | |<partmap> || 用于指定制作ROM时需要的partmap文件,partmap文件用于指定ROM Image的布局方式和组成文件,不同的板子或者是同一板子不同版本的BSP使用的partmap文件是不一样的。
| + | |
− | |-
| + | |
− | |<misc dir> || 对于H3/H5系列的开发板,用于指定bootloader所在的目录路径。
| + | |
− | |-
| + | |
− | |<partition1 dir> || 对于H3/H5系列的开发板,用于指定boot分区的目录路径。
| + | |
− | |-
| + | |
− | |<partition2 dir> || 对于H3/H5系列的开发板,用于指定rootfs分区的目录路径。
| + | |
− | |-
| + | |
− | |}
| + | |
− | | + | |
− | <br>
| + | |
− | * <b>为H5 系列的板子制作基于Uboot-2017 + Linux-4.14 的ROM</b>
| + | |
− | 所有H5 系列的板子是共用同一个基于Uboot-2017 + Linux-4.14 的ROM的,所以对于这个版本的BSP,所有H5 系列的板子的做ROM命令是一样的。假设您有一张已经烧写FriendlyCore系统的SD卡,该SD卡的rootfs目录下已经包含了你的产品应用程序,请将SD卡插入PC机中,然后挂载SD卡的rootfs分区(假设挂载路径为/media/SD/rootfs, 请注意使用真实路径),然后通过以下命令可以生成产品适用的ROM文件:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p1 partmap/h5_linux-4.14/partmap.txt misc/uboot-2017_h5/ part1/boot_linux-4.14_h5/ /media/SD/rootfs
| + | |
− | </syntaxhighlight>
| + | |
− | 请将对应目录(misc/uboot-2017_h5、part1/boot_linux-4.14_h5)下的文件替换为您自己的定制文件,当然您也可以使用目录里预编译好的系统文件,我们会不定期更新预编译好的系统文件,通过tree命令可查看有哪些可替换的系统文件,例如:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree misc/uboot-2017_h5/ part1/boot_linux-4.14_h5/
| + | |
− | misc/uboot-2017_h5/
| + | |
− | ├── sunxi-spl.bin
| + | |
− | └── u-boot.itb
| + | |
− | part1/boot_linux-4.14_h5/
| + | |
− | ├── boot.cmd
| + | |
− | ├── boot.scr
| + | |
− | ├── Image
| + | |
− | ├── overlays
| + | |
− | │ └── sun50i-h5-gpio-dvfs-overlay.dtb
| + | |
− | ├── rootfs.cpio.gz
| + | |
− | ├── sun50i-h5-nanopi-k1-plus.dtb
| + | |
− | ├── sun50i-h5-nanopi-neo2.dtb
| + | |
− | ├── sun50i-h5-nanopi-neo-core2.dtb
| + | |
− | └── sun50i-h5-nanopi-neo-plus2.dtb
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | 对于所有使用Linux-4.14 BSP的H5板子,使用的都是同一个partmap文件partmap/h5_linux-4.14/partmap.txt。<br>
| + | |
− | mkimage.sh执行成功后,会生成一个out/SD-bootable-p1目录,其内容如下:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree out/
| + | |
− | out/
| + | |
− | ├── SD-bootable-p1
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ ├── sunxi-spl.bin
| + | |
− | │ └── u-boot.itb
| + | |
− | ├── SD-bootable-p1.img
| + | |
− | | + | |
− | </syntaxhighlight>
| + | |
− | part1/boot_linux-4.14_h5/目录被制作成了boot.img,part2/rootfs_demo/被制作成了rootfs.img,而SD-bootable-p1.img则为最终的ROM文件。
| + | |
− | <!--
| + | |
− | 您可以通过如下命令迅速将其烧写到SD卡中以进行测试:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-p1/your_company/partmap.txt
| + | |
− | </syntaxhighlight>
| + | |
− | 注意: 请将/dev/sdX替换为实际的SD卡设备节点。
| + | |
− | -->
| + | |
− | 你可以用win32diskimager或者dd命令将SD-bootable-p2.img烧写到SD卡中。
| + | |
− | | + | |
− | <br>
| + | |
− | * <b>为H5 系列的板子制作基于Uboot-2014 + Linux-3.10 的ROM </b>
| + | |
− | 以NanoPi NEO2为例,执行命令:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p1 partmap/h5_linux-3.10/partmap.txt misc/uboot-2014_neo2/ part1/boot_linux-3.10_neo2/ part2/rootfs_demo/
| + | |
− | </syntaxhighlight>
| + | |
− | 请将对应目录下的文件替换为您自己的定制文件。<br>
| + | |
− | 对于所有使用Linux-3.10 BSP的H5板子,使用的都是同一个partmap文件partmap/h5_linux-3.10/partmap.txt。<br>
| + | |
− | | + | |
− | <br>
| + | |
− | * <b>为H5 系列的板子制作基于Uboot-2017 + Linux-4.14 的Eflasher ROM</b>
| + | |
− | 制作Eflasher ROM的前提条件是已经成功制作出了FriendlyCore系列的ROM,即已经有待烧写到eMMC的原材料文件,例如基于Uboot-2017 + Linux-4.14的FriendlyCore系统::
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree out/
| + | |
− | out/
| + | |
− | ├── SD-bootable-p1
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ ├── sunxi-spl.bin
| + | |
− | │ └── u-boot.itb
| + | |
− | </syntaxhighlight>
| + | |
− | | + | |
− | 假设您有一张已经烧写Eflasher系统的SD卡,请将SD卡插入PC机中,然后挂载SD卡的rootfs分区(假设挂载路径为/media/SD/rootfs-eflasher, 请注意使用真实路径),然后通过以下命令就可以生成Eflasher ROM:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./mkimage.sh p2 partmap/h5_eflasher-4.14/partmap.txt misc/uboot-2017_h5/ part1/boot_linux-4.14_h5/ /media/SD/rootfs-eflasher out/SD-bootable-p1/
| + | |
− | </syntaxhighlight>
| + | |
− | mkimage.sh执行成功后,会生成一个out/SD-bootable-p2目录,其内容如下:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ tree out/
| + | |
− | out/
| + | |
− | ├── SD-bootable-p1
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ ├── sunxi-spl.bin
| + | |
− | │ └── u-boot.itb
| + | |
− | ├── SD-bootable-p1.img
| + | |
− | ├── SD-bootable-p2
| + | |
− | │ └── your_company
| + | |
− | │ ├── boot.img
| + | |
− | │ ├── friendlyarm.img
| + | |
− | │ ├── info.conf
| + | |
− | │ ├── partmap.txt
| + | |
− | │ ├── rootfs.img
| + | |
− | │ ├── sunxi-spl.bin
| + | |
− | │ └── u-boot.itb
| + | |
− | └── SD-bootable-p2.img
| + | |
− | </syntaxhighlight>
| + | |
− | SD-bootable-p2.img为最终的Eflasher ROM文件,该Eflasher ROM能烧写什么系统到eMMC完全取决于out/SD-bootable-p1/里包含了什么系统文件。
| + | |
− | <!--
| + | |
− | 通过如下命令迅速将其烧写到SD卡中以进行测试:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-p2/your_company/partmap.txt
| + | |
− | </syntaxhighlight>
| + | |
− | 注意: 请将/dev/sdX替换为实际的SD卡设备节点。
| + | |
− | -->
| + | |
− | 你可以用win32diskimager或者dd命令将SD-bootable-p2.img烧写到SD卡中。
| + | |
− | | + | |
− | | + | |
− | | + | |
− | | + | |
− | | + | |
− | | + | |
− | | + | |
− | | + | |
− | <!---
| + | |
− | ==Make Linux Image Files for H3/H5==
| + | |
− | The key point is to make the boot section in the SD card to a boot.img and the rootfs section in the SD card to a rootfs.img and replace the corresponding files in an eflasher. Run the following commands on a PC host:<br/>
| + | |
− | 1) Download utilities: [http://wiki.friendlyarm.com/wiki/index.php/File:Eflasher-build-tools.zip EFlasher-build-tools];<br />
| + | |
− | 2) Make an ext4 formatted img file with the rootfs section:<br />
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ cd /SD
| + | |
− | $ ./make_ext4fs -s -l 2097152000 -a root -L rootfs rootfs.img ./rootfs
| + | |
− | </syntaxhighlight>
| + | |
− | -l specifies the size of an img file and the unit is Byte, 2097152000 Byte=2000MB. The specified size must be bigger than the actual size of a source directory.<br />
| + | |
− | 3) Make a fat formatted img file with the boot section:<br />
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | $ ./build-boot-fat.sh boot.img /SD/boot 40
| + | |
− | </syntaxhighlight>
| + | |
− | 40 specifies the size of a boot.img to be 40M.<br />
| + | |
− | 4) Copy the newly generated boot.img and rootfs.img to an eflasher's FAT section and replace the corresponding files. This eflasher will be ready for use.<br />
| + | |
− | --->
| + | |
− | | + | |
− | ==Make Installation TF Card with Custom Image File==
| + | |
− | Quite often a user makes changes in his own system and wants to use this system for mass production. In this case a user needs to make an image based on his own system. For an Android system an image contains a boot.img and a system.img. For a Ubuntu system an image contains a rootfs.img.<br />
| + | |
− | This section lists instructions for users to make a custom image which can be used to make an installation SD card for mass production.<br/>
| + | |
− | Here are the steps to make an Android image for S5P4418:<br />
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | git clone https://github.com/friendlyarm/sd-fuse_nanopi2.git
| + | |
− | cd sd-fuse_nanopi2
| + | |
− | wget http://112.124.9.243/dvdfiles/S5P4418/images-for-eflasher/android-lollipop-images.tgz
| + | |
− | tar xvzf android-lollipop-images.tgz
| + | |
− | </syntaxhighlight>
| + | |
− | Note: for an S5P6818 SoC you can just change "sd-fuse_nanopi2.git" to "sd-fuse_nanopi3.git" and "S5P4418" to "S5P6818".<br />
| + | |
− | Replace the corresponding files under the "Android" directory with your newly generated files and make an installation SD card by running the following commands:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | sudo ./fusing.sh /dev/sde android
| + | |
− | </syntaxhighlight>
| + | |
− | Note: you need to replace the "/dev/sde" with the actual device name of your SD card in the system<br />
| + | |
− | <br />
| + | |
− | Run this command to make a complete image file:
| + | |
− | <syntaxhighlight lang="bash">
| + | |
− | sudo ./mkimage.sh android
| + | |
− | </syntaxhighlight>
| + | |
| | | |
− | ==Update Log== | + | ==Make Image Files for H3== |
− | ===Sep-14-2017===
| + | Refer to this repo: https://github.com/friendlyarm/sd-fuse_h3 |
− | * Released English Version
| + | |
| | | |
− | ===Jan-30-2018=== | + | ==Make Image File for H5== |
− | * Updated Section 3
| + | Refer to this repo: https://github.com/friendlyarm/sd-fuse_h5 |