EXYNOS-4412 can not only run Android, but also run a simple Linux minimum file system (Linux without a display interface), let's explain the production of this file system.
To make a filesystem we need to use the BusyBox tool. BusyBox is a software that integrates more than 100 of the most commonly used Linux commands and tools. BusyBox includes simple tools such as LS, cat, and Echo, among others, including larger, more complex tools, such as grep, find, Mount, and Telnet. Some people refer to BusyBox as the Swiss Army knife in the Linux tool. Simply speaking, BusyBox is like a big toolbox, which integrates many of the tools and commands that have been built into Linux, as well as the self-contained shell of the Android system.
BusyBox Download URL is http://www.busybox.net/, this is an open source program, and has been in the update, we use the version is busybox-1.21.1.tar.bz2. Let's take a look at how to make a minimal file system using BusyBox:
First copy the busybox-1.21.1.tar.bz2 to our virtual machine on the Ubuntu system, then perform the decompression command: TAR-XVF busybox-1.21.1.tar.bz2, after the decompression is complete:
Then use the CD command to enter into the BusyBox folder:
The BusyBox compiler configuration and the Linux kernel compiler configuration Use the same command, the following we start to configure the BusyBox, using the command make Menuconfig will appear BusyBox Configuration interface:
We select BusyBox settings as, and then press ENTER to enter the BusyBox settings interface:
In the BusyBox settings configuration option We need to modify two places, the first one is build optiions_> cross Compiler prefix, it is specifying what compiler to compile busybox, check build Options such as, and then press ENTER to enter the build Options Configuration interface:
Select the cross Compiler prefix for the build Options configuration interface, and then press ENTER to enter the cross Compiler prefix configuration interface:
We use the cross-compilation tool arm-none-linux-gnueabi-in the input:
Then press ENTER to return to the build options configuration interface, where you can see the cross-compilation tools we've just set up:
Then use the left and right buttons on the keyboard to select exit:
Then press ENTER to return to the BusyBox settings Setup interface:
Select installation options, and then press ENTER to enter the installation options configuration interface:
Select BusyBox installation prefix as shown, and then press ENTER to enter the BusyBox installation prefix configuration interface (this interface is set to compile the BusyBox, and then install the resulting binaries into which directory):
We delete the./_install inside, and then enter: /system (the resulting binaries will be installed in the system directory at the top-level directory of the current directory):
Then press ENTER to return to the installation Options:
Use the keyboard's right ARROW key to move the cursor to "Exit":
Then press ENTER, return to BusyBox Settings, use the keyboard to the right ARROW key, move the cursor to "Exit":
Then press ENTER to return to the BusyBox Configuration, use the keyboard to the right arrow keys to move the cursor to "Exit":
Then enter a return, pop-up Save Configuration Interface:
Use the keyboard to the right ARROW key, move the cursor to "Yes", then press ENTER to save the configuration, exit the configuration interface:
Now that the BusyBox configuration is complete, we will start compiling the BusyBox and start compiling the BusyBox in the Ubuntu terminal input make command:
As part of the compilation process:
Completed for compilation:
Now that the compilation is complete, we will need to install the compiled binaries into the same file that we specified earlier. In the/system directory, enter the make install command to install the binary file to: /system Directory,:
Done for Make install:
Now we use the CD command to open: /system, look inside the installed files,:
The file system also needs Dev,etc,lib,mnt,proc,sys,tmp,var folder, we need to use command mkdir to create:
Use the CD command to go to the ETC folder that you just created:
Use VI to create the eth0-setting file in the ETC directory and enter the following in the Eth0-setting file:
ip=192.168.1.230
mask=255.255.255.0
gateway=192.168.1.1
dns=192.168.1.1
Mac=08:90:90:90:90:90
:
Then save and exit eth0-setting, and use the chmod command to modify the permissions of the eth0-setting:
In the ETC directory with the mkdir command to establish the INIT.D folder, as follows:
Then use the CD command to go to the Init.d folder:
Under the Init.d folder, use the VI command to create the Ifconfig-eth0 file:
Then enter the following in the Ifconfig-eth0 file:
#!/bin/sh
Echo-n Try to bring eth0 interface Up......>/dev/ttysac2
if [-f/etc/eth0-setting]; Then
Source/etc/eth0-setting
If Grep-q "^/dev/root/nfs"/ETC/MTAB; Then
Echo-n NFS root ... >/dev/ttysac2
Else
Ifconfig eth0 Down
ifconfig eth0 hw ether $MAC
Ifconfig eth0 $IP netmask $Mask up
Route add default GW $Gateway
Fi
echo nameserver $DNS >/etc/resolv.conf
Else
If Grep-q "^/dev/root/nfs"/ETC/MTAB; Then
Echo-n NFS root ... >/dev/ttysac2
Else
/sbin/ifconfig eth0 192.168.253.12 netmask 255.255.255.0 up
Fi
Fi
echo Done >/dev/ttysac2
:
Then save and exit Ifconfig-eth0 and use the chmod command to modify the Ifconfig-eth0 permissions: Vim
Then use the VI command under the INIT.D folder to create the RCS file:
/home/cym/system/etc/init.d
Then enter the following content in the RCS file:
#! /bin/sh
Path=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
Runlevel=s
Prevlevel=n
Umask 022
Export PATH runlevel Prevlevel
#
# Trap Ctrl-c &c only in this shell so we can interrupt subprocesses.
#
Trap ":" INT QUIT TSTP
/bin/hostname iTOP-4412
#/bin/mount-n-T proc None/proc
#/bin/mount-n-T Sysfs None/sys
#/bin/mount-n-T Usbfs none/proc/bus/usb
#/bin/mount-t Ramfs None/dev
[-E/PROC/1] | | /bin/mount-n-T proc None/proc
[-e/sys/class] | | /bin/mount-n-T Sysfs None/sys
[-e/dev/tty] | | /bin/mount-t Ramfs None/dev
Echo/sbin/mdev >/proc/sys/kernel/hotplug
/sbin/mdev-s
#/bin/hotplug
# mounting File system specified In/etc/fstab
Mkdir-p/dev/pts
Mkdir-p/DEV/SHM
/bin/mount-n-T devpts none/dev/pts-o mode=0622
/bin/mount-n-T Tmpfs tmpfs/dev/shm
#/bin/mount-n-T Ramfs none/tmp
#/bin/mount-n-T Ramfs None/var
Mkdir-p/var/empty
Mkdir-p/var/log
Mkdir-p/var/log/boa
Mkdir-p/var/lock
Mkdir-p/var/run
Mkdir-p/var/tmp
Ln-sf/dev/ttys2/dev/tty2
Ln-sf/dev/ttys2/dev/tty3
Ln-sf/dev/ttys2/dev/tty4
Syslogd
/etc/rc.d/init.d/netd start
echo "" >/dev/tty1
echo "Starting networking ..." >/dev/tty1
#sleep 1
#/etc/rc.d/init.d/httpd start
#echo "" >/dev/tty1
#echo "Starting Web server ..." >/dev/tty1
#sleep 1
#/etc/rc.d/init.d/leds start
#echo "" >/dev/tty1
#echo "Starting LEDs service ..." >/dev/tty1
#echo ""
#sleep 1
#echo "*************************************" >/dev/ttysac2
#echo "http://www.topeet.com.cn" >/dev/ttysac2
#echo "*************************************" >/dev/ttysac2
#echo "*************************************"
#echo "http://www.topeet.com.cn"
#echo "*************************************"
Mkdir/mnt/disk
Sleep 1
/sbin/ifconfig Lo 127.0.0.1
/etc/init.d/ifconfig-eth0
:
Then save and exit RCS and use the chmod command to modify the RCS permissions:
Next, enter the LS command to see the two files we created Ifconfig-eth0 and RCS:
Next Use CD: command to return to the top-level directory of INIT.D etc,:
Next in the ETC directory using VI to establish the file passwd:
Enter the following content in the newly created passwd file:
Root::0:0:root:/:/bin/sh
Bin:*:1:1:bin:/bin:
Daemon:*:2:2:daemon:/sbin:
nobody:*:99:99:nobody:/:
Input Result:
Then save and exit passwd, and use the chmod command to modify the permissions of the passwd:
Then use the VI command to create a profile in the ETC directory:
Then enter the following content in the profile:
# Ash Profile
# Vim:syntax=sh
# No core Files by default
Ulimit-s-C 0 >/dev/null 2>&1
User= "' Id-un '"
Logname= $USER
Ps1= ' [[email protected] $HOSTNAME]# '
Path= $PATH
Hostname= '/bin/hostname '
Export USER LOGNAME PS1 PATH
Input Result:
Then save and exit profile and use the chmod command to modify the profile's permissions:
Next use the mkdir command to create a folder rc.d in the ETC directory:
Use the CD command to go to the Rc.d folder that you just created:
Next, use mkdir to create the Init.d folder under the RC.D directory:
Then use the CD command to go to the Init.d folder that you just created:
Then in the Init.d folder, use the VI command to create the netd file:
Then enter the following in the netd file:
#!/bin/sh
Base=inetd
# See how we were called.
Case "$" in
Start
/usr/sbin/$base
;;
Stop
Pid= '/bin/pidof $base '
If [-N "$pid"]; Then
Kill-9 $pid
Fi
;;
Esac
Exit 0
Enter the result:
Then save and exit netd, and use the chmod command to modify the netd permissions.
Then use the CD. /.. /command to return to the ETC directory,
Then use the CD. command to return to the system directory,
Then use the CD command to enter the Lib directory,
Because the cross-compilation environment we use is the same as the compiled kernel, our compiler runs as a/usr/local/arm/arm-2009q3,busybox compiled binary 11 dynamic-link library, So we need to copy the library files from the compiler to the Lib directory, using the following command:
/usr/local/arm/arm-2009q3/arm-none-linux-gnueabi/libc/lib/*./
Execution Result:
You can use the LS command to view the copied library files.
After the library file copy is complete, use the CD. command to return to the system directory,
Next, use the CD command to enter the Var directory,
Then use the mkdir command to create a lib,lock,log,run,tmp five directory under the Var directory,
We can use the LS command to view the created directories,
At this point, the files required by the file system have been created, using the CD. /.. /command to return to the top level directory of the System folder
The tool for making the package, copy the "Linux_tools.tgz in CD \tools" file to Ubuntu "/" directory, extract to "/" directory.
Below we can use the command make_ext4fs-s-l 314572800-a root-l Linux system.img system to generate System.img file system image
We can use the LS command to look at the generated system.img
Now that we have completed the production of the Linux file system, we can burn the system.img we made to the iTOP-4412 Development Board, burning the same way as the Android file system.
This article is from the "Mao Scattered People" blog, please be sure to keep this source http://songmao.blog.51cto.com/11700139/1876869
Production of Linux file system without interface based on Topeer 4412 Development Board