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

From FriendlyELEC WiKi
Jump to: navigation, search
(H3/H5平台Linux系统映象制作)
Line 2: Line 2:
  
 
==Make Linux Image Files for 4418/6818==
 
==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.<br />
+
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 https://github.com/friendlyarm/debian_nanopi2;<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 />
 
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 />
Line 14: Line 14:
  
 
==Make Linux Image Files for H3/H5==
 
==Make Linux Image Files for H3/H5==
重点是将待烧写的 boot 和 rootfs 这2个分区目录制作成boot.img rootfs.img,然后就可以替换掉eMMC烧写ROM即 eflasher 中的文件即可以烧写到eMMC中。在PC机上执行下列操作: <br />
+
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) 下载相关工具: [http://wiki.friendlyarm.com/wiki/index.php/File:Eflasher-build-tools.zip EFlasher-build-tools]<br />
+
1) Download utilities: [http://wiki.friendlyarm.com/wiki/index.php/File:Eflasher-build-tools.zip EFlasher-build-tools];<br />
2) 将待烧写的 rootfs 分区目录制作为 ext4 格式的 img 文件:<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
 
$ ./make_ext4fs -s -l 2097152000 -a root -L /SD/rootfs rootfs.img rootfs
 
</syntaxhighlight>
 
</syntaxhighlight>
-l 用于指定 img 文件的大小,单位是Byte,2097152000 Byte=2000MB,必须大于实际目录的大小。<br />
+
-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) 将待烧写 boot 分区目录制作为 fat 格式的 img 文件:<br />
 
3) 将待烧写 boot 分区目录制作为 fat 格式的 img 文件:<br />
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">

Revision as of 05:23, 13 September 2017

查看中文

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 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) 将待烧写 boot 分区目录制作为 fat 格式的 img 文件:

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

40 表示boot.img的大小为40M。
4) 用新生成的boot.img和root.img替换eflasher-ROM的FAT分区对应系统目录下的同名文件,然后参考前面的步骤进行烧写即可;

3 用自制系统制作可启动的SD卡或者SD卡映象

在产品量产阶段,通常需要为自已的定制过的产品制作专用的系统映象,这里的系统映象是指 Android编译生成的 boot.img、system.img,或者Ubuntu的根文件系统 rootfs.img 等等。
这个章节将介绍如何用自已编译的系统映象,制作一张可以启动的SD卡,或者,制作一个完整的系统映象文件,完整的系统映象可用于产品量产时批量生成SD卡。
下面以制作S5P4418 Android 启动卡为例,命令如下:

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

注:如果是S5P6818,你需要将sd-fuse_nanopi2.git改为sd-fuse_nanopi3.git,S5P4418改为S5P6818。
现在,请将自已编译生成的 Android映象替换掉Android目录下的同名文件,然后用以下命令制作一张可以启动的SD卡:

sudo ./fusing.sh /dev/sde android

注:请将/dev/sde替换为真实的SD卡设备名称。

如果要制成一个完整的系统映象文件,命令改为:

sudo ./mkimage.sh android