NFS 이용한 RootFileSystem (Rebis 보드)
== 글 ==/Embedded 2008. 3. 7. 23:07 |==== ramdisk를 보드에 직접 안올리고 부팅하기 ====
# cd /tftpboot
# mkdir myrootdir
# mkdir tmp
ramdisk 집파일을 풀어 준 후 tmp 폴더에 마운트 시켜준다음
tmp 폴더의 모든 내용을 ramdisk파일 대신 쓸 myrootdir 폴더로 옮겨준다.
# gunzip ramdisk-rebis.gz
# mount -o loop ramdisk-rebis ./tmp
# cp -rf ./tmp/* ./myrootdir
ps.
# vi /tftpboot/myrootdir/tmp/rebis2440_cfg
에서 주소값이 제대로 설정되어 있는지 확인 필수!!!
이거 때문에 kernel panic 나와서 1시간 삽질했다...
==== 커널설정 ====
이전에 .config 파일은 백업해두는 센스!!
# make menuconfig
========================
Block devices ---->
-----------------------
< > Normal PC floppy disk support
< > XT hard disk support
<*> Loopback device support
< > Network block device support
< > RAM disk support
========================
Block devices ---->
-----------------------
< > Normal PC floppy disk support
< > XT hard disk support
<*> Loopback device support
< > Network block device support
< > RAM disk support
========================
========================
Networking options ---->
-----------------------
<*> Unix domailn sockets
[*] TCP/IP networking
[ ] IP: multicasting
[ ] IP: advanced router
[*] IP: kernel level autoconfiguration
[ ] IP: DHCP support (NEW)
[*] IP: BOOTP support (NEW)
[ ] IP: RARP support (NEW)
< > IP: tunneling
< > IP: GRE tunnels over IP
=========================
Networking options ---->
-----------------------
<*> Unix domailn sockets
[*] TCP/IP networking
[ ] IP: multicasting
[ ] IP: advanced router
[*] IP: kernel level autoconfiguration
[ ] IP: DHCP support (NEW)
[*] IP: BOOTP support (NEW)
[ ] IP: RARP support (NEW)
< > IP: tunneling
< > IP: GRE tunnels over IP
=========================
=========================
Network File Systems ---->
------------------------
< > Coda file system support (advanced network fs)
< > InterMazzo file system support (experimental, replicating fs)
<*> NFS file system support
[*] Provide NFSv3 client support
[*] Root file system on NFS
<*> NFS server support
[*] Provide NFSv3 server support
< > SMB file system support (to mount Windows shares etc.)
< > NCP file system support (to mount NetWare volumes)
=========================
Network File Systems ---->
------------------------
< > Coda file system support (advanced network fs)
< > InterMazzo file system support (experimental, replicating fs)
<*> NFS file system support
[*] Provide NFSv3 client support
[*] Root file system on NFS
<*> NFS server support
[*] Provide NFSv3 server support
< > SMB file system support (to mount Windows shares etc.)
< > NCP file system support (to mount NetWare volumes)
=========================
=========================
General setup ---->
------------------------
< > FastFPE math emulation (experimental)
(ELF) Kernel core (/proc/kcore) format
<*> Kernel suppoert for a. out binaries
<*> Kernel suppoert for ELF binaries
< > Kernel suppoert for MISC binaries
[ ] Power Management support (experimental)
<*> RISC OS personality
default kernel command string : <<<< 여기에 입력 >>>>
[*] Timer and CPU usage LEDs
[*] Kernel-mode alignment trap handler
==========================
General setup ---->
------------------------
< > FastFPE math emulation (experimental)
(ELF) Kernel core (/proc/kcore) format
<*> Kernel suppoert for a. out binaries
<*> Kernel suppoert for ELF binaries
< > Kernel suppoert for MISC binaries
[ ] Power Management support (experimental)
<*> RISC OS personality
default kernel command string : <<<< 여기에 입력 >>>>
[*] Timer and CPU usage LEDs
[*] Kernel-mode alignment trap handler
==========================
<<<< 여기에 입력 >>>> 부분에
root=/dev/nfs rw nfsroot=192.168.0.1:/tftpboot/myrootdir ip=192.168.0.10:192.168.0.1:192.168.0.1:255.255.255.0::eth0:off
-> 두줄이 아니라 한줄이다.
(server IP) , (board IP), (server IP), (gateway), (netmask) 순...
-> 두줄이 아니라 한줄이다.
(server IP) , (board IP), (server IP), (gateway), (netmask) 순...
server IP => 192.168.0.1
board IP => 192.168.0.10
gateway => 192.168.0.1
netmask => 255.255.255.0
여까지 되었으면 menuconfig 저장하고 나와서
# make dep && make zImage
==== 보드 설정 ====
REBIS # set serverip = 192.168.0.1
REBIS # set gatewayip = 192.168.0.1
REBIS # set ipaddr = 192.168.0.10
REBIS # setenv bootargs root=/dev/nfs rw nfsroot=192.168.0.1:/tftpboot/myrootdir ip=192.168.0.10:192.168.0.1:192.168.0.1:255.255.255.0::eth0:off -> 두줄이 아니고 한줄
(server ip),(board ip),(server ip),(gateway),(netmask) 순으로 입력
REBIS # setenv bootcmd tftp 32000000 zImage-rebis\;go 32000000
REBIS # save
REBIS # set gatewayip = 192.168.0.1
REBIS # set ipaddr = 192.168.0.10
REBIS # setenv bootargs root=/dev/nfs rw nfsroot=192.168.0.1:/tftpboot/myrootdir ip=192.168.0.10:192.168.0.1:192.168.0.1:255.255.255.0::eth0:off -> 두줄이 아니고 한줄
(server ip),(board ip),(server ip),(gateway),(netmask) 순으로 입력
REBIS # setenv bootcmd tftp 32000000 zImage-rebis\;go 32000000
REBIS # save
이제 보드 리셋하고 그냥 있으면 알아서 부팅한다.