Difference between revisions of "EFlasher"
(→制作自已的量产Eflasher烧写卡) |
(→制作自已的量产Eflasher烧写卡) |
||
Line 88: | Line 88: | ||
You can download its image file and extract it to the FAT section of an SD card. | You can download its image file and extract it to the FAT section of an SD card. | ||
− | === | + | ===Make eflasher File with Your OS=== |
Note: this only applies for 4418 and 6818 based boards<br /> | Note: this only applies for 4418 and 6818 based boards<br /> | ||
Here are the steps for making an eFlasher card with UbuntuCore for 4418 based boards:<br /> | Here are the steps for making an eFlasher card with UbuntuCore for 4418 based boards:<br /> | ||
Line 96: | Line 96: | ||
sudo losetup ${DEV} s5p4418-eflasher-sd8g-$(date +%Y%m%d).img | sudo losetup ${DEV} s5p4418-eflasher-sd8g-$(date +%Y%m%d).img | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | If you make an | + | If you make an eflasher card for 6818 based boards you need to change "sd-fuse_nanopi2.git" to "sd-fuse_nanopi3.git" and rename "s5p4418" to "s6p6818".<br/><br/> |
− | + | After these commands are successfully run an eflasher image named "s5p4418-eflasher-sd8g-YYYYMMDD.img" will be generated. But this image doesn't contain an OS file. Running the following commands will generate a UbuntuCore image file. You can use your OS image's file name to replace the "core-qte-images.tfz" to the following commands to insert your OS to the eflasher file: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo partprobe ${DEV} | sudo partprobe ${DEV} | ||
Line 107: | Line 107: | ||
sudo losetup -d ${DEV} | sudo losetup -d ${DEV} | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | For 6818 based boards change "http://112.124.9.243/dvdfiles/S5P4418" to "http://112.124.9.243/dvdfiles/S5P6818".<br /><br /> | |
− | + | After these commands are successfully run an "s5p4418-eflasher-sd8g-YYYYMMDD.img" file with a Ubuntu core OS image will be generated. You can use the "dd" command to flash it to an SD card and flash your OS to your board's eMMC. | |
===Make Your Own OS Image=== | ===Make Your Own OS Image=== |
Revision as of 08:42, 22 August 2017
Contents
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;
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-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)
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)
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
- 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 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.
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, press and hold the "BOOT" button, power on your board.
3 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:
Select your wanted OS to start installation.
4 Commandline Based eFlasher
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:
5 Automate OS Installation at System Startup
You can automate OS installation with eFlash 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 .
6 Make Your Own eFlasher
6.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:
They stand for four OS:
Files under an OS directory:
Configuration File:
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:
You can download its image file and extract it to the FAT section of an SD card.
6.2 Make eflasher File with Your OS
Note: this only applies for 4418 and 6818 based boards
Here are the steps for making an eFlasher card with UbuntuCore for 4418 based boards:
sudo ./mkimage.sh eflasher DEV=`sudo losetup -f` sudo losetup ${DEV} s5p4418-eflasher-sd8g-$(date +%Y%m%d).img
If you make an eflasher card for 6818 based boards you need to change "sd-fuse_nanopi2.git" to "sd-fuse_nanopi3.git" and rename "s5p4418" to "s6p6818".
After these commands are successfully run an eflasher image named "s5p4418-eflasher-sd8g-YYYYMMDD.img" will be generated. But this image doesn't contain an OS file. Running the following commands will generate a UbuntuCore image file. You can use your OS image's file name to replace the "core-qte-images.tfz" to the following commands to insert your OS to the eflasher file:
sudo partprobe ${DEV} sudo mkfs.vfat ${DEV}p1 -n FRIENDLYARM sudo mkdir -p /mnt/fat sudo mount -t vfat ${DEV}p1 /mnt/fat sudo wget -qO- http://112.124.9.243/dvdfiles/S5P4418/images-for-eflasher/core-qte-images.tgz | tar xvz -C /mnt/fat sudo umount /mnt/fat sudo losetup -d ${DEV}
For 6818 based boards change "http://112.124.9.243/dvdfiles/S5P4418" to "http://112.124.9.243/dvdfiles/S5P6818".
After these commands are successfully run an "s5p4418-eflasher-sd8g-YYYYMMDD.img" file with a Ubuntu core OS image will be generated. You can use the "dd" command to flash it to an SD card and flash your OS to your board's eMMC.
6.3 Make Your Own OS Image
6.3.1 Make Android Image for 4418/6818
First of all you need to compile your Android source code. After compilation is finished enter the "out/target/product/XXXXX" directory ("XXXXX" stands for a product's name. For example 4418 SoC's name is "nanopi2" and 6818 SoC's name is "nanopi3") and replace the following file with the one under the Android directory of the FAT section of your SD card:
6.3.2 Make Linux Image for 4418/6818
You need to make a boot.img file for the boot section and a rootfs.img file for the rootfs section and replace the corresponding files in the eFlasher.
1) Download https://github.com/friendlyarm/debian_nanopi2 ;
2) Copy the files under the boot section of your SD card to "debian_nanopi2/boot" and the files under the rootfs section of your SD card to "debian_nanopi2/rootfs"
Make necessary changes in the files under the boot section and rootfs section accordingly.
We recommend to delete the "etc/fs.resized" file under the rootfs directory otherwise this section will not be automatically extended.
3) Use the make_ext4fs utility under the "debian_nanopi2" directory to make an img file:
./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) Move your newly generated boot.img and root.img files to the core-qte directory under the FAT section of eflasher to replace corresponding files and this will be your new eFlasher.
6.3.3 Make Linux Image for H3/H5
You need to make a boot.img file for the boot section and a rootfs.img file for the rootfs section and replace the corresponding files in the eFlasher.
1) Download: EFlasher-build-tools;
2) Make the whole rootfs section an ext4 formatted img file:
$ ./make_ext4fs -s -l 2097152000 -a root -L /SD/rootfs rootfs.img rootfs
-l specifies the size of an img file in the unit of Byte, 2097152000 Byte=2000MB. This number must be larger than the size of the "/SD/rootfs" directory.
3) Make the whole boot section a FAT formatted img file.
$ ./build-boot-fat.sh boot.img /SD/boot 40
40 means the size of boot.img is 40M.
4) Move your newly generated boot.img and root.img files to the FAT section of eflasher-ROM to replace corresponding files and this will be your new eFlasher.
7 Update Log
7.1 July-26-2017
- Released English Version