OpenWrt Forum Archive

Topic: Compile Error

The content of this topic has been archived between 21 Apr 2018 and 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

When I try to compile, it gives me this error

make[4]: Entering directory `/root/usr5461/openwrt/toolchain_build_mipsel/gdbclient-6.3/gdb'
if [ "/root/usr5461/openwrt/toolchain_build_mipsel/gdb-6.3/missing flex" ] && /root/usr5461/openwrt/toolchain_build_mipsel/gdb-6.3/missing flex --version >/dev/null 2>&1; then \
            /root/usr5461/openwrt/toolchain_build_mipsel/gdb-6.3/missing flex -oada-lex.c /root/usr5461/openwrt/toolchain_build_mipsel/gdb-6.3/gdb/ada-lex.l && \
            rm -f ada-lex.c.new && \
            sed -e '/extern.*malloc/d' \
                -e '/extern.*realloc/d' \
                -e '/extern.*free/d' \
                -e '/include.*malloc.h/d' \
                -e 's/\([^x]\)malloc/\1xmalloc/g' \
                -e 's/\([^x]\)realloc/\1xrealloc/g' \
                -e 's/yy_flex_xrealloc/yyxrealloc/g' \
              < ada-lex.c > ada-lex.c.new && \
            rm -f ada-lex.c && \
            mv ada-lex.c.new ada-lex.c; \
        elif [ -f ada-lex.c ]; then \
            echo "Warning: ada-lex.c older than ada-lex.l and flex not available."; \
        else \
            echo "ada-lex.c missing and flex not available."; \
            false; \
        fi
ada-lex.c missing and flex not available.
make[4]: *** [ada-lex.c] Error 1
make[4]: Leaving directory `/root/usr5461/openwrt/toolchain_build_mipsel/gdbclient-6.3/gdb'
make[3]: *** [all-gdb] Error 2
make[3]: Leaving directory `/root/usr5461/openwrt/toolchain_build_mipsel/gdbclient-6.3'
make[2]: *** [/root/usr5461/openwrt/toolchain_build_mipsel/gdbclient-6.3/gdb/gdb] Error 2
make[2]: Leaving directory `/root/usr5461/openwrt/toolchain/gdb'
make[1]: *** [gdb-install] Error 2
make[1]: Leaving directory `/root/usr5461/openwrt/toolchain'
make: *** [toolchain/install] Error 2

How do I fix it?  I think I have an idea, OpenWrt FAQ said I need libc headers, but I can not find the package for it (i am using ubuntu)

Thanks!

(Last edited by schweitzer on 28 Dec 2006, 19:58)

Try this http://forum.openwrt.org/viewtopic.php?id=8410. Make sure you have all required package installed.

You can also disable building the useless GDB. See post #3.

(Last edited by forum2006 on 28 Dec 2006, 20:08)

I got all the packages, the error is still there.
I do not understand how to disable GDB, what do I do with that code?

I'm using the Ubuntu VMware image and everything works fine.

Maybe do a fresh check out from subversion and do a clean build again.

WOW it worked!  My image is 1.3MB!  How small does it have to be to fit in the 5461's 2MB?  Doesn't it reserve some of it for bootloader and stuff?
I need USB mass storage and telnet, thats all, I dont care for any routing features.

What image do I use for my 5461?  openwrt-brcm-2.4-squashfs.trx?

(Last edited by schweitzer on 28 Dec 2006, 22:38)

Well. I would use the ImageBuilder remove a few packages which are not really required and flash it.


You have to select the ImageBuilder in menuconfig under packages (at the end of the list) run 'make clean world' to build the ImageBuilder. The ImageBuilder tarball will be created in ~/whiterussian/bin/ directory.


After unpacking the ImageBuilder tarball remove the following packages from lists/default.brcm-2.4 and run 'make' in the ImageBuilder directory.

To build a image without webif GUI remove the following packages:
  haserl, webif

To build a image without iptables and ppp remove the following packages:
  iptables, kmod-ipt-nat-default, kmod-ppp, ppp-mod-pppoe, ppp, ppp-mod-pppoe

To build a image without wireless remove the following packages:
  iwlib, kmod-brcm-wl, kmod-wlcompat, wificonf, wireless-tools

(Last edited by forum2006 on 28 Dec 2006, 22:53)

Ok, so I can strip it down more, that is great!  But which image do I have to use to flash my router?
Also, according to the wiki page for the 5461 ( http://wiki.openwrt.org/USR5461 ) I have to apply a patch, but the patch is for Kamikaze.  Would it work for WhiteRussian?
Also, how do you get all the text that is output (like on the wiki page for the 5461)

What will happen if the flash fails?  Is my router bricked?  How do I know if it fails?

Also, what is faster, Ubuntu under VMWare on this computer (Core 2 Duo E6600, 2GB RAM) or natively on this computer (1.6GHz P4, 512MB RAM)

(Last edited by schweitzer on 28 Dec 2006, 22:59)

schweitzer wrote:

Also, according to the wiki page for the 5461 ( http://wiki.openwrt.org/USR5461 ) I have to apply a patch, but the patch is for Kamikaze.  Would it work for WhiteRussian?

The patch apply to WhiteRussian well. Just copy it to ~/whiterussian/target/linux/linux-2.4/patches/brcm and run 'make clean world' and you included the patch in WR.

cd ~/whiterussian/target/linux/linux-2.4/patches/brcm
wget --no-check-certificate -O 010-bcm47xx-cam_absent.patch "https://dev.openwrt.org/browser/trunk/target/linux/brcm-2.4/patches/010-bcm47xx-cam_absent.patch?format=txt"
cd ~/whiterussian
make clean world

But no guarantee on this.

(Last edited by forum2006 on 28 Dec 2006, 23:33)

Ok, I put it there and it is building.  Once built, I will extract the imagebuilder, remove the stuff I do not want from lists, and then make it.  Then what image must I upload to my router?
Also, what will its IP and username and password be so that I may SSH in (dropbear)

(Last edited by schweitzer on 28 Dec 2006, 23:40)

schweitzer wrote:

Ok, I put it there and it is building.  Once built, I will extract the imagebuilder, remove the stuff I do not want from lists, and then make it.  Then what image must I upload to my router?

Good smile You also have to backport this patch to WR. Maybe I'll do it tomorrow.

From the wiki:

4. Firmware upload
The firmware upgrade page of the original U.S.Robotics software requires a special USR firmware format, which is a TRX file with an additional 28-byte header. Lookherefor a convertor tool. Probably the easiest way to upload a new firmware image is via the TFTP server of the CFE bootloader. There is a small window of 2-3 seconds right after reset where CFE checks for a TFTP transfer, provided boot_wait is enabled.

schweitzer wrote:

Also, what will its IP and username and password be so that I may SSH in (dropbear)

The last IP you configured the router to. No default password. Use telnet the first time and set a password than use SSH.

Everything else is in the wiki.

(Last edited by forum2006 on 28 Dec 2006, 23:47)

It Works!  I Telnet In!  Woohooo!
AMMMAAZING!

Now, how do I set the DNS and gateway info for the router?  I need that to use ipkg for USB Mass Storage!

(Last edited by schweitzer on 29 Dec 2006, 00:27)

Alright, I've finished backporting the patch to add U.S. Robotics USR5461 support to WhiteRussian.

It creates a .bin file which can be flashed with the original USR5461 web interface (watch the size difference of the two images. It's exactly the 28 bytes for the header, added by the trx2usr tool):

ll ~/whiterussian/bin/
-rw-r--r-- 1 ubuntu ubuntu 1548288 2006-12-29 00:59 openwrt-brcm-2.4-squashfs.trx
-rw-r--r-- 1 ubuntu ubuntu 1548316 2006-12-29 00:59 openwrt-usr5461-squashfs.bin

I'll clean up my patches and post them here later...

Maybe I'll also create a special packages list (based on ImageBuilder's default list) for the 2MB flash. I know, there is already a micro, but the micro is not very usefull.

(Last edited by forum2006 on 29 Dec 2006, 01:12)

Huh?  I just used the tftp to load my image, but I guess that works too!  Now I am having trouble making USB actually work, Here is my list for ImageBuilder
base-files
base-files-brcm
bridge
busybox
dropbear
ipkg
iptables
iwlib
kmod-brcm-wl
kmod-diag
kmod-switch
kmod-usb-core
kmod-usb-uhci
kmod-usb-storage
kmod-vfat
kmod-wlcompat
mtd
nvram
uclibc
wificonf

Here is what dmesg brings up, it does not change whether the usb stick is in or not
CPU revision is: 00029008
Primary instruction cache 16kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Linux version 2.4.30 (root@router) (gcc version 3.4.4 (OpenWrt-1.0)) #1 Thu Dec 28 16:52:17 CST 2006
Setting the PFC value as 0x11
Determined physical RAM map:
memory: 00800000 @ 00000000 (usable)
On node 0 totalpages: 2048
zone(0): 2048 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/preinit noinitrd console=ttyS0,115200
CPU: BCM5350 rev 0 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 199.47 BogoMIPS
Memory: 6124k/8192k available (1457k kernel code, 2068k reserved, 104k data, 80k init, 0k highmem)
Dentry cache hash table entries: 1024 (order: 1, 8192 bytes)
Inode cache hash table entries: 512 (order: 0, 4096 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 2048 (order: 1, 8192 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: Disabled
PCI: Fixing up bus 0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Registering mini_fo version $Id$
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
Squashfs 2.1-r2 (released 2004/12/15) (C) 2002-2004 Phillip Lougher
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0xb8000300 (irq = 2) is a 16550A
ttyS01 at 0xb8000400 (irq = 0) is a 16550A
b44.c:v0.93 (Mar, 2004)
PCI: Setting latency timer of device 00:01.0 to 64
eth0: Broadcom 47xx 10/100BaseT Ethernet 00:c0:49:f0:29:00
Physically mapped flash: Found an alias at 0x200000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x600000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xa00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xe00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1200000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1600000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1a00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1e00000 for the chip at 0x0
Amd/Fujitsu Extended Query Table v1.0 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Flash device: 0x200000 at 0x1c000000
bootloader size: 131072
Physically mapped flash: Filesystem type: squashfs, size=0xe9bc6
Updating TRX offsets and length:
old trx = [0x0000001c, 0x000008d8, 0x0007e400], len=0x00168000 crc32=0x97a63de3
new trx = [0x0000001c, 0x000008d8, 0x0007e400], len=0x00170000 crc32=0x54b3ea97
Done
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00020000 : "cfe"
0x00020000-0x001f0000 : "linux"
0x0009e400-0x00190000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x001f0000-0x00200000 : "nvram"
0x00190000-0x001f0000 : "OpenWrt"
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 512 bind 1024)
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 332 bytes per conntrack
ip_tables: (C) 2000-2002 Netfilter core team
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 80k freed
Algorithmics/MIPS FPU Emulator v1.5
diag: Detected 'U.S. Robotics USR5461'
Probing device eth0: found!
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
mini_fo: using base directory: /
mini_fo: using storage directory: /tmp/root
jffs2.bbc: SIZE compression mode activated.
PCI: Setting latency timer of device 00:07.0 to 64
eth1: Broadcom BCM4320 802.11 Wireless Controller 3.90.37.0
BFL_ENETADM not set in boardflags. Use force=1 to ignore.
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
uhci.c: USB Universal Host Controller Interface driver v1.1
device eth0 entered promiscuous mode
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
vlan0: add 01:00:5e:00:00:01 mcast address to master interface
vlan0: dev_set_promiscuity(master, 1)
vlan0: dev_set_allmulti(master, 1)
device eth1 entered promiscuous mode
br0: port 2(eth1) entering listening state
br0: port 1(vlan0) entering listening state
br0: port 2(eth1) entering learning state
br0: port 1(vlan0) entering learning state
br0: port 2(eth1) entering forwarding state
br0: topology change detected, propagating
br0: port 1(vlan0) entering forwarding state
br0: topology change detected, propagating
vlan1: add 01:00:5e:00:00:01 mcast address to master interface
mini_fo: using base directory: /
mini_fo: using storage directory: /jffs

(Last edited by schweitzer on 29 Dec 2006, 01:18)

Try kmod-usb-ohci instead of kmod-usb-uhci.

should I remove uhci?

yes, replace it. rebuild the image with the imagebuilder and reflash it.

if you look into the nice log in the wiki you see this:

usb.c: registered new driver hub
usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:4715
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: registered new driver usblp

(Last edited by forum2006 on 29 Dec 2006, 01:29)

YES IT DETECTED IT!  I put UHCI because that is what UsbStorageHowto told me to put
http://wiki.openwrt.org/UsbStorageHowto

Thanks though, you are a great help!

schweitzer wrote:

YES IT DETECTED IT!

Great smile

schweitzer wrote:

Thanks though, you are a great help!

No problem. You are welcome.

(Last edited by forum2006 on 29 Dec 2006, 01:36)

Do you know how to mount it?

usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
PCI: Setting latency timer of device 00:03.0 to 64
usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6
usb-ohci.c: usb-00:03.0, PCI device 14e4:4715
usb.c: new USB bus registered, assigned bus number 1
hub.c: USB hub found
hub.c: 2 ports detected
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
device eth0 entered promiscuous mode
hub.c: new USB device 00:03.0-1, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
  Vendor: LEXAR     Model: JUMPDRIVE         Rev: 1.30
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 251904 512-byte hdwr sectors (129 MB)
sda: Write Protect is off
Partition check:
/dev/scsi/host0/bus0/target0/lun0: unknown partition table
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
hub.c: new USB device 00:03.0-2, assigned address 3
usb.c: USB device not accepting new address=3 (error=-145)
hub.c: new USB device 00:03.0-2, assigned address 4
usb.c: USB device not accepting new address=4 (error=-145)
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
vlan0: add 01:00:5e:00:00:01 mcast address to master interface
vlan0: dev_set_promiscuity(master, 1)
vlan0: dev_set_allmulti(master, 1)
device eth1 entered promiscuous mode
br0: port 2(eth1) entering listening state
br0: port 1(vlan0) entering listening state
br0: port 2(eth1) entering learning state
br0: port 1(vlan0) entering learning state
br0: port 2(eth1) entering forwarding state
br0: topology change detected, propagating
br0: port 1(vlan0) entering forwarding state
br0: topology change detected, propagating
vlan1: add 01:00:5e:00:00:01 mcast address to master interface

(Last edited by schweitzer on 29 Dec 2006, 01:36)

Normally it should be auto-mounted by the hotplug scripts.

schweitzer wrote:

Do you know how to mount it?

/dev/scsi/host0/bus0/target0/lun0: unknown partition table

Make sure you have partitioned and formatted it correctly.

You, also need the right package for the filesystem e.g. kmod-vfat or kmod-ext2 installed/included in the image...

(Last edited by forum2006 on 29 Dec 2006, 01:43)

I see... I installed vfat, and I tried the drive formatted both fat and fat32, same thing.  I need this drive to read in both a Windows PC and this router...  Is vfat not for fat or fat32?

How do I configure the DNS and gateway info for my router?

(Last edited by schweitzer on 29 Dec 2006, 01:52)

Hmm, you'll probably need kmod-vfat and kmod-msdos.

kmod-msdos has been added lately to the WR buildroot. Check if you have it in ~/whiterussian/bin/packages/

After installing (rebuild and reflash the image with the ImageBuilder. If you use the ImageBuilder all the packages go into the SquashFS partition which has higher compression and saves you some space) these two packages and rebooting show me 'lsmod' and 'df -h' output.

schweitzer wrote:

How do I configure the DNS and gateway info for my router?

This is in the FAQ sad

(Last edited by forum2006 on 29 Dec 2006, 02:00)

lsmod
Module                  Size  Used by    Tainted: P
usb-storage            68624   0 (unused)
sd_mod                 12500   0
scsi_mod               70616   2 [usb-storage sd_mod]
usb-ohci               19204   0 (unused)
usbcore                74808   1 [usb-storage usb-ohci]
msdos                   6420   0
vfat                   11692   0
fat                    36840   0 [msdos vfat]
wlcompat               15744   0 (unused)
wl                    423640   0 (unused)
switch-robo             4460   0 (unused)
switch-core             4896   0 [switch-robo]
diag                   19808   0 (unused)

df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               960.0k    960.0k         0 100% /rom
none                      1.1M     16.0k      1.0M   1% /tmp
/tmp/root               960.0k    960.0k         0 100% /tmp/root
/dev/mtdblock/4         384.0k    324.0k     60.0k  84% /jffs
/jffs                   960.0k    960.0k         0 100% /


SWEET you just taught me how to check how much space I have open!  Thanks!

So, your stick is still not mounted but the modules are loaded correctly.

I guess it has something to do with the stick now. Maybe try another stick and try to format the stick with FAT and FAT32 from Windows.

Sorry, I'm out of ideas.

(Last edited by forum2006 on 29 Dec 2006, 02:06)

Damnit, it is!  I tried a small SD i had (32MB) in a card reader, and it works.  That is weired that the stick works everywhere I have tried but in OpenWrt