| Instructions and Notes working with a KuroBox | |||
|---|---|---|---|
| <<< Previous | Chapter 3. Filling, Configuring, and Pruning the Base File Image | Next >>> | Blog |
Your image filesystem should be starting to look much better. Now you have libraries, the basic layout, an init system (you did ask Busybox to build one, right?), and a bunch of standard UNIX utilities. There are still a few small things you need to tie everything together.
With a 2.4.x kernel in the KuroBox and not using devfs we need to create all the necessary device nodes for the system in the image file itself. The easiest way to do this is to simply copy the ${IMAGE}/dev directory from the Kuro image. Note that you have to be root to create (or copy) device nodes.
Since I suggested enabling the use of devpts above in Busybox we also have to create the directory ${IMAGE}/dev/pts.
The following additional directories will need to be created:
${IMAGE}/etc/init.d because the Busybox init system will look in this directory for the init script (which we'll create later)
${IMAGE}/var/log which is used by the various loggers
${IMAGE}/proc which is required by the kernel
${IMAGE}/tmp
Create the following files with the specified contents:
![]() | The blank for hosts is not a mistake. I'm not sure if things have changed, but I remember there was a time when Busybox wouldn't work right if that file wasn't present, even though it might be empty. |
${IMAGE}/etc/group
root::0:root
|
${IMAGE}/etc/passwd
root::0:0:root:/:/bin/sh
|
${IMAGE}/etc/hosts
${IMAGE}/etc/fstab
/dev/hda1 / ext3 defaults,noatime,errors=remount-ro 0 0
proc /proc proc defaults 0 0
none /dev/pts devpts mode=20 0 0
/dev/hda2 swap swap defaults 0 0
|
By default the Busybox init mechanism will look for an init script at /etc/init.d/rcS. Use this file to setup everything that needs to be setup and to run any daemons your system needs to run.
Here is what mine looks like (of course change the XXX and YYY in the eth0 IP address to match your needs):
#! /bin/sh
# mount filesystems and turn on swap
/bin/mount -a
/sbin/swapon -a
# networking
/sbin/ifconfig lo 127.0.0.1 up
/sbin/ifconfig eth0 192.168.XXX.YYY up
# telnet server
/sbin/telnetd &
# kuro voodoo
/sbin/ppc_uartd
# hdd rw
/bin/mount -o remount -o rw /dev/hda1
|
![]() | Make extra extra sure that you chmod +x this file!! |
Due to the relationship between the Kuro and its ATMEL AVR chip the following modifications should be made:
Add the program ppc_uartd from the Kuro image into your image (the init script will want to run this program).
Change ${IMAGE}/sbin/halt to:
#!/bin/ash
echo -n "EEEE" > /dev/ttyS1
/bin/busybox halt
|
Change ${IMAGE}/sbin/poweroff to:
#!/bin/ash
echo -n "EEEE" > /dev/ttyS1
/bin/busybox poweroff
|
Change ${IMAGE}/sbin/reboot to:
#!/bin/ash
echo -n "CCCC" > /dev/ttyS1
/bin/busybox reboot
|
| <<< Previous | Home | Next >>> |
| Busybox | Up | Getting the Image Together |