야매!개발/리눅스

리눅스에서

qemu를 실행시킬려면..


root file system 이미지를 어떻게든 만들어줘야 합니다.


그런데

root file system을 만드는 방법은

이세상에 아주 많을 것입니다.


그 중 현재까지 제가 알아낸 방법중...

genext2fs 라는 녀석을 이용하는 방법에 대해서


설명해 볼까 해요~~


일단.


소스를 받아 옵니다.


어디에서?


여기에서요^^


http://sourceforge.net/projects/genext2fs/files/latest/download?source=typ_redirect



자. 리눅스에서는

wget명령어로

다음과 같이 받아와 버렸습니다.^^

#wget http://downloads.sourceforge.net/project/genext2fs/genext2fs/1.4.1/genext2fs-1.4.1.tar.gz



그리고

성공하면..다음과 같이 파일이 생기고요~~


[root@localhost tmp]# ls -la

total 116

drwxr-xr-x.  3 root root   4096 Dec  7 17:04 .

dr-xr-x---. 12 root root   4096 Dec  7 17:04 ..

drwxrwsrwx.  3 test test   4096 Apr 20  2007 genext2fs-1.4.1





[root@localhost tmp]# tar xvzf genext2fs-1.4.1.tar.gz



압축을 풀어주고요~~~


이제 컴파일을 하면 됩니다.~~~!!!



[root@localhost genext2fs-1.4.1]# ls -la

total 464

drwxrwsrwx. 3 test test   4096 Apr 20  2007 .

drwxr-xr-x. 3 root root   4096 Dec  7 17:04 ..

-rw-rw-r--. 1 test test  31120 Apr 20  2007 aclocal.m4

-rw-r--r--. 1 test test     38 May  3  2001 AUTHORS

-rw-r--r--. 1 test test     82 Nov 22  2004 ChangeLog

-rw-rw-r--. 1 test test   3782 Apr 20  2007 config.h.in

-rwxrwxr-x. 1 test test 206164 Apr 20  2007 configure

-rw-r--r--. 1 test test   1040 Apr 20  2007 configure.in

-rw-r--r--. 1 test test  17992 May  3  2001 COPYING

-rwxr-xr-x. 1 test test  15936 Jan  7  2007 depcomp

-rw-r--r--. 1 test test   2979 May 13  2005 device_table.txt

-rw-r--r--. 1 test test   5179 Dec  1  2006 genext2fs.8

-rw-r--r--. 1 test test  72491 Mar 26  2007 genext2fs.c

-rw-r--r--. 1 test test    180 Jan  2  2007 INSTALL

-rwxr-xr-x. 1 test test   9233 Jan  7  2007 install-sh

drwxrwsrwx. 2 test test   4096 Apr 20  2007 m4

-rw-r--r--. 1 test test    227 Feb  1  2007 Makefile.am

-rw-rw-r--. 1 test test  21436 Apr 20  2007 Makefile.in

-rwxr-xr-x. 1 test test  11014 Jan  7  2007 missing

-rw-r--r--. 1 test test    182 Apr 20  2007 NEWS

-rw-r--r--. 1 test test    430 May 18  2005 README

-rw-r--r--. 1 test test   1377 Jan  2  2007 test-gen.lib

-rwxr-xr-x. 1 test test   2175 Jan  2  2007 test-mount.sh

-rwxr-xr-x. 1 test test   1939 Dec  1  2006 test.sh

-rw-r--r--. 1 test test    183 Dec  1  2006 TODO



소스의 압축을 풀면 ...

저런 것들(^^)이 보일 것입니다.^^


이중에

./configure

를 실행시켜줘야 합니당~~!

[root@localhost genext2fs-1.4.1]# ./configure

checking for a BSD-compatible install... /usr/bin/install -c

checking whether build environment is sane... yes

checking for gawk... gawk

checking whether make sets $(MAKE)... yes

checking for gcc... gcc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether gcc accepts -g... yes

checking for gcc option to accept ISO C89... none needed

checking for style of include used by make... GNU

checking dependency style of gcc... gcc3

checking for a BSD-compatible install... /usr/bin/install -c

checking for dirent.h that defines DIR... yes

checking for library containing opendir... none required

checking how to run the C preprocessor... gcc -E

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for ANSI C header files... yes

checking for sys/types.h... yes

checking for sys/stat.h... yes

checking for stdlib.h... yes

checking for string.h... yes

checking for memory.h... yes

checking for strings.h... yes

checking for inttypes.h... yes

checking for stdint.h... yes

checking for unistd.h... yes

checking whether sys/types.h defines makedev... yes

checking fcntl.h usability... yes

checking fcntl.h presence... yes

checking for fcntl.h... yes

checking for inttypes.h... (cached) yes

checking limits.h usability... yes

checking limits.h presence... yes

checking for limits.h... yes

checking for memory.h... (cached) yes

checking stddef.h usability... yes

checking stddef.h presence... yes

checking for stddef.h... yes

checking for stdint.h... (cached) yes

checking for stdlib.h... (cached) yes

checking for string.h... (cached) yes

checking for strings.h... (cached) yes

checking for unistd.h... (cached) yes

checking libgen.h usability... yes

checking libgen.h presence... yes

checking for libgen.h... yes

checking getopt.h usability... yes

checking getopt.h presence... yes

checking for getopt.h... yes

checking for an ANSI C-conforming const... yes

checking for uid_t in sys/types.h... yes

checking for inline... inline

checking for size_t... yes

checking for ssize_t... yes

checking for struct stat.st_rdev... yes

checking for getopt_long... yes

checking for getline... yes

checking for strtof... yes

checking for snprintf... yes

checking for vsnprintf... yes

checking for working snprintf... yes

checking for working vsnprintf... yes

checking for stdlib.h... (cached) yes

checking whether scanf can malloc... yes

configure: creating ./config.status

config.status: creating Makefile

config.status: creating config.h

config.status: executing depfiles commands

config.status: executing default commands



이렇게 하면...


./config.status

라는 녀석(파일)이 생깁니다.

이것을 다시 실행해면 ~~~


[root@localhost genext2fs-1.4.1]# ./config.status

config.status: creating Makefile

config.status: creating config.h

config.status: config.h is unchanged

config.status: executing depfiles commands

config.status: executing default commands



Makefile을

만듭니다...

그러면 이제 make를 하면 되겠죠^^!!!

이걸 몰랐네요...

ㅋㅋㅋㅋㅋ

리눅스 무식자여~~~;;;흐흐흐


[root@localhost genext2fs-1.4.1]# make

make  all-am

make[1]: Entering directory '/root/tmp/genext2fs-1.4.1'

if gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2 -MT genext2fs.o -MD -MP -MF ".deps/genext2fs.Tpo" -c -o genext2fs.o genext2fs.c; \

then mv -f ".deps/genext2fs.Tpo" ".deps/genext2fs.Po"; else rm -f ".deps/genext2fs.Tpo"; exit 1; fi

gcc  -g -O2   -o genext2fs  genext2fs.o

make[1]: Leaving directory '/root/tmp/genext2fs-1.4.1'



자 make까지 성공!!!


이제 genext2fs 라는 파일이 생겼겠죠^^?



[root@localhost genext2fs-1.4.1]# ls -la

total 844

drwxrwsrwx. 4 test test   4096 Dec  7 17:10 .

drwxr-xr-x. 3 root root   4096 Dec  7 17:04 ..

-rw-rw-r--. 1 test test  31120 Apr 20  2007 aclocal.m4

-rw-r--r--. 1 test test     38 May  3  2001 AUTHORS

-rw-r--r--. 1 test test     82 Nov 22  2004 ChangeLog

-rw-r--r--. 1 root test   4027 Dec  7 17:06 config.h

-rw-rw-r--. 1 test test   3782 Apr 20  2007 config.h.in

-rw-r--r--. 1 root test  20670 Dec  7 17:08 config.log

-rwxr-xr-x. 1 root test  30687 Dec  7 17:06 config.status

-rwxrwxr-x. 1 test test 206164 Apr 20  2007 configure

-rw-r--r--. 1 test test   1040 Apr 20  2007 configure.in

-rw-r--r--. 1 test test  17992 May  3  2001 COPYING

-rwxr-xr-x. 1 test test  15936 Jan  7  2007 depcomp

drwxr-sr-x. 2 root test   4096 Dec  7 17:10 .deps

-rw-r--r--. 1 test test   2979 May 13  2005 device_table.txt

-rwxr-xr-x. 1 root test 114860 Dec  7 17:10 genext2fs

-rw-r--r--. 1 test test   5179 Dec  1  2006 genext2fs.8

-rw-r--r--. 1 test test  72491 Mar 26  2007 genext2fs.c

-rw-r--r--. 1 root test 174080 Dec  7 17:10 genext2fs.o

-rw-r--r--. 1 test test    180 Jan  2  2007 INSTALL

-rwxr-xr-x. 1 test test   9233 Jan  7  2007 install-sh

drwxrwsrwx. 2 test test   4096 Apr 20  2007 m4

-rw-r--r--. 1 root test  21165 Dec  7 17:08 Makefile

-rw-r--r--. 1 test test    227 Feb  1  2007 Makefile.am

-rw-rw-r--. 1 test test  21436 Apr 20  2007 Makefile.in

-rwxr-xr-x. 1 test test  11014 Jan  7  2007 missing

-rw-r--r--. 1 test test    182 Apr 20  2007 NEWS

-rw-r--r--. 1 test test    430 May 18  2005 README

-rw-r--r--. 1 root test     23 Dec  7 17:08 stamp-h1

-rw-r--r--. 1 test test   1377 Jan  2  2007 test-gen.lib

-rwxr-xr-x. 1 test test   2175 Jan  2  2007 test-mount.sh

-rwxr-xr-x. 1 test test   1939 Dec  1  2006 test.sh

-rw-r--r--. 1 test test    183 Dec  1  2006 TODO




흐...생겼네요~~~

genext2fs!!!!


이런 이런...

왜 난 몰랐을까?


./configure -->./config.status --> make

를 하면 된다는 것을~~~


흐흐흐

리눅스 초보 미친감자여~~

화이팅





0 0