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

From FriendlyELEC WiKi
Jump to: navigation, search
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
If you have a customized U-boot, Linux kernel and file system and want to make a customized Linux image(also called "ROM") based on these files you can run the "dd" command to copy all the files in your bootable SD card. However this is not very efficient. FriendlyElec provides a better utility:[https://pan.baidu.com/s/1DSd4XYXr1yGyQTdRNQNoOw rom-maker-lite].<br><br>
+
If you have a customized U-boot, Linux kernel and file system and want to use them to make a customized Linux image file(we call it "ROM" in the following sections) you can do it this way: use the "dd" command to copy all the data and files from an existing SD card with a Linux ROM, replace the U-boot, kernel or file system with your customzied files and use the "dd" command again to combine these files to a ROM. However this is inefficient. We suggest you use our rom-maker-lite utility to do it, which can be downloaded at [https://pan.baidu.com/s/1DSd4XYXr1yGyQTdRNQNoOw rom-maker-lite].<br><br>
rom-maker-lite is a general utility to make image files. It now supports making a Linux image file for both SD card and eflasher for FriendlyElec's H3/H5 based boards. It doesn't support making an Android image so far. After extract it and run the "./mkimage.sh" command you will see the following information:
+
The rom-maker-lite utility is a general tool to make a ROM. It currently supports making a Linux based sd/eflasher ROM for FriendlyElec's H3/H5 boards .Making an Android image is not supported yet.<br>
 +
* <b>Run ./mkimage.sh to check usage info:</b>
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ ./mkimage.sh  
 
$ ./mkimage.sh  
Line 17: Line 18:
 
|-
 
|-
 
| -c <filesystem type>  ||  
 
| -c <filesystem type>  ||  
-c it is used to specify a partition's file system type. For an H3/H5 based board:<br>
+
-c specifies file systems' formats for the partitions in a ROM Image. Specifically for an H3/H5 based board:<br>
-c 1 applies to an SD card ROM image of FriendlyCore/Ubuntu/Debian/OpenWrt;<br>
+
-c 1 stands for "misc(bootloader) + fat32 boot.img + ext4 rootfs.img" and this applies to an sd ROM of FriendlyCore/Ubuntu/Debian/OpenWrt;<br>
-c 2 applies to an eflasher ROM image
+
-c 2 stands for "misc(bootloader) + fat32 boot.img + ext4 rootfs.img + exfat friendlyarm.img" and this applies to an eflasher ROM.
 
|-
 
|-
| -m <partmap>  || it is used to specify a partmap file for making a ROM image. In general different SoCs or BSPs use different partmap files.
+
| -m <partmap>  ||
 +
-m specifies a partmap file for making a ROM.<br>
 +
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 "<misc dir>;<partition1 dir>;<partition2 dir>;..."  ||
-d it is used to specify directories for system files such as bootloader, kernel, rootfs etc. Each directory is separated by a ";". For an H3/H5 based board:<br>
+
-d specifies file system's path and each path is separated by a ";". Specifically for an H3/H5 based board:<br>
<misc dir>: used to specify the bootloader's directory;<br>
+
<misc dir>: specifies the bootloader's path;<br>
<partition1 dir>: used to specify the boot partition's directory;<br>
+
<partition1 dir>: specifies the boot partition's path;<br>
<partition2 dir>: used to specify the rootfs partition's directory;<br>
+
<partition2 dir>: specifies the rootfs partition's path;<br>
"..." means more directories can be specified for files. For example when you make an eflasher ROM image you need a directory for the "friendlyarm" partition;
+
"..." means more paths can be defined. When you make an eflasher ROM you need to include the friendlyarm partition's path;
 
|-
 
|-
 
|}
 
|}
  
* <b>Prerequisites</b>
+
* <b>Preparations</b>
A host PC running Ubuntu. The Ubuntu versions FriendlyElec tested include:<br>
+
We tested the following Ubuntu versions that worked with a PC host:<br>
 
1) ubuntu-16.04.5-desktop-amd64.iso <br>
 
1) ubuntu-16.04.5-desktop-amd64.iso <br>
 
2) ubuntu-18.04.1-desktop-amd64.iso <br>
 
2) ubuntu-18.04.1-desktop-amd64.iso <br>
If you PC cannot generate an image we recommend you to use one of the two versions we listed.<br>
+
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.<br>
  
Before you proceed make sure you have installed the following package otherwise install it by running the following command.
+
Before proceed make sure you have installed the following packages:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ apt-get install tree exfat-utils dosfstools python3-tk
 
$ apt-get install tree exfat-utils dosfstools python3-tk
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You need to login as root to generate an image. Therefore make sure you are currently working as root otherwise switch to root:
+
You need the root access right to make a ROM:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ su root
 
$ su root
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 09:29, 22 July 2019

If you have a customized U-boot, Linux kernel and file system and want to use them to make a customized Linux image file(we call it "ROM" in the following sections) you can do it this way: use the "dd" command to copy all the data and files from an existing SD card with a Linux ROM, replace the U-boot, kernel or file system with your customzied files and use the "dd" command again to combine these files to a ROM. However this is inefficient. We suggest you use our rom-maker-lite utility to do it, which can be downloaded at rom-maker-lite.

The rom-maker-lite utility is a general tool to make a ROM. It currently supports making a Linux based sd/eflasher ROM for FriendlyElec's H3/H5 boards .Making an Android image is not supported yet.

  • Run ./mkimage.sh to check usage info:
$ ./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