Hi
I have run into a few problems with building 7.09. Thought I would summarize them here.
I am building for a WL500Gp with Atheros minipci card.
I have
* svn co https://svn.openwrt.org/openwrt/tags/kamikaze_7.09 7.09
* applied by boot usb patch (see below)
* make package/symlinks
* make menuconfig
** changed the static ip information
** built into the image these modules
*** kmod-fs-ext2
*** kmod-fs-ext3
*** fdisk
*** e2fsprogs
*** libuuid
*** kmod-usb2
*** kmod-usb-core
*** kmod-usb-storage
*** kmod-scsi-core
* make
* run mtd -e linux write openwrt-brcm47xx-2.6-squashfs.trx linux on the router
* waited for the system to settle (firstboot)
* reboot
* fdisk /dev/sda - create 1 Big partition - ext2
* mount /dev/sda1 /mnt
* mount -o bind / /tmp/root
* cp /tmp/root/* /mnt -a
* umount /mnt
* reboot
This failed. On my working image (7.07) where I can boot from usb stick, I did not include the extra modules in the image, but ipkg installed them on the first reboot.
Attempting to debug this (7.09) I replaced perinit back to original and updated /sbin/init (see below), to try and capture some output and error messages
whilst doing this I became aware of a lot of segfaults that I was getting, at random times, different applications would fail. trying ps would fail, but if I trued /bin/ps it would work. saying that if I tried /bin/busybox ps it would fail. But no constantly
also noticed that my root partition was actually a jffs not squish - i think this is just me not understanding the fs status right now
I can see that all the modules are loaded, hotplug2 is loaded and running and prepped for usb, i can see the device I can run mount, but for some reason I can run mount /dev/sda1 /mnt. I have ext2 and ext3 loaded. I have attached my last init.text as the bottom
can find any pointers on where to go from here.
There has been some suggestions to go back to 2.4, but I want the 2.6 kernel for some of the iptables & ipv6 stuff.
I will try now going back to my 7.07 build, with out the extra packages, just to prove to my self that it is possible and then work forward from there!
Boot USB patch - worked out form other post
Index: package/base-files/files/etc/preinit
===================================================================
--- package/base-files/files/etc/preinit (revision 8766)
+++ package/base-files/files/etc/preinit (working copy)
@@ -64,4 +64,40 @@
echo "- init -"
killall hotplug2
+
+# Boot usb stick
+exec > /etc/preinit.text 2>&1
+set -x
+
+/sbin/hotplug2 --persistent &
+
+echo /sbin/hotplug-call > /proc/sys/kernel/hotplug
+
+for module in usbcore usb-ohci ehci-hcd uhci-hcd scsi_mod sd_mod usb-storage jbd ext3 ; do {
+ insmod $module
+}; done
+
+sleep 30s
+boot_dev="/dev/sda1"
+mount -o rw,noatime $boot_dev /mnt
+
+# if everything looks ok, do the pivot root
+killall hotplug2
+
+[ -x /mnt/sbin/init ] && {
+ mount -o move /proc /mnt/proc && \
+ pivot_root /mnt /mnt/rom && {
+ mount -o move /rom/dev /dev
+ mount -o move /rom/rom/sys /sys
+ mount -o move /rom/tmp /tmp
+ # umount /rom/tmp
+ set +x
+ exec <$M0 >$M1 2>&0
+ exec /sbin/init
+ }
+ # umount $boot_dev
+}
+
+set +x
+exec <$M0 >$M1 2>&0
exec /sbin/init
/sbin/init
# Boot usb stick
exec >> /etc/init.text 2>&1
set -x
echo ======
date
echo ======
# start hotplug
# Same as in preinit
/sbin/hotplug2 --persistent &
# force hotplug-call
echo "/sbin/hotplug-call" > /proc/sys/kernel/hotplug
/bin/ls -l /
/bin/ls -l /var
/bin/ls -l /mnt
echo ======
/bin/mount -t usbfs none /proc/bus/usb
echo ======
# Load Modules
echo "Load Modules"
for module in usbcore ehci-hcd scsi_mod sd_mod usb-storage jbd ext3
do
{
/sbin/insmod $module
}
done
sleep 30s
usb=0
echo ======
cat /proc/partitions
echo ======
cat /proc/modules
echo ======
/bin/mount
echo ======
/bin/ps
echo ======
# Mount boot_dev
if /bin/mount /dev/sda1 /mnt || /bin/mount -t ext2 -o rw,noatime /dev/sda1 /mnt || /bin/mount
-t ext3 -o rw,noatime /dev/sda1 /mnt
then
# Check filesystem
if [ -e /mnt/usb.boot ] && [ -x /mnt/sbin/init ]
then
echo "Loading USB Storage as root"
echo ======
cat /proc/partitions
echo ======
cat /proc/modules
echo ======
fi
#[ $usb -eq 0 ] && {
# umount /mnt
#}
fi
# Kill hotplug
killall hotplug2
exec
exec /bin/busybox init $@
init.text output
+ echo ======
======
+ date
Sat Jan 1 00:00:05 UTC 2000
+ echo ======
======
+ /sbin/hotplug2 --persistent
+ echo /sbin/hotplug-call
+ /bin/ls -l /
drwxr-xr-x 2 root root 486 Sep 13 2007 bin
drwxrwxrwt 4 root root 660 Jan 1 00:00 dev
drwxr-xr-x 6 root root 0 Jan 1 00:10 etc
drwxr-xr-x 6 root root 0 Jan 1 1970 jffs
drwxr-xr-x 7 root root 431 Sep 13 2007 lib
drwxr-xr-x 3 root root 0 Jan 1 00:00 mnt
dr-xr-xr-x 28 root root 0 Jan 1 00:00 proc
drwxr-xr-x 15 root root 136 Sep 13 2007 rom
drwxr-xr-x 2 root root 0 Jan 1 00:02 sbin
drwxr-xr-x 10 root root 0 Jan 1 00:00 sys
drwxrwxrwt 2 root root 60 Jan 1 00:00 tmp
drwxr-xr-x 6 root root 47 Sep 13 2007 usr
lrwxrwxrwx 1 root root 4 Sep 13 2007 var -> /tmp
drwxr-xr-x 2 root root 3 Sep 13 2007 www
+ /bin/ls -l /var
lrwxrwxrwx 1 root root 4 Sep 13 2007 /var -> /tmp
+ /bin/ls -l /mnt
drwxr-xr-x 2 root root 0 Jan 1 00:00 t
+ echo ======
======
+ /bin/mount -t usbfs none /proc/bus/usb
mount: mounting none on /proc/bus/usb failed
+ echo ======
======
+ echo Load Modules
Load Modules
+ /sbin/insmod usbcore
+ /sbin/insmod ehci-hcd
+ /sbin/insmod scsi_mod
+ /sbin/insmod sd_mod
+ /sbin/insmod usb-storage
+ /sbin/insmod jbd
+ /sbin/insmod ext3
+ sleep 30s
Segmentation fault
vconfig: ioctl error for add: Invalid argument
/sbin/hotplug-call: /etc/hotplug.d/usb/10-usb-storage: 12: /sbin/usb-storage: Permission denie
d
/bin/uci: /bin/uci: 189: cannot create /var/state/network: Directory nonexistent
device eth0.0 is already a member of a bridge; can't enslave it to bridge br-lan.
device br-lan already exists; can't create bridge with the same name
device eth0.0 is already a member of a bridge; can't enslave it to bridge br-lan.
/bin/uci: /bin/uci: 189: cannot create /var/state/network: Directory nonexistent
/sbin/hotplug-call: .: 1: Can't open /var/state/network
/bin/uci: /bin/uci: 189: cannot create /var/state/network: Directory nonexistent
Can't open /var/lock/dhcp-eth0.1
udhcpc: cannot open pidfile /var/run/eth0.1.pid: No such file or directory
udhcpc (v1.4.2) started
/bin/uci: /bin/uci: 189: cannot create /var/state/network: Directory nonexistent
Sending discover...
/bin/uci: /bin/uci: 189: cannot create /var/state/network: Directory nonexistent
/sbin/hotplug-call: .: 1: Can't open /var/state/network
Sending discover...
Sending discover...
+ usb=0
+ echo ======
======
+ cat /proc/partitions
major minor #blocks name
31 0 256 mtdblock0
31 1 7872 mtdblock1
31 2 7136 mtdblock2
31 3 5760 mtdblock3
31 4 64 mtdblock4
8 0 1000944 sda
8 1 1000897 sda1
+ echo ======
======
+ cat /proc/modules
ext3 97040 0 - Live 0xc00f9000
jbd 54672 1 ext3, Live 0xc00c3000
usb_storage 27664 0 - Live 0xc0060000
sd_mod 18416 0 - Live 0xc00a5000
scsi_mod 71968 2 usb_storage,sd_mod, Live 0xc0074000
ehci_hcd 28016 0 - Live 0xc006c000
usbcore 102032 3 usb_storage,ehci_hcd, Live 0xc008b000
switch_robo 4048 0 - Live 0xc0058000
switch_core 5056 1 switch_robo, Live 0xc0055000
diag 8272 0 - Live 0xc005c000
+ echo ======
======
+ /bin/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)
+ echo ======
======
+ /bin/ps
PID Uid VmSize Stat Command
1 root 440 R /bin/sh /sbin/init
2 root SW< [kthreadd]
3 root SWN [ksoftirqd/0]
4 root SW< [events/0]
5 root SW< [khelper]
14 root SW< [kblockd/0]
38 root SW [pdflush]
39 root SW [pdflush]
40 root SW< [kswapd0]
41 root SW< [aio/0]
52 root SW< [mtdblockd]
210 root SWN [jffs2_gcd_mtd3]
220 root 236 S /sbin/hotplug2 --persistent
353 root SW< [khubd]
404 root SW< [scsi_eh_0]
405 root SW< [usb-storage]
623 root 432 S udhcpc -t 0 -i eth0.1 -b -p /var/run/eth0.1.pid -R
630 root 432 S udhcpc -t 0 -i eth0.1 -b -p /var/run/eth0.1.pid -R
696 root 380 R /bin/ps
+ echo ======
======
+ /bin/mount /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed
+ /bin/mount -t ext2 -o rw,noatime /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed
+ /bin/mount -t ext3 -o rw,noatime /dev/sda1 /mnt
mount: mounting /dev/sda1 on /mnt failed
+ killall hotplug2
+ exec
+ exec /bin/busybox init