Difference between revisions of "How to make your own SD-bootable ROM"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
 
(25 intermediate revisions by 3 users not shown)
Line 5: Line 5:
  
 
==Make Image Files for S5P4418==
 
==Make Image Files for S5P4418==
Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p4418
+
Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p4418<br />
 +
<br />
 +
Example:  <br />
 +
<syntaxhighlight lang="bash">
 +
mkdir test
 +
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>
  
 
==Make Image Files for S5P6818==
 
==Make Image Files for S5P6818==
Line 11: Line 26:
  
 
==Make Image Files for H3==
 
==Make Image Files for H3==
{{ROM-Maker-lite_Introduce |h3}}
+
Refer to this repo: https://github.com/friendlyarm/sd-fuse_h3
 
+
* <b>Make an SD card bootable image based on Uboot-2017 + Linux-4.14 for H3, e.g. FriendlyCore/Debian/OpenWrt...</b>
+
FriendlyElec's BSP based on Uboot-2017 + Linux-4.14 applies to all FriendlyElec's H3 boards. Therefore the steps to make an image for all H3 boards are the same.
+
Here are the steps to make an SD card image of FriendlyCore. The steps to make an SD card image of Debian or OpenWrt are similar.<br><br>
+
Suppose you already have an SD card with a FriendlyCore system. The SD card has applications and configuration files in the "rootfs" directory. Insert this card to a host PC and mount its rootfs directory(in our test the directory was "rom-maker-lite/part2/h3/4.14/friendlycore/rootfs/"). Run the following command to generate an image file.:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 1 -m partmap/h3_linux-4.14/partmap.txt -d "misc/uboot-2017_h3/;part1/boot_linux-4.14_h3/;part2/h3/4.14/friendlycore/rootfs/"
+
</syntaxhighlight>
+
You can replace the files under the "misc/uboot-2017_h3" and "part1/boot_linux-4.14_h3" directories with your wanted files too. FriendlyElec will release the latest files when necessary. You can command "tree" to check all the available files:
+
<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 FriendlyElec's H3 based boards that support Linux-4.14 BSP they use the same partmap file "partmap/h3_linux-4.14/partmap.txt".<br>
+
After mkimage.sh is executed successfully an "out/SD-bootable-1" directory and the following files will be generated:
+
<syntaxhighlight lang="bash">
+
$ tree out/
+
out/
+
├── SD-bootable-1
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      └── u-boot-sunxi-with-spl.bin
+
├── SD-bootable-1.img
+
 
+
</syntaxhighlight>
+
The "part1/boot_linux-4.14_h3/" directory will be converted to a boot.img. The "part2/h3/4.14/friendlycore/rootfs/" will be converted to a rootfs.img. The SD-bootable-1.img will be an SD card ROM image. For example FriendlyElec's nanopi-[h3]_sd_friendlycore-xenial_4.14_armhf_YYYYMMDD.img.zip image file is an SD card ROM image. You can use the win32diskimager utility or the "dd" command to flash the SD-bootable-1.img to an SD card.
+
<!--
+
另外,你可以通过如下命令快速地将系统烧写到SD卡中以进行测试:
+
<syntaxhighlight lang="bash">
+
$ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-1/your_company/partmap.txt
+
</syntaxhighlight>
+
注意: 请将/dev/sdX替换为实际的SD卡设备节点。
+
-->
+
 
+
<br>
+
* <b>Make an SD card bootable image based on Uboot-2011 + Linux-3.4 for H3, e.g. FriendlyCore/Debian/OpenWrt...</b>
+
The basic steps to make an image for all FriendlyElec's H3 based boards are very similar. We take the NanoPi M1 as an example to show how to make an SD card FriendlyCore image. The steps apply to Debian and OpenWrt too.<br><br>
+
Run the following command:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 1 -m partmap/h3_linux-3.4/partmap.txt -d "misc/uboot-2011_m1/;part1/boot_linux-3.4_m1/;part2/m1/3.4/friendlycore/rootfs"
+
</syntaxhighlight>
+
The SD-bootable-1.img will be an SD card ROM image. For example FriendlyElec's nanopi-m1_sd_friendlycore-xenial_3.4_armhf_YYYYMMDD.img.zip image file is an SD card ROM image.You can replace the corresponding files with your wanted files.For all FriendlyElec's H3 based boards that support Linux-3.4 BSP they use the same partmap file "partmap/h3_linux-3.4/partmap.txt".<br>
+
To make an SD card image for the NanoPi M1 Plus you can run the following command:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 1 -m partmap/h3_linux-3.4/partmap.txt -d "misc/uboot-2011_m1-plus/;part1/boot_linux-3.4_m1-plus/;part2/m1-plus/3.4/friendlycore/rootfs"
+
</syntaxhighlight>
+
The SD-bootable-1.img will be an SD card ROM image. For example FriendlyElec's nanopi-m1-plus_sd_friendlycore-xenial_3.4_armhf_YYYYMMDD.img.zip image file is an SD card ROM image.This applies to the NanoPi NEO and the NanoPi NEO Air.
+
 
+
<br>
+
* <b>Make an eflasher image based on Uboot-2017 + Linux-4.14 for H3 based boards</b>
+
To make an eflasher ROM image you need to have an SD card image ready.We take a FriendlyCore system based on Uboot-2017 + Linux-4.14 as an example:
+
<syntaxhighlight lang="bash">
+
$ tree out/
+
out/
+
├── SD-bootable-1
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      └── u-boot-sunxi-with-spl.bin
+
</syntaxhighlight>
+
 
+
If you have an SD card with an eflasher image insert this card to a host PC, mount its rootfs directory(in our test the directory was "part2/h3/4.14/eflasher/rootfs") and run the following command to generate an eflasher ROM image:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 2 -m partmap/h3_eflasher-4.14/partmap.txt -d "misc/uboot-2017_h3/;part1/boot_linux-4.14_h3/;part2/h3/4.14/eflasher/rootfs;out/SD-bootable-1/"
+
</syntaxhighlight>
+
After mkimage.sh is executed an "out/SD-bootable-2" directory and the following files will be generated:
+
<syntaxhighlight lang="bash">
+
$ tree out/
+
out/
+
├── SD-bootable-1
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      └── u-boot-sunxi-with-spl.bin
+
├── SD-bootable-1.img
+
├── SD-bootable-2
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── friendlyarm.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      └── u-boot-sunxi-with-spl.bin
+
└── SD-bootable-2.img
+
</syntaxhighlight>
+
The SD-bootable-2.img will be an eflasher image. For example FriendlyElec's nanopi-[h3]_eflasher_friendlycore-xenial_4.14_armhf_YYYYMMDD.img.zip image file is an SD card ROM image.The image contained in the "out/SD-bootable-1/" directory will be the image to be flashed to eMMC. You can use the win32diskimager utility or the "dd" command to flash the SD-bootable-2.img image to an SD card.
+
<!--
+
另外,通过如下命令快速地将eflasher系统烧写到SD卡中以进行测试:
+
<syntaxhighlight lang="bash">
+
$ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-2/your_company/partmap.txt
+
</syntaxhighlight>
+
注意: 请将/dev/sdX替换为实际的SD卡设备节点。
+
-->
+
 
+
==Make Image Files for H5==
+
{{ROM-Maker-lite_Introduce |h5}}
+
* <b>Make an SD card bootable image based on Uboot-2017 + Linux-4.14 for H5, e.g. FriendlyCore/Debian/OpenWrt...</b>
+
The basic steps to make an image for all FriendlyElec's H5 based boards are very similar. We show how to make an SD card FriendlyCore image. The steps apply to Debian and OpenWrt too.<br><br>
+
Suppose you already have an SD card with a FriendlyCore system. The SD card has applications and configuration files in the "rootfs" directory. Insert this card to a host PC and mount its rootfs directory(in our test the directory was "/part2/h5/4.14/friendlycore/rootfs/"). Run the following command to generate an image file:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 1 -m partmap/h5_linux-4.14/partmap.txt -d "misc/uboot-2017_h5/;part1/boot_linux-4.14_h5/;part2/h5/4.14/friendlycore/rootfs/"
+
</syntaxhighlight>
+
You can replace the files under the "misc/uboot-2017_h5" and "part1/boot_linux-4.14_h5" directories with your wanted files too. FriendlyElec will release the latest files when necessary. You can command "tree" to check all the available files:
+
<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>
+
 
+
For all FriendlyElec's H5 based boards that support Linux-4.14 BSP they use the same partmap file "partmap/h5_linux-4.14/partmap.txt".<br>
+
After mkimage.sh is executed successfully an "out/SD-bootable-1" directory and the following files will be generated:
+
<syntaxhighlight lang="bash">
+
$ tree out/
+
out/
+
├── SD-bootable-1
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      ├── sunxi-spl.bin
+
│      └── u-boot.itb
+
├── SD-bootable-1.img
+
 
+
</syntaxhighlight>
+
The "part1/boot_linux-4.14_h5/" directory will be converted to a boot.img. The "part2/h5/4.14/friendlycore/rootfs/" will be converted to a rootfs.img. The SD-bootable-1.img will be an SD card ROM image. For example FriendlyElec's nanopi-[h5]_sd_friendlycore-xenial_4.14_arm64_YYYYMMDD.img.zip image file is an SD card ROM image. You can use the win32diskimager utility or the "dd" command to flash the SD-bootable-1.img to an SD card.
+
<!--
+
另外,你可以通过如下命令快速地将系统烧写到SD卡中以进行测试:
+
<syntaxhighlight lang="bash">
+
$ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-1/your_company/partmap.txt
+
</syntaxhighlight>
+
注意: 请将/dev/sdX替换为实际的SD卡设备节点。
+
-->
+
 
+
<br>
+
* <b>Make an SD card bootable image based on Uboot-2014 + Linux-3.10 for H5, e.g. FriendlyCore/Debian/OpenWrt...</b>
+
The basic steps to make an image for all FriendlyElec's H5 based boards are very similar. We take the NanoPi NEO2 as an example to show how to make an SD card FriendlyCore image. The steps apply to Debian and OpenWrt too.<br><br>
+
Run the following command:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 1 -m partmap/h5_linux-3.10/partmap.txt -d "misc/uboot-2014_neo2/;part1/boot_linux-3.10_neo2/;part2/neo2/3.10/friendlycore/rootfs"
+
</syntaxhighlight>
+
The SD-bootable-1.img will be an SD card ROM image. For example FriendlyElec's nanopi-neo2_sd_friendlycore-xenial_3.10_arm64_YYYYMMDD.img.zip image file is an SD card ROM image.You can replace the corresponding files with your wanted files.For all FriendlyElec's H5 based boards that support Linux-3.10 BSP they use the same partmap file "partmap/h5_linux-3.10/partmap.txt".<br>
+
To make an SD card image for the NanoPi NEO Plus2 you can run the following command:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 1 -m partmap/h5_linux-3.10/partmap.txt -d "misc/uboot-2014_neo-plus2/;part1/boot_linux-3.10_neo-plus2/;part2/neo-plus2/3.10/friendlycore/rootfs"
+
</syntaxhighlight>
+
The SD-bootable-1.img will be an SD card ROM image. For example FriendlyElec's nanopi-neo-plus2_sd_friendlycore-xenial_3.10_arm64_YYYYMMDD.img.zip image file is an SD card ROM image.
+
 
+
<br>
+
* <b>Make an eflasher image based on Uboot-2017 + Linux-4.14 for H5 based boards</b>
+
To make an eflasher ROM image you need to have an SD card image ready.We take a FriendlyCore system based on Uboot-2017 + Linux-4.14 as an example:
+
<syntaxhighlight lang="bash">
+
$ tree out/
+
out/
+
├── SD-bootable-1
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      ├── sunxi-spl.bin
+
│      └── u-boot.itb
+
</syntaxhighlight>
+
 
+
If you have an SD card with an eflasher image insert this card to a host PC, mount its rootfs directory(in our test the directory was "part2/h5/4.14/eflasher/rootfs") and run the following command to generate an eflasher ROM image:
+
<syntaxhighlight lang="bash">
+
$ ./mkimage.sh -c 2 -m partmap/h5_eflasher-4.14/partmap.txt -d "misc/uboot-2017_h5/;part1/boot_linux-4.14_h5/;part2/h5/4.14/eflasher/rootfs;out/SD-bootable-1"
+
</syntaxhighlight>
+
After mkimage.sh is executed successfully an "out/SD-bootable-2" directory and the following files will be generated:
+
<syntaxhighlight lang="bash">
+
$ tree out/
+
out/
+
├── SD-bootable-1
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      ├── sunxi-spl.bin
+
│      └── u-boot.itb
+
├── SD-bootable-1.img
+
├── SD-bootable-2
+
│   └── your_company
+
│      ├── boot.img
+
│      ├── friendlyarm.img
+
│      ├── info.conf
+
│      ├── partmap.txt
+
│      ├── rootfs.img
+
│      ├── sunxi-spl.bin
+
│      └── u-boot.itb
+
└── SD-bootable-2.img
+
</syntaxhighlight>
+
The SD-bootable-2.img will be an eflasher image. For example FriendlyElec's nanopi-[h5]_eflasher_friendlycore-xenial_4.14_arm64_YYYYMMDD.img.zip image file is an SD card ROM image.The image contained in the "out/SD-bootable-1/" directory will be the image to be flashed to eMMC. You can use the win32diskimager utility or the "dd" command to flash the SD-bootable-2.img image to an SD card.
+
<!--
+
另外,通过如下命令快速地将eflasher系统烧写到SD卡中以进行测试:
+
<syntaxhighlight lang="bash">
+
$ ./tools/sd_update -d /dev/SD -p ./out/SD-bootable-2/your_company/partmap.txt
+
</syntaxhighlight>
+
注意: 请将/dev/sdX替换为实际的SD卡设备节点。
+
-->
+
 
+
==Update Log==
+
===Sep-14-2017===
+
* Released English Version
+
 
+
===Jan-30-2018===
+
* Updated Section 3
+
  
===Feb-2-2019===
+
==Make Image File for H5==
* Updated Section 3 and Section 5
+
Refer to this repo: https://github.com/friendlyarm/sd-fuse_h5

Latest revision as of 11:03, 29 October 2019

查看中文

1 Make Image Files for RK3399

Refer to this repo: https://github.com/friendlyarm/sd-fuse_rk3399

2 Make Image Files for S5P4418

Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p4418

Example:

mkdir test
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

3 Make Image Files for S5P6818

Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p6818

4 Make Image Files for H3

Refer to this repo: https://github.com/friendlyarm/sd-fuse_h3

5 Make Image File for H5

Refer to this repo: https://github.com/friendlyarm/sd-fuse_h5