WRAPInstall
From IckyWiki
Contents |
Install notes/instruction for my WRAP 1E
Specs:
CPU:
266 MHz AMD Geode SC1100 CPU
Memory:
128mb
Management:
Watchdog timer built into CPU;
LM77 thermal monitor stops system on excessive temperature.
User interface:
Three front panel LEDs,
Pushbutton switch, can be controlled through CPU GPIO pins.
Console I/O redirected to serial port.
Expansion:
LPC bus for adding serial ports,
ISA style I/O, GPIO etc.
I2C bus for user interface, software lock devices etc.
Connectivity:
3 Ethernet channels (National DP83816),
1 miniPCI slot,
1 serial port (console).
Basics
- WRAP single board computer from wisp-router.com via Erica
- 128 meg compact flash card from our old camera, new ones use SD
Get sources
I use gentoo as my build hosts, so replace emerge with your favorite package handler or build from src.
mkdir /home/pee/glug cd /home/pee/glug emerge --update subversion svn co svn://uclibc.org/trunk/buildroot USE="~x86" emerge --update cogito cg-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6 wget http://www.pcengines.ch/wbios110.zip emerge --update grub
setup linux sources
Make some links, and we need gen_init_cpio
cd /home/pee/glug/linux-2.6 make allnoconfig make usr/gen_init_cpio
setup buildroot
cd /home/pee/glug/buildroot make menuconfig make
Prepping flash card
- insert card wherever
- find out the device (for me it shows up as PCMCIA and the device is /dev/hde)
- flatten it
dd if=/dev/zero of=/dev/hde bs=512 count=1
- partition it
fdisk /dev/hde
i did a 16M first partition (/dev/hde1) and a second partition (/dev/hde2) using the rest of the flash card
bios manhandling if using pxe
- unzip the http://www.pcengines.ch/wbios110.zip | bios ]
- make a new rom
- add pxe stuff to rom
patches
Entropy patches
I wasn't getting enough entropy with just a flash card and minimal startup to actually be able to ssh into the box. Dropbear would hang blocked on /dev/random. The following patch helps me out a bit there. The ethernet bits i figured out on my own, and the serial bits are from the gnumonks grouter svn repo, that i found after learning about the magical SA_SAMPLE_RANDOM flag. Now I can pingflood or mash the console to get entropy o.0.
linux-2.6.15.patch
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 9d6d254..55d6422 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -1535,7 +1535,7 @@ static int netdev_open(struct net_device
/* Reset the chip, just in case. */
natsemi_reset(dev);
- i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev);
+ i = request_irq(dev->irq, &intr_handler, SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);
if (i) return i;
if (netif_msg_ifup(np))
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index d2bcd1f..d2467e6 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1394,7 +1394,7 @@ static int serial_link_irq_chain(struct
spin_unlock_irq(&i->lock);
ret = request_irq(up->port.irq, serial8250_interrupt,
- irq_flags, "serial", i);
+ irq_flags | SA_SAMPLE_RANDOM, "serial", i);
if (ret < 0)
serial_do_unlink(i, up);
}
device_table.txt patch
Add a device not so we can use the watchdog on the WRAP
device_table.txt
Index: target/generic/device_table.txt =================================================================== --- target/generic/device_table.txt (revision 13027) +++ target/generic/device_table.txt (working copy) @@ -73,6 +73,8 @@ /dev/psaux c 666 0 0 10 1 0 0 - #/dev/ppp c 666 0 0 108 0 - - - +/dev/watchdog c 600 0 0 130 10 - - - + # Input stuff /dev/input d 755 0 0 - - - - - /dev/input/mice c 640 0 0 13 63 0 0 -
add cpio support for initramfs inclusion
With linux-2.6 you can include an initramfs image inside the kernel binary and use it as "early userspace". I don't intend to stop using it early :), but you get the point. Down with initrd!. And by that I mean, i'm apparently too retarded to keep my image/initrds together and updated.
target/Config.in
Index: target/Config.in =================================================================== --- target/Config.in (revision 13031) +++ target/Config.in (working copy) @@ -7,6 +7,7 @@ source "target/jffs2/Config.in" source "target/squashfs/Config.in" source "target/tar/Config.in" +source "target/cpio/Config.in" comment "bootloader for target device"
target/cpio/cpioroot.mk
Index: target/cpio/cpioroot.mk =================================================================== --- target/cpio/cpioroot.mk (revision 0) +++ target/cpio/cpioroot.mk (revision 0) @@ -0,0 +1,51 @@ +############################################################# +# +# tar to archive target filesystem +# +############################################################# + +CPIO_OPTS := $(strip $(subst ",, $(BR2_TARGET_ROOTFS_CPIO_OPTIONS))) +CPIO_DIR := $(BR2_TARGET_CPIO_KERNEL_SOURCE_DIR) +#" +cpioroot: host-fakeroot makedevs $(STAGING_DIR)/fakeroot.env + -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true; + @rm -rf $(TARGET_DIR)/usr/man + @rm -rf $(TARGET_DIR)/usr/info + -/sbin/ldconfig -r $(TARGET_DIR) 2>/dev/null + # Use fakeroot to pretend all target binaries are owned by root + -$(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + chown -R root:root $(TARGET_DIR) + # Use fakeroot to pretend to create all needed device nodes + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + $(STAGING_DIR)/bin/makedevs \ + -d $(TARGET_DEVICE_TABLE) \ + $(TARGET_DIR) + # Use fakeroot so tar believes the previous fakery + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + sh $(CPIO_DIR)/scripts/gen_initramfs_list.sh $(TARGET_DIR) > cpioList + # Use fakeroot so tar believes the previous fakery + $(STAGING_DIR)/usr/bin/fakeroot \ + -i $(STAGING_DIR)/fakeroot.env \ + -s $(STAGING_DIR)/fakeroot.env -- \ + $(CPIO_DIR)/usr/gen_init_cpio cpioList > $(IMAGE).cpio + +cpioroot-source: + +cpioroot-clean: + +cpioroot-dirclean: + +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_TARGET_ROOTFS_CPIO)),y) +TARGETS+=cpioroot +endif
target/cpio/Config.in
Index: target/cpio/Config.in =================================================================== --- target/cpio/Config.in (revision 0) +++ target/cpio/Config.in (revision 0) @@ -0,0 +1,13 @@ +config BR2_TARGET_ROOTFS_CPIO + bool "CPIO archive the root filesystem" + default n + help + Build a cpi archive of the root filesystem for initramfs + +config BR2_TARGET_CPIO_KERNEL_SOURCE_DIR + string "path to your current kernel source directory" + depends on BR2_TARGET_ROOTFS_CPIO + default "/usr/src/linux" + help + Point me at your kernel source for scripts/gen usr/gen_cpio +
Ebtables
Filtering at the bridge level
package/Config.in
Index: package/Config.in =================================================================== --- package/Config.in (revision 13080) +++ package/Config.in (working copy) @@ -40,6 +40,7 @@ source "package/dnsmasq/Config.in" source "package/dropbear/Config.in" source "package/e2fsprogs/Config.in" +source "package/ebtables/Config.in" source "package/fakeroot/Config.in" source "package/file/Config.in" source "package/freetype/Config.in"
package/ebtables/ebtables.patch
Index: package/ebtables/ebtables.patch =================================================================== --- package/ebtables/ebtables.patch (revision 0) +++ package/ebtables/ebtables.patch (revision 0) @@ -0,0 +1,49 @@ +diff -ru ebtables-orig/Makefile ebtables-v2.0.8-rc1/Makefile +--- ebtables-orig/Makefile 2005-11-13 13:10:27.000000000 +0000 ++++ ebtables-v2.0.8-rc1/Makefile 2006-01-04 04:44:15.000000000 +0000 +@@ -7,10 +7,10 @@ + # default paths + LIBDIR:=/usr/lib + MANDIR:=/usr/local/man +-BINDIR:=/usr/local/sbin ++BINDIR:=/usr/sbin + ETCDIR:=/etc +-INITDIR:=/etc/rc.d/init.d +-SYSCONFIGDIR:=/etc/sysconfig ++INITDIR:=/etc/init.d ++SYSCONFIGDIR:=/etc/ebtables + DESTDIR:= + + # include DESTDIR param +@@ -37,7 +37,7 @@ + + OBJECTS:=$(OBJECTS2) ebtables.o $(EXT_OBJS) $(EXT_LIBS) + +-KERNEL_INCLUDES?=include/ ++KERNEL_INCLUDES?=$(LINUX_HEADERS_DIR) + + ETHERTYPESPATH?=$(ETCDIR) + ETHERTYPESFILE:=$(ETHERTYPESPATH)/ethertypes +@@ -127,12 +127,10 @@ + cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ + install -m 0755 -o root -g root ebtables.sysv_ $(INITDIR)/ebtables + cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ ++ mkdir -p $(SYSCONFIGDIR) + install -m 0600 -o root -g root ebtables-config_ $(SYSCONFIGDIR)/ebtables-config + rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ + +-$(MANDIR)/man8/ebtables.8: ebtables.8 +- mkdir -p $(@D) +- install -m 0644 -o root -g root $< $@ + + $(ETHERTYPESFILE): ethertypes + mkdir -p $(@D) +@@ -145,7 +143,7 @@ + install -m 0755 -o root -g root ebtables-restore $(BINDIR)/ebtables-restore + + .PHONY: install +-install: $(MANDIR)/man8/ebtables.8 $(ETHERTYPESFILE) exec scripts ++install: $(ETHERTYPESFILE) exec scripts + mkdir -p $(LIBDIR) + install -m 0755 extensions/*.so $(LIBDIR) + install -m 0755 *.so $(LIBDIR)
package/ebtables/ebtables.mk
Index: package/ebtables/ebtables.mk =================================================================== --- package/ebtables/ebtables.mk (revision 0) +++ package/ebtables/ebtables.mk (revision 0) @@ -0,0 +1,72 @@ +############################################################# +# +# bridgeutils - User Space Program For Controlling Bridging +# +############################################################# +# +EBTABLES_VERSION=2.0.8-rc1 +EBTABLES_SOURCE_URL=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/ebtables/ +EBTABLES_SOURCE=ebtables-v$(EBTABLES_VERSION).tar.gz +EBTABLES_BUILD_DIR=$(BUILD_DIR)/ebtables-v$(EBTABLES_VERSION) +EBTABLES_TARGET_BINARY:=usr/sbin/ebtables +EBTABLES_TARGET_BINARY_SAVE:=usr/sbin/ebtables-save +EBTABLES_TARGET_BINARY_RESTORE:=usr/sbin/ebtables-restore + +$(DL_DIR)/$(EBTABLES_SOURCE): + $(WGET) -P $(DL_DIR) $(EBTABLES_SOURCE_URL)/$(EBTABLES_SOURCE) + +$(EBTABLES_BUILD_DIR)/.unpacked: $(DL_DIR)/$(EBTABLES_SOURCE) + zcat $(DL_DIR)/$(EBTABLES_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - + patch -p1 -d $(EBTABLES_BUILD_DIR) < package/ebtables/ebtables.patch + touch $(EBTABLES_BUILD_DIR)/.unpacked + +$(EBTABLES_BUILD_DIR)/.configured: $(EBTABLES_BUILD_DIR)/.unpacked + (cd $(EBTABLES_BUILD_DIR); \ + $(MAKE) -C $(EBTABLES_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LINUX_HEADERS_DIR="$(LINUX_HEADERS_DIR)" \ + DESTDIR=$(TARGET_DIR) \ + $(EBTABLES_BUILD_DIR)\ + ); + touch $(EBTABLES_BUILD_DIR)/.configured + +$(EBTABLES_BUILD_DIR)/ebtables: $(EBTABLES_BUILD_DIR)/.configured +# (cd $(EBTABLES_BUILD_DIR); \ + $(MAKE) -C $(EBTABLES_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LINUX_HEADERS_DIR="$(LINUX_HEADERS_DIR)" \ + DESTDIR=$(TARGET_DIR) \ + $(EBTABLES_BUILD_DIR) install +# $(EBTABLES_BUILD_DIR) install\ +# ); + +$(TARGET_DIR)/$(EBTABLES_TARGET_BINARY): $(EBTABLES_BUILD_DIR)/ebtables + $(MAKE) -C $(EBTABLES_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + LINUX_HEADERS_DIR="$(LINUX_HEADERS_DIR)" \ + DESTDIR=$(TARGET_DIR) \ + $(EBTABLES_BUILD_DIR) install + $(STRIP) $(TARGET_DIR)/$(EBTABLES_TARGET_BINARY) + $(STRIP) $(TARGET_DIR)/usr/lib/ebtables/*.so + +ebtables: $(TARGET_DIR)/$(EBTABLES_TARGET_BINARY) + +ebtables-source: $(DL_DIR)/$(EBTABLES_SOURCE) + +ebtables-clean: + #$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(BRIDGE_BUILD_DIR) uninstall + -$(MAKE) -C $(EBTABLES_BUILD_DIR) clean + +ebtables-dirclean: + rm -rf $(EBTABLES_BUILD_DIR) +############################################################# +# +# Toplevel Makefile options +# +############################################################# +ifeq ($(strip $(BR2_PACKAGE_EBTABLES)),y) +TARGETS+=ebtables +endif
package/ebtables/Config.in
Index: package/ebtables/Config.in =================================================================== --- package/ebtables/Config.in (revision 0) +++ package/ebtables/Config.in (revision 0) @@ -0,0 +1,7 @@ +config BR2_PACKAGE_EBTABLES + bool "ebtables" + default n + help + Ethernet bridge filtering + + http://ebtables.sourceforge.net/
General info while running
/proc/cpuinfo
processor : 0 vendor_id : Geode by NSC cpu family : 5 model : 9 model name : Unknown stepping : 1 cpu MHz : 266.700 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu tsc msr cx8 cmov mmx cxmmx bogomips : 534.37
/proc/interrupts
CPU0
0: 1210541 XT-PIC timer
2: 0 XT-PIC cascade
4: 919 XT-PIC serial
10: 2613 XT-PIC eth0
14: 2697 XT-PIC ide0
NMI: 0
ERR: 0
