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

From FriendlyELEC WiKi
Jump to: navigation, search
(Make Linux Image Files for 4418/6818)
(updated by API)
 
(87 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Assembling the SD card image yourself/zh|查看中文]]
+
[[How to make your own SD-bootable ROM/zh|查看中文]]
  
==Make Linux Image Files for 4418/6818==
+
==Make Image Files for RK3399==
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_rk3399
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 />
+
==Make Image Files for S5P4418==
You can make changes in these two directories according to your requirements.<br />
+
Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p4418<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<br />
+
./tools/make_ext4fs -s -l 3670016000 -a root -L rootfs rootfs.img rootfs<br />
+
</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 root.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/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">
 
<syntaxhighlight lang="bash">
$ ./make_ext4fs -s -l 2097152000 -a root -L /SD/rootfs rootfs.img rootfs
+
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>
 
</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 root.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==
+
==Make Image Files for S5P6818==
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 />
+
Refer to this repo: https://github.com/friendlyarm/sd-fuse_s5p6818
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

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