How to make your own SD-bootable ROM

From FriendlyELEC WiKi
Revision as of 06:13, 30 January 2018 by Yftan (Talk | contribs) (Make Custom Image Files)

Jump to: navigation, search

查看中文

1 Make Linux Image Files for 4418/6818

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:
1) Download https://github.com/friendlyarm/debian_nanopi2;
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";
You can make changes in these two directories according to your requirements.
We suggest you remove the "etc/fs.resized" file under the rootfs directory to allow system's automatic file system extension.
3) Make an img file with the make_ext4fs utility under "debian_nanopi2":
./tools/make_ext4fs -s -l 67108864 -a root -L boot boot.img boot
./tools/make_ext4fs -s -l 2097152000 -a root -L rootfs rootfs.img rootfs
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

2 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:
1) Download utilities: EFlasher-build-tools;
2) Make an ext4 formatted img file with the rootfs section:

$ ./make_ext4fs -s -l 2097152000 -a root -L /SD/rootfs rootfs.img rootfs

-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.
3) Make a fat formatted img file with the boot section:

$ ./build-boot-fat.sh boot.img /SD/boot 40

40 specifies the size of a boot.img to be 40M.
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.

3 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.
This section lists instructions for users to make a custom image which can be used to make an installation SD card for mass production.
Here are the steps to make an Android image for S5P4418:

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

Note: for an S5P6818 SoC you can just change "sd-fuse_nanopi2.git" to "sd-fuse_nanopi3.git" and "S5P4418" to "S5P6818".
Replace the corresponding files under the "Android" directory with your newly generated files and make an installation SD card by running the following commands:

sudo ./fusing.sh /dev/sde android

Note: you need to replace the "/dev/sde" with the actual device name of your SD card in the system

Run this command to make a complete image file:

sudo ./mkimage.sh android

4 Update Log

4.1 Sep-14-2017

  • Released English Version