Template:ROM-Maker-lite Introduce

From FriendlyELEC WiKi
Revision as of 05:10, 2 February 2019 by Yftan (Talk | contribs)

Jump to: navigation, search

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:rom-maker-lite.

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:

$ ./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 it is used to specify a partition's file system type. For an H3/H5 based board:
-c 1 applies to an SD card ROM image of FriendlyCore/Ubuntu/Debian/OpenWrt;
-c 2 applies to an eflasher ROM image

-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.
-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:
<misc dir>: used to specify the bootloader's directory;
<partition1 dir>: used to specify the boot partition's directory;
<partition2 dir>: used to specify the rootfs partition's directory;
"..." 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;

  • Prerequisites

A host PC running Ubuntu. The Ubuntu versions FriendlyElec tested include:
1) ubuntu-16.04.5-desktop-amd64.iso
2) ubuntu-18.04.1-desktop-amd64.iso
If you PC cannot generate an image we recommend you to use one of the two versions we listed.

Before you proceed make sure you have installed the following package otherwise install it by running the following command.

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

You need to login as root to generate an image. Therefore make sure you are currently working as root otherwise switch to root:

$ su root