Linux root file system generation based on zynq

Linux Root Filesystem (root file system) is essential, commonly used BusyBox, this section describes the use of BusyBox to make Linux root file system rootfs, mainly refer to the Zynq Root FileSystem CreaTIon method on the xilinx wiki:

1. Preparation:

First of all, the ARM GNU cross-compilation environment is built in Ubuntu. The author uses the Ubuntu 11.04 platform.

Download BusyBox via Git:
Git clone git://git.busybox.net/busybox

2. Compile and install BusyBox

Enter BusyBox on the Ubuntu platform to initialize the default configuration:
Cd busybox
Make defconfig

Custom configuration BusyBox, will pop up the graphical interface settings window, as shown in Figure 1.
Make menuconfig

Linux root file system generation based on zynq

Go to BusyBox SetTIngs->InstallaTIon OpTIons->BusyBox installationprefix to set the installation directory of BusyBox, set it to /home/devel/_rootfs, as shown in Figure 2.

Linux root file system generation based on zynq

Once the configuration is complete, enter the following script to install BusyBox:
Make install

In the set directory will generate rootfs, which contains the bin, sbin, usr / bin and usr / sbin directory, which contains our commonly used commands, these commands are soft links to bin / busybox, as shown in Figure 3 Show.

Linux root file system generation based on zynq

3. Compile and install Dropbear
Dropbear provides support for SSH client/server functionality.

Download Dropbear from the Dropbear website and unzip it:
Wget
Tar xfvz dropbear-0.53.1.tar.gz
Cd dropbear-0.53.1

Configure Dropbear:
./configure --prefix=/home/devel/_rootfs --host=arm-xilinx-linux-gnueabi --disable-zlib CC=arm-xilinx-linux-gnueabi-gcc LDFLAGS="-Wl,--gc- Sections" CFLAGS="-ffunction-sections -fdata-sections -Os"

Compile Dropbear:
Make PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 strip

Install Dropbear and create a link in rootfs, as shown in Figure 4 for the generated scp
Sudo make install
Ln -s ../../sbin/dropbear /home/devel/_rootfs/usr/bin/scp

Linux root file system generation based on zynq

4. Toolchain and application configuration

I need to copy the library of the Xilinx ARM toolchain to the lib folder in rootfs. Since I have not installed the ISE suite on the Ubuntu platform, I copied it from the Windows platform and the location on the Windows platform: *:\Xilinx\14.2\ ISE_DS\EDK\gnu\armt\arm-xilinx-linux-gnueabi\libc\lib

Then copy the files from libc/sbin and libc/usr/bin.

5. Other directory generation and configuration

Other directories need to be created in rootfs, as follows:
Mkdir dev etc etc/dropbear etc/init.d mnt opt ​​proc root sys tmp var var/log var/>

Linux root file system generation based on zynq

Create the etc/fstab file: sudo gedit etc/fstab, the contents of the file are as follows:
LABEL=/ / tmpfs defaults 0 0
None /dev/pts devpts gid=5,mode=620 0 0
None /proc proc defaults 0 0
None /sys sysfs defaults 0 0
None /tmp tmpfs defaults 0 0

Create the etc/inittab file: sudo gedit etc/inittab, the contents of the file are as follows:
::sysinit:/etc/init.d/rcS

# /bin/ash
#
#Start an askfirst shell on the serial ports

ttyPS0::respawn:-/bin/ash

# What to do when restarting the init process

::restart:/sbin/init

# What to do before rebooting

::shutdown:/bin/umount -a –r

Create the etc/passwd file: sudo gedit etc/passwd, the contents of the file are as follows:
Root:Linux root file system generation based on zynqqC.CEbjC$SVJyqm.IG.gkElhaeM.FD0:0:0:root:/root:/bin/sh

Create the etc/init.d/rcS file: sudo gedit etc/init.d/rcS, the contents of the file are as follows:
#!/bin/sh

Echo "Starting rcS..."

Echo "++ Mounting filesystem"
Mount -t proc none /proc
Mount -t sysfs none /sys
Mount -t tmpfs none /tmp

Echo "++ Setting up mdev"

Echo /sbin/mdev > /proc/sys/kernel/hotplug
Mdev -s

Mkdir -p /dev/pts
Mkdir -p /dev/i2c
Mount -t devpts devpts /dev/pts

Echo "++ Starting telnet daemon"
Telnetd -l /bin/sh

Echo "++ Starting http daemon"
Httpd -h /var/>

Echo "++ Starting ftp daemon"
Tcpsvd 0:21 ftpd ftpd -w /&

Echo "++ Starting dropbear (ssh)daemon"
Dropbear

Echo "rcS Complete"

Set the permissions for etc/init.d/rcS:
Chmod 755 etc/init.d/rcS
Sudo chown root:root etc/init.d/rcS

At this point, the rootfs directory is created.

6. Generate ramdisk image file

The rootfs want to be recognized, they need to be made into a mirror image file, and compressed. The following script is to create an image file:
Cd ~
Dd if=/dev/zero of=ramdisk8M.image bs=1024 count=8192
Mke2fs -F ramdisk8M.image -L "ramdisk" -b 1024 -m 0
Tune2fs ramdisk8M.image -i 0
Chmod 777 ramdisk8M.image

Create a new ramdisk directory and load ramdisk8M.image into the directory:
Mkdir ramdisk
Mount -o loop ramdisk8M.image ramdisk/

Copy the files in the _rootfs/ directory to the ramdisk:
Cp -R /home/devel/_rootfs/* ramdisk

Uninstall ramdisk after copying
Umount ramdisk/

Finally compress the ramdisk8M.image file:
Gzip -9 ramdisk8M.image

The ramdisk8M.image.gz image file is generated, as shown in Figure 6.

Aluminum Extrusion Radiator

Aluminum Extrusion Radiator,Led Heat Sink Aluminum,Heatsink Extrusion Profiles,Aluminium Heatsinks

Original Electronics Technology (Suzhou) Co., Ltd. , http://www.original-te.com