ODROID-7에서 테스트된 리눅스 루트 파일 시스템입니다.
ODROID-E7에도 적용 가능합니다.
Auto-Login을 구현하여, SDL 및 간단한 어플까지 만들어 모두 자동으로 실행하는 실용적인 예제가 될것 같습니다.
How to make a Small embedded Linux root file !
I found a generic embedded root file system with EABI by Googling.
http://ftp.falinux.com/toolchain_ramdisk/recommendation/gcc-4.3.2/
At this moment, this link is broken.
To implement the auto login, I need to cross compile the mingetty in the Sourceforge.
http://sourceforge.net/projects/mingetty/
After compilation, the generated file must be copied in to /bin directory.
Add below line in to /etc/inittab for automatic login as a super user(root)
T0:12345:respawn:/bin/mingetty --autologin=root ttySAC2 115200 vt100
To test this root file system, I copied it to the system partition(mmcblk0p2) of Odroid-7.
And I changed bootargs as below.
For ODROID-7 (S5PC110/EXYNOS-3110)
setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4 init=/sbin/init console=ttySAC2,115200 rootdelay=1'
setevn bootcmd 'movi read kernel 30008000;bootm 30008000'
savenv
For ODROID-E7 (S5P6450 ARM11)
setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4 init=/sbin/init console=ttySAC2,115200 rootdelay=1'
setevn bootcmd 'movi read kernel E0008000;bootm E0008000'
savenv
To make a SDL and application software, I followed below sequence.
Toolchain
Sourcery G++ Lite 2010.09-50 (GNUEABI version)
https://sourcery.mentor.com/sgpp/portal/release1600
* Note: EABI version can’t compile SDL correctly. Must use the GNUEABI version.
SDL source code
http://www.libsdl.org/download-1.2.php
Source code location on host PC
/home/justin/sdl/SDL-1.2.14 (This is my working directory. It is just an example!)
Compile SDL
export CC=arm-none-linux-gnueabi-gcc
./configure --host=arm-none-linux-gnueabi --prefix=/home/justin/sdl/compiled --without-x
make -j 4
make install
* Note: Modify the SDL-1.2.14/src/video/fbcon/SDL_fbvideo.c
Comment out the mouse related code in FB_VideoInit() function.
Compile sdl test (Modify the SDL init function to 800×480 resolution and 32bit color, if the application uses graphic layer.)
./configure --host=arm-none-linux-gnueabi --with-sdl-prefix=/home/justin/sdl/compiled --disable-sdltest
make -j 4
Compile Freetype
http://download.savannah.gnu.org/releases/freetype/freetype-2.1.10.tar.gz
./configure --host=arm-none-linux-gnueabi --without-zlib --prefix=/home/justin/sdl/compiled
make -j 4
make install
Compile SDL_ttf to display fonts.
http://www.libsdl.org/projects/SDL_ttf/SDL_ttf-2.0.10.tar.gz
./configure --host=arm-none-linux-gnueabi --prefix=/home/justin/sdl/compiled --with-freetype-prefix=/home/justin/sdl/compiled --with-sdl-prefix=/home/justin/sdl/compiled
#undef HAVE_ICONV ==> showfont.c ( Modify this to avoid annoying error. But, this one should be fixed for proper display of 2-byte languages.)
make -j 4
make install
showfont executable file is generated in .lib directory.
SDL_ShowCursor(SDL_DISABLE); //To hide the mouse cursor !!!
Download and Install font.
http://ftp.gnu.org/gnu/freefont/freefont-ttf-20100919.tar.gz
Uncompress and copy the fonts in to /usr/fonts/ directory.
Let’s test.
./showfont -i ../fonts/FreeSerif.ttf 30
To execute this application automatically, add below line in /root/.bashrc !!
/usr/bin/showfont -i /usr/fonts/FreeSerif.ttf 30
Finally we made a simple and useful root file system.
This is very light and fast embedded linux root file system.
Size is 35Mbyte approximately.
Get this root file system from
http://dev.odroid.com/projects/odroid-t/download/note/76
Reference.
http://www.crosscompile.org/static/pages/SDL.html