Difference between revisions of "EFlasher"

From FriendlyELEC WiKi
Jump to: navigation, search
(针对量产用户的定制选项)
(updated by API)
 
(93 intermediate revisions by 4 users not shown)
Line 5: Line 5:
 
The eFlasher utility provides users with a GUI with multiple OS options.<br />
 
The eFlasher utility provides users with a GUI with multiple OS options.<br />
 
The eFlasher utility has two versions: eflasher-gui and eflasher-console:<br />
 
The eFlasher utility has two versions: eflasher-gui and eflasher-console:<br />
1) eflasher-gui: a GUI based eFlasher utility. When a board is connected to an LCD or HDMI monitor users can use this utility to install an OS easily;<br />
+
1) eflasher-gui: a GUI based eFlasher utility. When a board is connected to an LCD or HDMI monitor users can use this utility to install an OS easily, and it also supports VNC remote operation;<br />
 
2) eflasher-console: a commandline based eFlasher utility. When a board is connected to a serial terminal or logged in with SSH users can use it to install an OS;<br />
 
2) eflasher-console: a commandline based eFlasher utility. When a board is connected to a serial terminal or logged in with SSH users can use it to install an OS;<br />
 +
<br />
  
 
==Install eFlasher==
 
==Install eFlasher==
 +
 
* Step 1: download an eflasher installation package<br />
 
* Step 1: download an eflasher installation package<br />
Go to the wiki page of the nano board you bought and download an eflasher file named as :XXXX-eflasher-YYYYMMDD-full.img.7z(the "XXXX" is the board type for the  board you bought and "YYYYMMDD" is the release date of that eflasher file)<br/>
+
Go to the wiki page of the nano board you bought and download an eflasher file named as :XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz(the "XXXX" is the board type for the  board you bought and "YYYYMMDD" is the release date of that eflasher file)<br/>
This package contains all the image files released by FriendlyElec such as Debian, Android5, Android4.4 and Ubuntu core(different boards may be provided with different OS image files)<br />
+
This package contains all the image files released by FriendlyElec such as Debian, Android and Ubuntu (different boards may be provided with different OS image files)<br />
Download a XXXX-eflasher-YYYYMMDD-full.img.7z file to a PC host and make an installation SD card with a windows utility: win32diskimager.rar<br />
+
Download a XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz file to a PC host and make an installation SD card with a windows utility: win32diskimager.rar<br />
 
* Step 2: make an installation SD card with eflasher<br />
 
* Step 2: make an installation SD card with eflasher<br />
Extract the eflasher file and you will get an ".img" file.Insert an SD card(at least 8G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your SD card's drive, the wanted image file and click on "write" to start flashing the SD card.<br />
+
Extract the eflasher file and you will get an ".img" file.Insert an SD card(at least 32G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your SD card's drive, the wanted image file and click on "write" to start flashing the SD card.<br />
 
You can use "dd" under a Linux PC to flash this ".img" to your SD card too<br/>
 
You can use "dd" under a Linux PC to flash this ".img" to your SD card too<br/>
 
* Step 3: Start eFlasher
 
* Step 3: Start eFlasher
Insert this SD card to your board, press and hold the "BOOT" button, power on your board.
+
Insert this SD card to your board, power on your board. <br />
 +
Some boards require holding down the button labeled “BOOT” to boot the system from the SD card. <br />
 +
 
 +
== Login to the eFlasher system ==
 +
Log in with the following account in command line:<br />
 +
User Name: root<br />
 +
Password: fa<br />
  
 
==GUI Based eFlasher==
 
==GUI Based eFlasher==
Line 23: Line 31:
 
::[[File:Eflasher-gui-ui.png| frameless|500px|Eflasher-gui]]
 
::[[File:Eflasher-gui-ui.png| frameless|500px|Eflasher-gui]]
 
Select your wanted OS to start installation.<br />
 
Select your wanted OS to start installation.<br />
 +
 +
== Remote Control eFlasher via VNC ==
 +
eFlasher supports remote control using VNC, allowing you to operate it through a VNC client on your computer when no LCD or HDMI screen is available.<br />
 +
The VNC client is free software and can be downloaded from the official website. Here are the download links for multiple platforms:<br />
 +
https://www.realvnc.com/en/connect/download/vnc/<br />
 +
<br />
 +
Usage:<br />
 +
Since eFlasher uses a static IP address: 192.168.1.231, you need to set your computer’s IP address to one within the 192.168.1 subnet.<br />
 +
Create a new device in the VNC client, enter the following in the address bar: 192.168.1.231:5900, and then click Connect.<br />
 +
<br />
 +
Example: The following image demonstrates updating the system for T3 Plus via VNC on an iPhone:
 +
::[[File:Eflasher-vnc.png| frameless|600px]]
  
 
==Commandline Based eFlasher==
 
==Commandline Based eFlasher==
 +
===Directly install the specified OS===
 +
Show help:
 +
<pre>
 +
# eflasher --help
 +
-------------------------------------------------------
 +
USAGE: eflasher [-i, --install <arg>]
 +
 +
OPTIONAL:
 +
-i, --install <path>:  Install OS to eMMC without UI operation
 +
-r, --restore <file>:  Restore backup file to eMMC without UI operation
 +
-e, --exclude <files>: Ignore certain files, multiple files separated by commas
 +
--low-format:          Low format the flash before burning
 +
--auto-exit:          Automatically exit eflahser after burning or restoring
 +
--disable-overlayfs:  Disable overlay filesystem
 +
-c, --conf <arg>:      Set eflasher configuration file
 +
-l, --list-devices:    List the supported board models
 +
-v, --version:        Output version information
 +
-h, --help:            Show this usage
 +
-g, --gui:            Start eflasher gui
 +
</pre>
 +
Directly install the specified OS:
 +
<pre>
 +
# eflasher -i /mnt/sdcard/friendlycore-xenial_4.14_armhf
 +
Using config file:  "/tmp/eflasher.conf"
 +
-------------------------------------------------------
 +
>>friendlycore-xenial_4.14_armhf
 +
Ready to Go with FriendlyCore,Total size: 1.10 GB,
 +
Installing FriendlyCore ..., , ,
 +
Finish!,Speed: 20.71 MB/s
 +
</pre>
 +
===Wizard mode===
 
If your board is not connected to any display device you can login your board via SSH and start the eflahser by running "eflasher". Here is what you expect to observe:<br />
 
If your board is not connected to any display device you can login your board via SSH and start the eflahser by running "eflasher". Here is what you expect to observe:<br />
::[[File:Eflasher-console.png| frameless|500px|Eflasher-console]]
+
<pre>
<br />
+
----------------------------------------------------------------------
 +
  EFlasher v1.2 b190111 running on NanoPC-T4
 +
    Doc: http://wiki.friendlyelec.com/wiki/index.php/EFlasher
 +
    eMMC: 14.56 GB
 +
----------------------------------------------------------------------
 +
  # Select an OS to install:
 +
    1) Android 8
 +
 
 +
  # Select your backup target device:
 +
    tf) [*] TF card  (/dev/mmcblk0p1 - 4.27 GB free - 5.67 GB total - fuseblk)
 +
    usb) [ ] USB disk  (<none>)
 +
 
 +
  # Backup eMMC flash to TF card:
 +
    Not enough free disk space on your TF card
 +
 
 +
  # Restore eMMC flash from backup file:
 +
    No backup files found
 +
 
 +
  # Configure automatic job:
 +
    aui) Automatic installing (Curr:Off)
 +
    aur) Automatic restoring (Curr:Off)
 +
 
 +
  # Format drive
 +
    ftf) Format TF card back to original size
 +
----------------------------------------------------------------------
 +
>>> Enter an option (1/tf/usb/aui/aur/ftf) :
 +
</pre>
  
 
==Automate OS Installation at System Startup==
 
==Automate OS Installation at System Startup==
You can automate OS installation with eFlash at system startup in three ways:<br />
+
===Automatic flashing is enabled by default===
 +
All firmware for a single OS with the filename XXXX-eflasher-OS-YYYYMMDD.img.gz has automatic flashing enabled by default. If you do not want the system to automatically flash on startup, please use the firmware with the filename XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz.
 +
=== Configuration Method ===
 +
You can automate OS installation with eFlasher at system startup in three ways:<br />
 
* No.1:on the GUI based eFlasher select your wanted OS and check the "Start automatically at startup" option on the "Ready to Go" window.<br />
 
* No.1:on the GUI based eFlasher select your wanted OS and check the "Start automatically at startup" option on the "Ready to Go" window.<br />
 
* No.2:mount an SD card to a Windows PC and create an "eflasher.conf" file with notepad on the FAT section of your SD card(or open an existing "eflasher.conf") and type the following lines if you want to install a Debian OS:<br />
 
* No.2:mount an SD card to a Windows PC and create an "eflasher.conf" file with notepad on the FAT section of your SD card(or open an existing "eflasher.conf") and type the following lines if you want to install a Debian OS:<br />
Line 39: Line 119:
 
The "autoStart" field specifies the path to your ROM. In this example the ROM is a Debian OS image file.
 
The "autoStart" field specifies the path to your ROM. In this example the ROM is a Debian OS image file.
 
* No.3:after your board starts open a terminal and create or edit "/mnt/sdcard/eflasher.conf" and type the lines presented in No.2 .<br />
 
* No.3:after your board starts open a terminal and create or edit "/mnt/sdcard/eflasher.conf" and type the lines presented in No.2 .<br />
 +
=== Automatic Flashing Progress Indicator ===
 +
When powering on, the status LED on the board initially shows a breathing light pattern. During the firmware flashing process, the status LED will flash rapidly. Once the flashing is complete, it will change to a slow flash and remain in that state.<br />
 +
The status LED is usually blue, although it may be a different color on certain platform boards.<br />
 +
You can also use the LCD2USB module or an LCD/HDMI screen to obtain a visual progress indicator.<br />
  
==针对量产用户的定制选项==
+
== Do something else after burning or restoring the system ==
 +
You may want to do something extra after the installing system is finished, such as lighting up an LED, you can modify the /opt/run-eflasher.sh script in the beginning of the line "./eflasher-gui" to add code, such as the following example, after the installing is completed, set a GPIO pin:
 +
<syntaxhighlight lang="bash">
 +
./eflasher-gui -qws >/dev/null 2>&1
 +
echo 13 > /sys/class/gpio/export
 +
echo out > /sys/class/gpio/gpio13/direction
 +
echo 0 > /sys/class/gpio/gpio13/value
 +
echo 13 > /sys/class/gpio/unexport
 +
</syntaxhighlight>
 +
The following script demonstrates writing the cpu id to the /etc/cpuid.txt file of the eMMC system after burning the system on the S5P4418/S5P6818 platform:
 +
<syntaxhighlight lang="bash">
 +
./eflasher-gui -qws >/dev/null 2>&1
 +
partprobe /dev/mmcblk1
 +
mount /dev/mmcblk1p2 /media/
 +
cat /sys/devices/platform/cpu/uuid > /media/etc/cpuid.txt
 +
umount /media/
 +
</syntaxhighlight>
 +
In order for the above script to work properly, we also need to set the eflasher-gui to automatically exit after the installing is completed. The following settings are required:<br />
 +
Edit and create a new file called eflasher.conf with the notepad+ text editor on the Fat partition of the SD card, set the autoExit field to True:<br />
 +
<syntaxhighlight lang="bash">
 +
[General]
 +
autoStart=/mnt/sdcard/friendlycore-xenial
 +
autoExit=true
 +
</syntaxhighlight>
 +
The autoStart field specifies that the specified system will be burned automatically without interaction, if no LCD is connected, the burn status can be identified by the LED burn, by default, the green LED flashes to indicate that it is burning.
 +
<br />
  
 +
==Backup & Restore Data on eMMC Flash==
 +
This is pretty much like what the GHOST does with Windows. This function can either back up all the data on eMMC to an external storage device or copy all data from an external storage device to eMMC.<br /><br />
 +
<b>For mass production</b>:<br />
 +
This is especially useful for a case in which you have made a system on a board and want to install this system to massive boards. This works for both Android and Linux images.<br />
 +
<br />
 +
Prerequisites:<br />
 +
You need to have an external storage device whose storage is greater than the eMMC Flash. The external storage device should be formatted to exFat or ntfs. In some case eflasher may re-partition your external storage device.
 +
<br />
 +
 +
=== System Backup and Restore via GUI ===
 +
 +
On EFlasher's main window click on "Backup and Restore" and proceed with the prompts:<br />
 +
::[[File:eflasher_index.png| frameless|600px|eflasher_index]]<br />
 +
<br />
 +
 +
====Select Location for Backup Files====
 +
You can backup your files to either a TF card or a USB drive.
 +
=====Backup Files to TF Card=====
 +
::[[File:eflasher_backup_tf.png| frameless|600px|eflasher_backup_tf]]<br />
 +
The capacity of your TF card should be at least twice that of the eMMC on your board. For instance if your eMMC is 8G you should get a TF card with at least 16G.<br />
 +
By default the capacity of a TF card with at least 8G may not be fully recognized therefore you need to format such a card. Click on the "Format TF card back to original size" button to format the card.<br />
 +
* Click on "Backup eMMC Flash" to backup all the files in the eMMC;
 +
* Click on "Restore eMMC Flash from backup file" to write all the files to the eMMC;
 +
 +
=====Backup Files to USB Drive=====
 +
::[[File:eflasher_backup_udisk.png| frameless|600px|eflasher_backup_udisk]]<br />
 +
We suggest you format your USB drive to "ext4/exfat/ntfs". If it is not click on the "Re-layout and format USB Drive" button on the GUI to format the drive.Attention:formatting a USB drive will remove all its existing data.
 +
* Click on "Backup eMMC Flash" to backup all the files in the eMMC;
 +
* Click on "Restore eMMC Flash from backup file" to write all the files to the eMMC;
 +
 +
=====Backup=====
 +
Click on the "Backup eMMC Flash" button, select a location for your backup file whose format extention will be ".raw" and start to backup:<br />
 +
::[[File:eflasher_backup.png| frameless|600px|eflasher_backup]]<br />
 +
 +
=====Restore=====
 +
Click on the "Restore eMMC Flash from backup file" button, select a ".raw" file and start to restore:<br />
 +
::[[File:eflasher_restore.png| frameless|600px|eflasher_restore]]<br />
 +
 +
===Backup & Restore Data with Commandline Utility===
 +
Type the following command to start eflasher on an SSH or serial terminal:
 +
<syntaxhighlight lang="bash">
 +
# eflasher
 +
</syntaxhighlight>
 +
 +
You will see the following menu:
 +
<pre>
 +
----------------------------------------------------------------------
 +
  EFlasher v1.2 b190111 running on NanoPC-T4
 +
    Doc: http://wiki.friendlyelec.com/wiki/index.php/EFlasher
 +
    eMMC: 14.56 GB
 +
----------------------------------------------------------------------
 +
  # Select an OS to install:
 +
    1) Android 8
 +
 
 +
  # Select your backup target device:
 +
    tf) [*] TF card  (/dev/mmcblk0p1 - 4.27 GB free - 5.67 GB total - fuseblk)
 +
    usb) [ ] USB disk  (<none>)
 +
 
 +
  # Backup eMMC flash to TF card:
 +
    Not enough free disk space on your TF card
 +
 
 +
  # Restore eMMC flash from backup file:
 +
    No backup files found
 +
 
 +
  # Configure automatic job:
 +
    aui) Automatic installing (Curr:Off)
 +
    aur) Automatic restoring (Curr:Off)
 +
 
 +
  # Format drive
 +
    ftf) Format TF card back to original size
 +
----------------------------------------------------------------------
 +
>>> Enter an option (1/tf/usb/aui/aur/ftf) :
 +
</pre>
 +
 +
===Select the storage location of the backup file ===
 +
You can place the backup file on a TF card, or a USB storage device, using the tf and usb commands to switch.
 +
====Backup to TF card ====
 +
Your TF card size should be greater than or equal to twice the eMMC size. For example, if eMMC is 8G, you should prepare a 16G TF card. <br />
 +
By default, TF cards above 8G do not use all the space in the eFlasher system. You need to do a format once, use the ftf command on the menu. <br />
 +
====Backup to USB storage device ====
 +
The USB storage device is preferably in ext4/exfat/ntfs format. If not, you can use the fud on the menu to format the USB storage device once. Note that this operation will lose all data.
 +
====Start backup ====
 +
Type "bk" and enter to start data backup. All data will be saved in a file with the "raw" extension.<br />
 +
<syntaxhighlight lang="bash">
 +
----------------------------------------------------------------------
 +
  Backing up eMMC to /mnt/udisk/nanopc-t3-emmc.raw
 +
----------------------------------------------------------------------
 +
  Speed: 15.01 MB/s
 +
  Remaining Time: 00:12:53
 +
  [===========_______________________________________]  22%
 +
----------------------------------------------------------------------
 +
  >>>If you want to cancel, input "c" then press <Enter> key.
 +
</syntaxhighlight>
 +
 +
===Additional Functions===
 +
EFlasher allows users to write Linux shell scripts to make changes to eMMC's boot partition and file systems. For instance:<br />
 +
1) Add a customized startup LOGO<br />
 +
2) Allocate a static IP or MAC for board<br />
 +
3) Update system with the internet<br />
 +
4) More...<br />
 +
If you have such a script it will be executed after EFlasher backs up eMMC's data.<br />
 +
Your scripts need to be put in a separate directory which should be under the same directory with the backup file. This separate directory should be named as "backup file's name + .d". For instance if the backup file's name is "xxxx.raw" this directory's name should be "xxxx.raw.d".<br/>
 +
By default EFlasher will generate a script which will do clearance work such as removing temporary files under the tmp directory and log files under the var directory after backup is done.<br />
 +
You can learn how to access eMMC's boot and root partitions by studying this script.<br />
 +
<syntaxhighlight lang="bash">
 +
root@NanoPC-T3:/mnt/udisk/nanopc-t3-emmc.raw.d# tree
 +
.
 +
|-- cleanup.sh
 +
`-- README.txt
 +
 +
0 directories, 2 files
 +
root@NanoPC-T3:/mnt/udisk/nanopc-t3-emmc.raw.d#
 +
</syntaxhighlight>
 +
 +
(Note that this feature does not work when using the auto-restoring feature)
 +
 +
=== Automatically restore the specified backup when booting ===
 +
You can automate restoring with eFlasher at system startup in two ways:<br />
 +
* No.1:On the GUI, enter the Backup and restore UI, first select the storage device where the backup file is located, select TF card or USB disk, then click "Turn on Automatic restoring", and select the file to be restored.<br />
 +
* No.2:  Use the notepad+ text editor to create a new file called eflasher.conf in the root directory of the storage device (or open an existing "eflasher.conf"). The sample content is as follows:<br />
 +
<syntaxhighlight lang="bash">
 +
[General]
 +
autoStart=/mnt/sdcard/nanopct3-backup-20190101.raw
 +
</syntaxhighlight>
 +
/mnt/sdcard/ indicates TF card, /mnt/udisk indicates USB disk.
 +
 +
== Installing the System to M.2 or USB Drive (Rockchip Platform Only) ==
 +
=== Booting with eMMC ===
 +
eFlasher supports installing the bootloader and system to different storage devices. However, because the CPU cannot boot directly from M.2 or USB drives, the bootloader must still be installed on eMMC or a TF card, even if the system itself is installed on M.2 or USB storage.
 +
* In the eFlasher interface, select eMMC as the boot device:
 +
[[File:Eflasher-select-boot-device.png|frameless|400px]]<br />
 +
* In the eFlasher interface, select NVMe drive as the rootfs installation device:
 +
[[File:Eflasher-select-system-device.png|frameless|400px]]<br />
 +
After installation, the partition layout of the two storage devices will be as follows:
 +
* eMMC Partition Layout
 +
<syntaxhighlight lang="bash">
 +
# parted -s /dev/mmcblk2 unit MiB print 
 +
Number  Start    End      Size    File system  Name      Flags 
 +
1      8.00MiB  12.0MiB  4.00MiB              uboot 
 +
2      12.0MiB  16.0MiB  4.00MiB              misc 
 +
3      16.0MiB  20.0MiB  4.00MiB              dtbo 
 +
4      20.0MiB  36.0MiB  16.0MiB              resource 
 +
5      36.0MiB  76.0MiB  40.0MiB              kernel 
 +
6      76.0MiB  108MiB  32.0MiB              boot 
 +
7      108MiB  140MiB  32.0MiB              recovery 
 +
</syntaxhighlight>
 +
* M.2 Drive Layout
 +
<syntaxhighlight lang="bash"> 
 +
# parted -s /dev/nvme0n1 unit MiB print 
 +
Number  Start    End        Size      File system  Name      Flags 
 +
1      8.00MiB  4616MiB    4608MiB    ext4        rootfs 
 +
2      4616MiB  238475MiB  233859MiB  ext4        userdata 
 +
</syntaxhighlight>
 +
=== Booting with a TF Card ===
 +
If the board lacks an eMMC, you can use a TF card for booting, but two TF cards are required—one to run the eFlasher system and the other for the system installation.<br />
 +
The procedure is similar to using eMMC as the boot device, except the TF card needs to be connected to a USB port on the board via a USB card reader and selected from the boot device menu.<br />
 +
=== Mounting an Existing Filesystem (Using Btrfs) ===
 +
This section demonstrates a flexible system installation method where the drive’s filesystem is prepared in advance on a computer.<br />
 +
Advantages include the flexibility to choose different filesystems, such as Btrfs instead of the default OverlayFS+Ext4. Additionally, root filesystems can be mounted by UUID with custom mount options. The following steps illustrate the process.<br />
 +
* Use fdisk to partition the drive (assuming the device is /dev/sdX)
 +
<syntaxhighlight lang="bash">
 +
sudo fdisk /dev/sdX
 +
</syntaxhighlight>
 +
Create a partition:
 +
<syntaxhighlight lang="bash">
 +
Command (m for help): g
 +
Created a new GPT disklabel (GUID: 3D6A24F1-9077-4587-9A01-66A7149F236F).
 +
 +
Command (m for help): n
 +
Partition number (1-128, default 1):
 +
First sector (2048-976773134, default 2048):
 +
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-976773134, default 976773119):
 +
 +
Created a new partition 1 of type 'Linux filesystem' and of size 465.8 GiB.
 +
 +
Command (m for help): w
 +
The partition table has been altered.
 +
Calling ioctl() to re-read partition table.
 +
Syncing disks.
 +
</syntaxhighlight>
 +
* Format the partition as Btrfs
 +
<syntaxhighlight lang="bash">
 +
sudo mkfs.btrfs -f /dev/sdX1
 +
</syntaxhighlight>
 +
* Check the UUID
 +
<syntaxhighlight lang="bash">
 +
$ sudo blkid | grep /dev/sdX1
 +
/dev/sdX1: UUID="78e066a3-3c2b-47b2-9404-ed6d9463f1b2" UUID_SUB="9fd08169-d6e9-47d2-b247-56ef5a8899d9" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="3b89b71b-f8a0-4428-a2c6-1aa516ce065d"
 +
</syntaxhighlight>
 +
* Mount the drive
 +
<syntaxhighlight lang="bash">
 +
sudo mount /dev/sdX1 /mnt/usb500g
 +
</syntaxhighlight>
 +
* Download the official rootfs package, using Debian Core as an example. You can find the package in the directory starting with `06_` on the network drive.
 +
<syntaxhighlight lang="bash">
 +
06_File\ systems/rootfs-debian-bookworm-core-arm64.tgz
 +
</syntaxhighlight>
 +
* Extract rootfs to the drive
 +
<syntaxhighlight lang="bash">
 +
sudo tar xvzfp /tmp/rootfs-debian-bookworm-core-arm64.tgz --strip-components 2 -C /mnt/usb500g --numeric-owner --same-owner
 +
</syntaxhighlight>
 +
* Unmount the drive
 +
<syntaxhighlight lang="bash">
 +
sudo umount /mnt/usb500g
 +
</syntaxhighlight>
 +
* Modify the kernel boot parameters in the eFlasher card
 +
Mount the first partition of the eFlasher card on your computer to `/mnt/sdcard` and edit `info.conf`
 +
<syntaxhighlight lang="bash">
 +
vi /mnt/sdcard/debian-bookworm-core-arm64/info.conf
 +
</syntaxhighlight>
 +
Add the following content in `info.conf` to instruct the kernel to mount the Linux filesystem by UUID, remove the `userdata` partition (disable OverlayFS), and, as my drive does not support the discard feature, specify the `nodiscard` option:
 +
<syntaxhighlight lang="bash">
 +
bootargs-ext=root=PARTUUID=3b89b71b-f8a0-4428-a2c6-1aa516ce065d data= rootflags=nodiscard
 +
</syntaxhighlight>
 +
* Insert the eFlasher card into the board, power on, select "eMMC" as the Boot device, and select "Skip Flashing" for the System device to complete flashing:
 +
[[File:Eflasher-noflashing-system.png|frameless|400px]]<br />
 +
=== Creating image with Btrfs ===
 +
To create image using Btrfs, pass the FS_TYPE=btrfs parameter when packaging rootfs.img with build-rootfs-img.sh from the sd-fuse_rkXXXX repository. For example:
 +
<syntaxhighlight lang="bash">
 +
sudo -E FS_TYPE=btrfs ./build-rootfs-img.sh ubuntu-focal-desktop-arm64/rootfs ubuntu-focal-desktop-arm64
 +
</syntaxhighlight>
 +
For the complete script, refer to https://github.com/friendlyarm/sd-fuse_rk3588/blob/kernel-6.1.y/test/test-btrfs-rootfs.sh
 +
==Make Your Own eFlasher==
 
===Manage Multiple OS Images with eFlasher===
 
===Manage Multiple OS Images with eFlasher===
 
The eFlasher utility reads image files from the FAT section of an SD card. After an SD card is inserted to a Windows PC you can manage multiple OS images that exist in the SD card with eFlasher.<br />
 
The eFlasher utility reads image files from the FAT section of an SD card. After an SD card is inserted to a Windows PC you can manage multiple OS images that exist in the SD card with eFlasher.<br />
Line 66: Line 398:
 
|}
 
|}
  
系统映象文件, 不同的系统可能不同:<br />
+
Image File:<br />
 
::{| class="wikitable"
 
::{| class="wikitable"
 
|-
 
|-
 
| 2ndboot.bin    || Second Boot
 
| 2ndboot.bin    || Second Boot
 
|-
 
|-
| boot.img    || boot分区映象文件
+
| boot.img    || image file for boot section
 
|-
 
|-
 
| bootloader    || U-Boot
 
| bootloader    || U-Boot
 
|-
 
|-
| cache.img    || Android Cache分区映象
+
| cache.img    || image file for Android Cache section
 
|-
 
|-
| system.img    || 系统分区的映象
+
| system.img    || image file for system section
 
|-
 
|-
| userdata.img    || 数据分区的映象
+
| userdata.img    || image file for user data section
 
|-
 
|-
| partmap.txt    || 分区描述文件
+
| partmap.txt    || description file for partition map
 
|-
 
|-
 
|}
 
|}
  
以上映象文件默认已经预装在eFlasher的固件中,不过你也可以到指定板子的下载地址下载它们,进入官方的下载地址指向的网盘目录,这些系统映象放在一个名为 images-for-eflasher 的目录下,以下是S5P6818开发板的网盘目录:<br />
+
These image files by default are included in an eFlasher file. These files can be downloaded from a board's corresponding wiki site. Usually an image file is located at the images-for-eflasher directory of a server. Here is how a S5P6818's directory looks like:<br />
::[[File:Images-for-eflasher.png| frameless|800px|EImages-for-eflasher.png]] <br />
+
::[[File:Images-for-eflasher.png| frameless|600px|EImages-for-eflasher.png]] <br />
 +
You can download its image file and extract it to the FAT section of an SD card.
  
可以下载这个目录下的文件然后解压到SD卡的Fat分区或者U盘即可。
+
=== Setting Kernel Boot Parameters (Rockchip Platform Only) ===
 +
Edit the info.conf configuration file in the OS directory to add the bootargs-ext parameter and set additional kernel boot parameters. For example, to add a parameter that limits the kernel to use a resolution width not exceeding 2048:
 +
<syntaxhighlight lang="bash">
 +
bootargs-ext=rockchipdrm.fb_max_sz=2048
 +
</syntaxhighlight>
 +
To remove a previously specified parameter, you can set it to empty. For example, to remove the userdata parameter:
 +
<syntaxhighlight lang="bash">
 +
bootargs-ext=userdata=
 +
</syntaxhighlight>
 +
To set the kernel boot parameters during the production card creation process, you can refer to the following script:<br />
 +
https://github.com/friendlyarm/sd-fuse_rk3588/blob/kernel-6.1.y/test/test-custom-bootargs.sh
  
=== 制作自已的系统映象 ===
+
===Make eflasher File with Your OS===
 +
Please visit the link next to the CPU model and search for the keyword “Backup rootfs and create custom SD image” in the README.md file.
 +
{| class="wikitable"
 +
|-
 +
! CPU !! Link
 +
|-
 +
| H3 || [https://github.com/friendlyarm/sd-fuse_h3 sd-fuse_h3]
 +
|-
 +
| H5 || [https://github.com/friendlyarm/sd-fuse_h5 sd-fuse_h5]
 +
|-
 +
| RK3328 || [https://github.com/friendlyarm/sd-fuse_rk3328 sd-fuse_rk3328]
 +
|-
 +
| RK3399 || [https://github.com/friendlyarm/sd-fuse_rk3399 sd-fuse_rk3399]
 +
|-
 +
| RK3528 || [https://github.com/friendlyarm/sd-fuse_rk3528 sd-fuse_rk3528]
 +
|-
 +
| RK3566 || [https://github.com/friendlyarm/sd-fuse_rk3566 sd-fuse_rk3566]
 +
|-
 +
| RK3568 || [https://github.com/friendlyarm/sd-fuse_rk3568 sd-fuse_rk3568]
 +
|-
 +
| RK3576 || [https://github.com/friendlyarm/sd-fuse_rk3576 sd-fuse_rk3576]
 +
|-
 +
| RK3588 || [https://github.com/friendlyarm/sd-fuse_rk3588 sd-fuse_rk3588]
 +
|-
 +
| S5P4418 || [https://github.com/friendlyarm/sd-fuse_s5p4418 sd-fuse_s5p4418]
 +
|-
 +
| S5P6818 || [https://github.com/friendlyarm/sd-fuse_s5p6818 sd-fuse_s5p6818]
 +
|}
  
 +
=== Connect WiKi in the EFlasher system ===
 +
Write the following to the configuration file: /etc/wpa_supplicant/wpa_supplicant.conf, where SSID and PASSWORD should be replaced with the router's SSID and password:
 +
<syntaxhighlight lang="bash">
 +
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 +
update_config=1
 +
country=CN
 +
network={
 +
  ssid="SSID"
 +
  psk="PASSWORD"
 +
  key_mgmt=WPA-PSK
 +
}
 +
</syntaxhighlight>
 +
If the WiFi route does not set a password, set key_mgmt to NONE, delete this line: psk=.
  
==== 4418/6818平台Android系统映象制作 ====
+
== Change IP address ==
 +
For faster startup speed, we set the eflasher to static ip address: 192.168.1.231, <br />
 +
<br />
 +
If you want to change to dhcp, you can modify this file:<br />
 +
/etc/network/interfaces.d/eth0<br />
 +
<br />
 +
Change the contents of this file to:<br />
 +
<syntaxhighlight lang="bash">
 +
auto eth0
 +
iface eth0 inet dhcp
 +
</syntaxhighlight>
  
在制作Android映象为例,首先编译Android源代码,编译完成后,进入 out/target/product/XXXXX 目录 (其中XXXXX是产品名称,例如4418平台名字是nanopi2,6818平台是nanopi3) ,然后将该目录下的以下映象文件替换掉SD卡Fat分区Android目录下的同名文件即可,如下图的示例所示:
+
==Update Log==
::[[File:Eflasher-replace-files.png| frameless|800px|Eflasher-replace-files.png]]
+
===July-26-2017===
 +
* Released English Version
  
 +
===August-22-2017===
 +
* Added section 6.2
  
==== 4418/6818平台Linux系统映象制作 ====
+
===March-10-2018===
 +
* Updated sections 6.2 and 6.3
  
重点是将SD卡中的boot和rootfs 这2个分区制作成boot.img 和 rootfs.img,然后就可以替换掉eMMC烧写ROM即 eflasher 中的文件即可以烧写到eMMC中。<br />
+
===July-26-2018===
1) 下载 https://github.com/friendlyarm/debian_nanopi2 ;<br />
+
* Added sections 6 and 7.3.2
2) 复制 SD卡中的 boot 分区下的文件到debian_nanopi2/boot ; 复制SD卡中的 rootfs分区下的文件到 debian_nanopi2/rootfs ;<br />
+
根据自己的需要可以再修改 boot 和 rootfs 目录下的文件。<br />
+
建议删除rootfs 目录下的文件 etc/fs.resized 否则将不会自动扩展分区。<br />
+
3) 使用 debian_nanopi2 下的 make_ext4fs 来制作 img:<br />
+
./tools/make_ext4fs -s -l 67108864 -a root -L boot boot.img boot<br />
+
./tools/make_ext4fs -s -l 2097152000 -a root -L rootfs rootfs.img rootfs<br />
+
4) 复制新生成的 boot.img 和 root.img 替换 eflasher 的FAT分区 core-qte 目录下的文件,然后即可烧写;<br />
+
 
+
====H3/H5平台Linux系统映象制作====
+
重点是将待烧写的 boot 和 rootfs 这2个分区目录制作成boot.img 和 rootfs.img,然后就可以替换掉eMMC烧写ROM即 eflasher 中的文件即可以烧写到eMMC中。在PC机上执行下列操作: <br />
+
1) 下载相关工具: [http://wiki.friendlyarm.com/wiki/index.php/File:Eflasher-build-tools.zip EFlasher-build-tools];<br />
+
2) 将待烧写的 rootfs 分区目录制作为 ext4 格式的 img 文件:<br />
+
<syntaxhighlight lang="bash">
+
$ ./make_ext4fs -s -l 2097152000 -a root -L /SD/rootfs rootfs.img rootfs
+
</syntaxhighlight>
+
-l 用于指定 img 文件的大小,单位是Byte,2097152000 Byte=2000MB,必须大于实际目录的大小。<br />
+
3) 将待烧写 boot 分区目录制作为 fat 格式的 img 文件:<br />
+
<syntaxhighlight lang="bash">
+
$ ./build-boot-fat.sh boot.img /SD/boot 40
+
</syntaxhighlight>
+
40 表示boot.img的大小为40M。 <br />
+
4) 用新生成的boot.img和root.img替换eflasher-ROM的FAT分区对应系统目录下的同名文件,然后参考前面的步骤进行烧写即可;<br />
+

Latest revision as of 01:30, 30 October 2024

查看中文

1 Introduction to eFlasher

The eFlasher (eMMC-flasher) utility is released by FriendlyElec for users to install an OS image on a FriendlyElec board's eMMC easily.
The eFlasher utility provides users with a GUI with multiple OS options.
The eFlasher utility has two versions: eflasher-gui and eflasher-console:
1) eflasher-gui: a GUI based eFlasher utility. When a board is connected to an LCD or HDMI monitor users can use this utility to install an OS easily, and it also supports VNC remote operation;
2) eflasher-console: a commandline based eFlasher utility. When a board is connected to a serial terminal or logged in with SSH users can use it to install an OS;

2 Install eFlasher

  • Step 1: download an eflasher installation package

Go to the wiki page of the nano board you bought and download an eflasher file named as :XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz(the "XXXX" is the board type for the board you bought and "YYYYMMDD" is the release date of that eflasher file)
This package contains all the image files released by FriendlyElec such as Debian, Android and Ubuntu (different boards may be provided with different OS image files)
Download a XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz file to a PC host and make an installation SD card with a windows utility: win32diskimager.rar

  • Step 2: make an installation SD card with eflasher

Extract the eflasher file and you will get an ".img" file.Insert an SD card(at least 32G) into a Windows PC and run the win32diskimager utility as administrator. On the utility's main window select your SD card's drive, the wanted image file and click on "write" to start flashing the SD card.
You can use "dd" under a Linux PC to flash this ".img" to your SD card too

  • Step 3: Start eFlasher

Insert this SD card to your board, power on your board.
Some boards require holding down the button labeled “BOOT” to boot the system from the SD card.

3 Login to the eFlasher system

Log in with the following account in command line:
User Name: root
Password: fa

4 GUI Based eFlasher

By default after eFlash is started the GUI based version will be started. If your board is connected to an LCD or HDMI monitor you will see the following screen:

Eflasher-gui

Select your wanted OS to start installation.

5 Remote Control eFlasher via VNC

eFlasher supports remote control using VNC, allowing you to operate it through a VNC client on your computer when no LCD or HDMI screen is available.
The VNC client is free software and can be downloaded from the official website. Here are the download links for multiple platforms:
https://www.realvnc.com/en/connect/download/vnc/

Usage:
Since eFlasher uses a static IP address: 192.168.1.231, you need to set your computer’s IP address to one within the 192.168.1 subnet.
Create a new device in the VNC client, enter the following in the address bar: 192.168.1.231:5900, and then click Connect.

Example: The following image demonstrates updating the system for T3 Plus via VNC on an iPhone:

Eflasher-vnc.png

6 Commandline Based eFlasher

6.1 Directly install the specified OS

Show help:

# eflasher --help
-------------------------------------------------------
USAGE: eflasher [-i, --install <arg>]

OPTIONAL:
-i, --install <path>:  Install OS to eMMC without UI operation
-r, --restore <file>:  Restore backup file to eMMC without UI operation
-e, --exclude <files>: Ignore certain files, multiple files separated by commas
--low-format:          Low format the flash before burning
--auto-exit:           Automatically exit eflahser after burning or restoring
--disable-overlayfs:   Disable overlay filesystem
-c, --conf <arg>:      Set eflasher configuration file
-l, --list-devices:    List the supported board models
-v, --version:         Output version information
-h, --help:            Show this usage
-g, --gui:             Start eflasher gui

Directly install the specified OS:

# eflasher -i /mnt/sdcard/friendlycore-xenial_4.14_armhf
Using config file:  "/tmp/eflasher.conf"
-------------------------------------------------------
>>friendlycore-xenial_4.14_armhf
Ready to Go with FriendlyCore,Total size: 1.10 GB,
Installing FriendlyCore ..., , ,
Finish!,Speed: 20.71 MB/s

6.2 Wizard mode

If your board is not connected to any display device you can login your board via SSH and start the eflahser by running "eflasher". Here is what you expect to observe:

----------------------------------------------------------------------
  EFlasher v1.2 b190111 running on NanoPC-T4
    Doc: http://wiki.friendlyelec.com/wiki/index.php/EFlasher
    eMMC: 14.56 GB
----------------------------------------------------------------------
  # Select an OS to install:
    1) Android 8
   
  # Select your backup target device:
     tf) [*] TF card  (/dev/mmcblk0p1 - 4.27 GB free - 5.67 GB total - fuseblk)
    usb) [ ] USB disk  (<none>)
   
  # Backup eMMC flash to TF card:
    Not enough free disk space on your TF card
   
  # Restore eMMC flash from backup file:
    No backup files found
   
  # Configure automatic job:
    aui) Automatic installing (Curr:Off)
    aur) Automatic restoring (Curr:Off)
   
  # Format drive
    ftf) Format TF card back to original size
----------------------------------------------------------------------
>>> Enter an option (1/tf/usb/aui/aur/ftf) :

7 Automate OS Installation at System Startup

7.1 Automatic flashing is enabled by default

All firmware for a single OS with the filename XXXX-eflasher-OS-YYYYMMDD.img.gz has automatic flashing enabled by default. If you do not want the system to automatically flash on startup, please use the firmware with the filename XXXX-eflasher-multiple-os-YYYYMMDD-30g.img.gz.

7.2 Configuration Method

You can automate OS installation with eFlasher at system startup in three ways:

  • No.1:on the GUI based eFlasher select your wanted OS and check the "Start automatically at startup" option on the "Ready to Go" window.
  • No.2:mount an SD card to a Windows PC and create an "eflasher.conf" file with notepad on the FAT section of your SD card(or open an existing "eflasher.conf") and type the following lines if you want to install a Debian OS:
[General]
autoStart=/mnt/sdcard/debian

The "autoStart" field specifies the path to your ROM. In this example the ROM is a Debian OS image file.

  • No.3:after your board starts open a terminal and create or edit "/mnt/sdcard/eflasher.conf" and type the lines presented in No.2 .

7.3 Automatic Flashing Progress Indicator

When powering on, the status LED on the board initially shows a breathing light pattern. During the firmware flashing process, the status LED will flash rapidly. Once the flashing is complete, it will change to a slow flash and remain in that state.
The status LED is usually blue, although it may be a different color on certain platform boards.
You can also use the LCD2USB module or an LCD/HDMI screen to obtain a visual progress indicator.

8 Do something else after burning or restoring the system

You may want to do something extra after the installing system is finished, such as lighting up an LED, you can modify the /opt/run-eflasher.sh script in the beginning of the line "./eflasher-gui" to add code, such as the following example, after the installing is completed, set a GPIO pin:

./eflasher-gui -qws >/dev/null 2>&1
echo 13 > /sys/class/gpio/export 
echo out > /sys/class/gpio/gpio13/direction 
echo 0 > /sys/class/gpio/gpio13/value
echo 13 > /sys/class/gpio/unexport

The following script demonstrates writing the cpu id to the /etc/cpuid.txt file of the eMMC system after burning the system on the S5P4418/S5P6818 platform:

./eflasher-gui -qws >/dev/null 2>&1
partprobe /dev/mmcblk1
mount /dev/mmcblk1p2 /media/
cat /sys/devices/platform/cpu/uuid > /media/etc/cpuid.txt
umount /media/

In order for the above script to work properly, we also need to set the eflasher-gui to automatically exit after the installing is completed. The following settings are required:
Edit and create a new file called eflasher.conf with the notepad+ text editor on the Fat partition of the SD card, set the autoExit field to True:

[General]
autoStart=/mnt/sdcard/friendlycore-xenial
autoExit=true

The autoStart field specifies that the specified system will be burned automatically without interaction, if no LCD is connected, the burn status can be identified by the LED burn, by default, the green LED flashes to indicate that it is burning.

9 Backup & Restore Data on eMMC Flash

This is pretty much like what the GHOST does with Windows. This function can either back up all the data on eMMC to an external storage device or copy all data from an external storage device to eMMC.

For mass production:
This is especially useful for a case in which you have made a system on a board and want to install this system to massive boards. This works for both Android and Linux images.

Prerequisites:
You need to have an external storage device whose storage is greater than the eMMC Flash. The external storage device should be formatted to exFat or ntfs. In some case eflasher may re-partition your external storage device.

9.1 System Backup and Restore via GUI

On EFlasher's main window click on "Backup and Restore" and proceed with the prompts:

eflasher_index


9.1.1 Select Location for Backup Files

You can backup your files to either a TF card or a USB drive.

9.1.1.1 Backup Files to TF Card
eflasher_backup_tf

The capacity of your TF card should be at least twice that of the eMMC on your board. For instance if your eMMC is 8G you should get a TF card with at least 16G.
By default the capacity of a TF card with at least 8G may not be fully recognized therefore you need to format such a card. Click on the "Format TF card back to original size" button to format the card.

  • Click on "Backup eMMC Flash" to backup all the files in the eMMC;
  • Click on "Restore eMMC Flash from backup file" to write all the files to the eMMC;
9.1.1.2 Backup Files to USB Drive
eflasher_backup_udisk

We suggest you format your USB drive to "ext4/exfat/ntfs". If it is not click on the "Re-layout and format USB Drive" button on the GUI to format the drive.Attention:formatting a USB drive will remove all its existing data.

  • Click on "Backup eMMC Flash" to backup all the files in the eMMC;
  • Click on "Restore eMMC Flash from backup file" to write all the files to the eMMC;
9.1.1.3 Backup

Click on the "Backup eMMC Flash" button, select a location for your backup file whose format extention will be ".raw" and start to backup:

eflasher_backup
9.1.1.4 Restore

Click on the "Restore eMMC Flash from backup file" button, select a ".raw" file and start to restore:

eflasher_restore

9.2 Backup & Restore Data with Commandline Utility

Type the following command to start eflasher on an SSH or serial terminal:

# eflasher

You will see the following menu:

----------------------------------------------------------------------
  EFlasher v1.2 b190111 running on NanoPC-T4
    Doc: http://wiki.friendlyelec.com/wiki/index.php/EFlasher
    eMMC: 14.56 GB
----------------------------------------------------------------------
  # Select an OS to install:
    1) Android 8
   
  # Select your backup target device:
     tf) [*] TF card  (/dev/mmcblk0p1 - 4.27 GB free - 5.67 GB total - fuseblk)
    usb) [ ] USB disk  (<none>)
   
  # Backup eMMC flash to TF card:
    Not enough free disk space on your TF card
   
  # Restore eMMC flash from backup file:
    No backup files found
   
  # Configure automatic job:
    aui) Automatic installing (Curr:Off)
    aur) Automatic restoring (Curr:Off)
   
  # Format drive
    ftf) Format TF card back to original size
----------------------------------------------------------------------
>>> Enter an option (1/tf/usb/aui/aur/ftf) :

9.3 Select the storage location of the backup file

You can place the backup file on a TF card, or a USB storage device, using the tf and usb commands to switch.

9.3.1 Backup to TF card

Your TF card size should be greater than or equal to twice the eMMC size. For example, if eMMC is 8G, you should prepare a 16G TF card.
By default, TF cards above 8G do not use all the space in the eFlasher system. You need to do a format once, use the ftf command on the menu.

9.3.2 Backup to USB storage device

The USB storage device is preferably in ext4/exfat/ntfs format. If not, you can use the fud on the menu to format the USB storage device once. Note that this operation will lose all data.

9.3.3 Start backup

Type "bk" and enter to start data backup. All data will be saved in a file with the "raw" extension.

----------------------------------------------------------------------
  Backing up eMMC to /mnt/udisk/nanopc-t3-emmc.raw
----------------------------------------------------------------------
  Speed: 15.01 MB/s
  Remaining Time: 00:12:53
  [===========_______________________________________]  22%
----------------------------------------------------------------------
  >>>If you want to cancel, input "c" then press <Enter> key.

9.4 Additional Functions

EFlasher allows users to write Linux shell scripts to make changes to eMMC's boot partition and file systems. For instance:
1) Add a customized startup LOGO
2) Allocate a static IP or MAC for board
3) Update system with the internet
4) More...
If you have such a script it will be executed after EFlasher backs up eMMC's data.
Your scripts need to be put in a separate directory which should be under the same directory with the backup file. This separate directory should be named as "backup file's name + .d". For instance if the backup file's name is "xxxx.raw" this directory's name should be "xxxx.raw.d".
By default EFlasher will generate a script which will do clearance work such as removing temporary files under the tmp directory and log files under the var directory after backup is done.
You can learn how to access eMMC's boot and root partitions by studying this script.

root@NanoPC-T3:/mnt/udisk/nanopc-t3-emmc.raw.d# tree
.
|-- cleanup.sh
`-- README.txt
 
0 directories, 2 files
root@NanoPC-T3:/mnt/udisk/nanopc-t3-emmc.raw.d#

(Note that this feature does not work when using the auto-restoring feature)

9.5 Automatically restore the specified backup when booting

You can automate restoring with eFlasher at system startup in two ways:

  • No.1:On the GUI, enter the Backup and restore UI, first select the storage device where the backup file is located, select TF card or USB disk, then click "Turn on Automatic restoring", and select the file to be restored.
  • No.2: Use the notepad+ text editor to create a new file called eflasher.conf in the root directory of the storage device (or open an existing "eflasher.conf"). The sample content is as follows:
[General]
autoStart=/mnt/sdcard/nanopct3-backup-20190101.raw

/mnt/sdcard/ indicates TF card, /mnt/udisk indicates USB disk.

10 Installing the System to M.2 or USB Drive (Rockchip Platform Only)

10.1 Booting with eMMC

eFlasher supports installing the bootloader and system to different storage devices. However, because the CPU cannot boot directly from M.2 or USB drives, the bootloader must still be installed on eMMC or a TF card, even if the system itself is installed on M.2 or USB storage.

  • In the eFlasher interface, select eMMC as the boot device:

Eflasher-select-boot-device.png

  • In the eFlasher interface, select NVMe drive as the rootfs installation device:

Eflasher-select-system-device.png
After installation, the partition layout of the two storage devices will be as follows:

  • eMMC Partition Layout
# parted -s /dev/mmcblk2 unit MiB print  
Number  Start    End      Size     File system  Name      Flags  
 1      8.00MiB  12.0MiB  4.00MiB               uboot  
 2      12.0MiB  16.0MiB  4.00MiB               misc  
 3      16.0MiB  20.0MiB  4.00MiB               dtbo  
 4      20.0MiB  36.0MiB  16.0MiB               resource  
 5      36.0MiB  76.0MiB  40.0MiB               kernel  
 6      76.0MiB  108MiB   32.0MiB               boot  
 7      108MiB   140MiB   32.0MiB               recovery
  • M.2 Drive Layout
 
# parted -s /dev/nvme0n1 unit MiB print  
Number  Start    End        Size       File system  Name      Flags  
 1      8.00MiB  4616MiB    4608MiB    ext4         rootfs  
 2      4616MiB  238475MiB  233859MiB  ext4         userdata

10.2 Booting with a TF Card

If the board lacks an eMMC, you can use a TF card for booting, but two TF cards are required—one to run the eFlasher system and the other for the system installation.
The procedure is similar to using eMMC as the boot device, except the TF card needs to be connected to a USB port on the board via a USB card reader and selected from the boot device menu.

10.3 Mounting an Existing Filesystem (Using Btrfs)

This section demonstrates a flexible system installation method where the drive’s filesystem is prepared in advance on a computer.
Advantages include the flexibility to choose different filesystems, such as Btrfs instead of the default OverlayFS+Ext4. Additionally, root filesystems can be mounted by UUID with custom mount options. The following steps illustrate the process.

  • Use fdisk to partition the drive (assuming the device is /dev/sdX)
sudo fdisk /dev/sdX

Create a partition:

Command (m for help): g
Created a new GPT disklabel (GUID: 3D6A24F1-9077-4587-9A01-66A7149F236F).
 
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-976773134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-976773134, default 976773119):
 
Created a new partition 1 of type 'Linux filesystem' and of size 465.8 GiB.
 
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
  • Format the partition as Btrfs
sudo mkfs.btrfs -f /dev/sdX1
  • Check the UUID
$ sudo blkid | grep /dev/sdX1
/dev/sdX1: UUID="78e066a3-3c2b-47b2-9404-ed6d9463f1b2" UUID_SUB="9fd08169-d6e9-47d2-b247-56ef5a8899d9" BLOCK_SIZE="4096" TYPE="btrfs" PARTUUID="3b89b71b-f8a0-4428-a2c6-1aa516ce065d"
  • Mount the drive
sudo mount /dev/sdX1 /mnt/usb500g
  • Download the official rootfs package, using Debian Core as an example. You can find the package in the directory starting with `06_` on the network drive.
06_File\ systems/rootfs-debian-bookworm-core-arm64.tgz
  • Extract rootfs to the drive
sudo tar xvzfp /tmp/rootfs-debian-bookworm-core-arm64.tgz --strip-components 2 -C /mnt/usb500g --numeric-owner --same-owner
  • Unmount the drive
sudo umount /mnt/usb500g
  • Modify the kernel boot parameters in the eFlasher card

Mount the first partition of the eFlasher card on your computer to `/mnt/sdcard` and edit `info.conf`

vi /mnt/sdcard/debian-bookworm-core-arm64/info.conf

Add the following content in `info.conf` to instruct the kernel to mount the Linux filesystem by UUID, remove the `userdata` partition (disable OverlayFS), and, as my drive does not support the discard feature, specify the `nodiscard` option:

bootargs-ext=root=PARTUUID=3b89b71b-f8a0-4428-a2c6-1aa516ce065d data= rootflags=nodiscard
  • Insert the eFlasher card into the board, power on, select "eMMC" as the Boot device, and select "Skip Flashing" for the System device to complete flashing:

Eflasher-noflashing-system.png

10.4 Creating image with Btrfs

To create image using Btrfs, pass the FS_TYPE=btrfs parameter when packaging rootfs.img with build-rootfs-img.sh from the sd-fuse_rkXXXX repository. For example:

sudo -E FS_TYPE=btrfs ./build-rootfs-img.sh ubuntu-focal-desktop-arm64/rootfs ubuntu-focal-desktop-arm64

For the complete script, refer to https://github.com/friendlyarm/sd-fuse_rk3588/blob/kernel-6.1.y/test/test-btrfs-rootfs.sh

11 Make Your Own eFlasher

11.1 Manage Multiple OS Images with eFlasher

The eFlasher utility reads image files from the FAT section of an SD card. After an SD card is inserted to a Windows PC you can manage multiple OS images that exist in the SD card with eFlasher.
Under the FAT section of an SD card with multiple OS images each directory under the root directory contains an OS image. The name of such a directory should be named with letters or numbers
If the FAT section is not big enough to hold your multiple OS images you can store them in a USB drive with the same structure
For example there are four directories under the FAT section:
Eflasher-folder
They stand for four OS:
Eflasher-oslist

Files under an OS directory:
Configuration File:

env.conf environmental variables for setting up uboot and kernel parameters
info.conf system information:

title=Android 5 ---> OS name: Android 5
require-board=s5p4418 ---> SoC: S5P4418, options including S5P6818, H3, A64 etc
version=2016-11-17 ---> ROM's version number(or release date)
icon=androidos.png ---> icon
Here is a screenshot:
Eflasher-infoconf

Image File:

2ndboot.bin Second Boot
boot.img image file for boot section
bootloader U-Boot
cache.img image file for Android Cache section
system.img image file for system section
userdata.img image file for user data section
partmap.txt description file for partition map

These image files by default are included in an eFlasher file. These files can be downloaded from a board's corresponding wiki site. Usually an image file is located at the images-for-eflasher directory of a server. Here is how a S5P6818's directory looks like:

EImages-for-eflasher.png

You can download its image file and extract it to the FAT section of an SD card.

11.2 Setting Kernel Boot Parameters (Rockchip Platform Only)

Edit the info.conf configuration file in the OS directory to add the bootargs-ext parameter and set additional kernel boot parameters. For example, to add a parameter that limits the kernel to use a resolution width not exceeding 2048:

bootargs-ext=rockchipdrm.fb_max_sz=2048

To remove a previously specified parameter, you can set it to empty. For example, to remove the userdata parameter:

bootargs-ext=userdata=

To set the kernel boot parameters during the production card creation process, you can refer to the following script:
https://github.com/friendlyarm/sd-fuse_rk3588/blob/kernel-6.1.y/test/test-custom-bootargs.sh

11.3 Make eflasher File with Your OS

Please visit the link next to the CPU model and search for the keyword “Backup rootfs and create custom SD image” in the README.md file.

CPU Link
H3 sd-fuse_h3
H5 sd-fuse_h5
RK3328 sd-fuse_rk3328
RK3399 sd-fuse_rk3399
RK3528 sd-fuse_rk3528
RK3566 sd-fuse_rk3566
RK3568 sd-fuse_rk3568
RK3576 sd-fuse_rk3576
RK3588 sd-fuse_rk3588
S5P4418 sd-fuse_s5p4418
S5P6818 sd-fuse_s5p6818

11.4 Connect WiKi in the EFlasher system

Write the following to the configuration file: /etc/wpa_supplicant/wpa_supplicant.conf, where SSID and PASSWORD should be replaced with the router's SSID and password:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CN
network={
  ssid="SSID"
  psk="PASSWORD"
  key_mgmt=WPA-PSK
}

If the WiFi route does not set a password, set key_mgmt to NONE, delete this line: psk=.

12 Change IP address

For faster startup speed, we set the eflasher to static ip address: 192.168.1.231,

If you want to change to dhcp, you can modify this file:
/etc/network/interfaces.d/eth0

Change the contents of this file to:

auto eth0
iface eth0 inet dhcp

13 Update Log

13.1 July-26-2017

  • Released English Version

13.2 August-22-2017

  • Added section 6.2

13.3 March-10-2018

  • Updated sections 6.2 and 6.3

13.4 July-26-2018

  • Added sections 6 and 7.3.2