Getting started with Kamikaze on the WL500GP
From Crashcourse Wiki
Contents |
What do you mean, "getting started?"
This page leads you through how to examine the contents of your newly-flashed router, so you can get familiar with the files and directories, as well as the various utilities you can run to see the state of your system. It doesn't get into more advanced topics like software management or networking -- those are covered in subsequent topics. The emphasis of this page is just a guided tour of your new OpenWrt system.
Also, and not surprisingly, a lot of this can be applied to OpenWrt installations on other routers.
The login account(s)
Initially, Kamikaze has only the root user account, whose home directory is set up as /tmp. You might want to edit /etc/passwd and change root's home directory to / if you think it's more convenient.
Set the date and time
Chances are the initial date and time are totally wrong, so set them correctly, as in:
# date 013112002008 [Set to Jan 31, 12 noon, 2008.]
The installed packages
Before you do anything with packages, you should first update your local list of available packages with:
# ipkg update
Note well that this doesn't actually update your packages, it merely updates the local list of packages that are available through your feeds. Once that's done, try each of:
# ipkg list_installed [list installed packages] # ipkg list [list available packages]
There will be a much more comprehensive coverage of software management with ipkg later.
The /proc directory
Not surprisingly, there's a wealth of information in the /proc directory, such as:
# cat /proc/cmdline # cat /proc/cpuinfo # cat /proc/devices # cat /proc/filesystems # cat /proc/interrupts # cat /proc/meminfo # cat /proc/modules # cat /proc/mtd # cat /proc/partitions # cat /proc/version
and, naturally, quite a bit more. Spend some time there poking around.
The filesystems
The WL500GP has 8M of flash memory, and you can see the layout thusly:
# mount rootfs on / type rootfs (rw) /dev/root on /rom type squashfs (ro) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /tmp type tmpfs (rw,nosuid,nodev) tmpfs on /dev type tmpfs (rw) none on /dev/pts type devpts (rw) /dev/mtdblock3 on /jffs type jffs2 (rw) mini_fo:/jffs on / type mini_fo (rw)
# df Filesystem 1k-blocks Used Available Use% Mounted on none 14996 32 14964 0% /tmp tmpfs 512 0 512 0% /dev /dev/mtdblock3 6080 432 5648 7% /jffs mini_fo:/jffs 1088 1088 0 100% /
Here's how you read the above. First, the original (and unchangeable) root filesystem is of type squashfs, and takes up 1088 blocks of flash. That part of flash is fixed, and can't be modified without reflashing. You can examine its contents under the mount point /rom, but you can't change any of it:
# touch /rom/fubar # touch: /rom/fubar: Read-only file system
Most of the remainder of flash is taken up by a "mini_fo:/jffs" filesystem, which records the changes to the root filesystem. You can examine those contents under /jffs, and you can see from the above that that filesystem is (in this case) 6080 blocks in size, only 432 of which are currently used. However, as you start to configure your system and add new files or edit existing files, that filesystem will get more full all the time.
Finally, the filesystems corresponding to the directories /tmp, /dev, /proc and /sys exist only in RAM and don't cost you any flash storage.
The boot sequence
Very briefly (since we can get into more detail later), here's the boot sequence. First, you can see the kernel command line with:
# cat /proc/cmdline root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200
Based on the above, the steps in the boot sequence are:
- The kernel is loaded and eventually passes control to ...
- /etc/preinit, which terminates with a call to ...
- /sbin/init, which consults ...
- /etc/inittab, which at boot time, invokes ...
- /etc/init.d/rcS S boot, which will invoke all files of the form ...
- /etc/rc.d/S* with the argument boot.
More to come ...
Return to OpenWrt on the ASUS WL-500g Premium

