Difference between revisions of "Template:ROM-Maker-lite Introduce"

From FriendlyELEC WiKi
Jump to: navigation, search
Line 46: Line 46:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You need to login your system as root to make a ROM:
+
You need the root access right to make a ROM:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ su root
 
$ su root
 
</syntaxhighlight>
 
</syntaxhighlight>

Revision as of 08:59, 22 July 2019

If you have a customized U-boot, Linux kernel and file system and want to use them to make a Linux image file(we call it "ROM" in the following sections) you can use the "dd" command the copy all the data and files in your SD card with a Linux ROM. 、文件系统,并且想基于自己定制的文件制作Linux系统映像文件 (以下简称为ROM文件),你可以选择用dd命令将带有你的应用程序和配置的SD卡的数据完整地拷贝出来,这种方法简单粗暴,但是效率不高。另外,你也可以使用FriendlyElec 提供的rom-maker-lite工具。

rom-maker-lite是一套通用的制作映像文件的脚本工具,目前支持为 H3/H5 系列的开发板制作Linux平台的sd/eflasher ROM文件(尚未支持Android)。

  • 执行./mkimage.sh查看帮助信息:
$ ./mkimage.sh 
Usage:
    $ apt-get install tree exfat-utils dosfstools python3-tk
    $ ./mkimage.sh -c <filesystem type> -m <partmap> -d "<misc dir>;<partition1 dir>;<partition2 dir>;..."
        -c <filesystem type>: 
            1: misc(bootloader) + fat32 boot.img + ext4 rootfs.img
            2: misc(bootloader) + fat32 boot.img + ext4 rootfs.img + exfat friendlyarm.img
            3: misc(bootloader) + ext4 boot.img + ext4 rootfs.img
Parameter Comment
-c <filesystem type>

-c specifies file systems' formats for the partitions in a ROM Image. Specifically for an H3/H5 based board:
-c 1 stands for "misc(bootloader) + fat32 boot.img + ext4 rootfs.img" and this applies to an sd ROM of FriendlyCore/Ubuntu/Debian/OpenWrt;
-c 2 stands for "misc(bootloader) + fat32 boot.img + ext4 rootfs.img + exfat friendlyarm.img" and this applies to an eflasher ROM.

-m <partmap>

-m specifies a partmap file for making a ROM.
A partmap file is used to specify the files and their sizes included in a ROM. ROMs made for different boards or BSPs may need different partmap files.

-d "<misc dir>;<partition1 dir>;<partition2 dir>;..."

-d specifies file system's path and each path is separated by a ";". Specifically for an H3/H5 based board:
<misc dir>: specifies the bootloader's path;
<partition1 dir>: specifies the boot partition's path;
<partition2 dir>: specifies the rootfs partition's path;
"..." means more paths can be defined. When you make an eflasher ROM you need to include the friendlyarm partition's path;

  • Preparations

We tested the following Ubuntu versions that worked with a PC host:
1) ubuntu-16.04.5-desktop-amd64.iso
2) ubuntu-18.04.1-desktop-amd64.iso
If you cannot make a ROM under a Linux system with your PC host you'd better use either one of the above two systems we tested.

Before proceed make sure you have installed the following packages:

$ apt-get install tree exfat-utils dosfstools python3-tk

You need the root access right to make a ROM:

$ su root