I got some out-of-band comments about this patch. One in particular was that the build system prefers to make kernel modules as "uncustomized as possible" (to paraphrase), so that modules only need to be built once and can thus be reused amongst targets.
Given that the compilation flags might be different, and that the kernel headers that any kernel module are compiled against might be individually patched, I'm not entirely sure how this would be so. But that's what I've been told so I'll defer to the experts. I was also told that the way to provide customization is to script it as a "first boot" script via /etc/uci-defaults/ and have scripts run out of there. I'll mention in passing that since a script in /etc/uci-defaults/ can do anything, arbitrarily modifying system state (i.e. not just confined to modifying UCI configuration state in /etc/config/), this seemed like a bit of a misnomer. But moving on... My concerns are several-fold, but predominately: (1) The assumption is that without the "customization" done in the first place, the system is still able to safely and successfully boot far enough to apply the customization. That's not necessarily the case. It might be the case that modules need to be loaded early on with platform-specific parameters for the system to even boot far enough for filesystems to be recognized, media to be made writable, etc. (2) In the case of a system constructed with a read-only root partition, and an overlaid writable filesystem (via unionfs) made writable for containing configuration changes, etc. it's possible that a naive user might delete directories in the latter. The effect of this might be to undo the changes made via /etc/uci-defaults scripting, without "re-exposing" those scripts themselves so they may be re-run (they delete themselves after being run the first time). In the second point, it seems a little fragile to have state necessary to make the system run properly exist on a fragile filesystem, while the less fragile read-only squashfs image may not operate correctly "as is". After thinking about these two conflicting goals: * the first being the desire to avoid building non-portable kernel modules on a per-target or per-subtarget basis repeatedly, but rather to build it just once * and the second being to publish a read-only squashfs filesystem that will boot and operate safely without relying on post-boot customization this leaves us one opportunity to apply the customization. After the compilation and installation of the kernel and kernel modules, but before the squashfs (or ext2 or whatever) image is created. That is, run a set of pre-freezing scripts in build_dir/target-*/*-root. These scripts could apply their customization to /etc/modules.d/, /etc/init.d/, etc. as needed to customize the frozen image. Does that seem like a viable solution to both requirements? Thanks, -Philip -------- Original Message -------- Subject: [OpenWrt-Devel] [PATCH] Geos -- new x86 subtarget definition Date: Sun, 19 Sep 2010 17:06:52 -0700 From: Philip Prindeville <[email protected]> To: OpenWrt Development List <[email protected]> This defines the Geos platform from Traverse Technologies in AUS. This is a Geode LX800 with 512MB of DDR400 memory, 2 8139CP interfaces, 2 Solos ADSL2+ interfaces, USB, serial console, CF slot, and miniPCI slot. Requires the earlier posted patch entitles "Allow targets/subtargets to customize module options". Signed-off-by: Philip A. Prindeville --- Index: target/linux/x86/image/Config.in =================================================================== --- target/linux/x86/image/Config.in (revision 23097) +++ target/linux/x86/image/Config.in (working copy) @@ -8,7 +8,7 @@ config X86_GRUB_CONSOLE bool "Use Console Terminal (in addition to Serial)" depends X86_GRUB_IMAGES - default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501) + default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos) default y config X86_GRUB_SERIAL @@ -21,6 +21,7 @@ int "Serial port baud rate" depends X86_GRUB_IMAGES default 19200 if TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 + default 115200 if TARGET_x86_geos default 38400 config X86_GRUB_BOOTOPTS Index: target/linux/x86/Makefile =================================================================== --- target/linux/x86/Makefile (revision 23097) +++ target/linux/x86/Makefile (working copy) @@ -10,7 +10,7 @@ BOARD:=x86 BOARDNAME:=x86 FEATURES:=squashfs jffs2 ext2 vdi vmdk pcmcia targz -SUBTARGETS=generic olpc xen_domu ep80579 net5501 kvm_guest +SUBTARGETS=generic olpc xen_domu ep80579 net5501 kvm_guest geos LINUX_VERSION:=2.6.32.20 Index: target/linux/x86/geos/config-default =================================================================== --- target/linux/x86/geos/config-default (revision 0) +++ target/linux/x86/geos/config-default (revision 0) @@ -0,0 +1,25 @@ +# CONFIG_ACPI is not set +# CONFIG_DMI is not set +CONFIG_CPU_SUP_AMD=y +CONFIG_GEODE_MFGPT_TIMER=y +# CONFIG_GEODE_WDT is not set +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HWMON=y +# CONFIG_HWMON_DEBUG_CHIP is not set +# CONFIG_ISA is not set +# CONFIG_INPUT is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_M486 is not set +CONFIG_MGEODE_LX=y +# CONFIG_MOUSE_PS2 is not set +# CONFIG_PCSPKR_PLATFORM is not set +CONFIG_PROCESSOR_SELECT=y +# CONFIG_SCx200 is not set +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_LIBPS2 is not set +CONFIG_X86_DEBUGCTLMSR=y +# CONFIG_X86_DS is not set +CONFIG_X86_L1_CACHE_SHIFT=5 +CONFIG_X86_TSC=y +CONFIG_X86_USE_3DNOW=y +CONFIG_X86_USE_PPRO_CHECKSUM=y Index: target/linux/x86/geos/base-files/etc/init.d/leds-geos =================================================================== --- target/linux/x86/geos/base-files/etc/init.d/leds-geos (revision 0) +++ target/linux/x86/geos/base-files/etc/init.d/leds-geos (revision 0) @@ -0,0 +1,27 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) OpenWrt.org + +START=97 + +start() { + MAJOR=$(awk '$2 == "cs5535_gpio" { print $1; }' /proc/devices) + + for MINOR in 3 6 25 27 ; do + mknod -m 0664 /dev/gpio_$MINOR c $MAJOR $MINOR + done + + #init the output LEDs + echo "Otdp"> /dev/gpio_6 + echo "Otdp"> /dev/gpio_25 + echo "Otdp"> /dev/gpio_27 + + #Turn LEDs on + echo "0"> /dev/gpio_6 + echo "0"> /dev/gpio_25 + echo "0"> /dev/gpio_27 +} + +stop() { + : nothing for now +} + Property changes on: target/linux/x86/geos/base-files/etc/init.d/leds-geos ___________________________________________________________________ Added: svn:executable + * Index: target/linux/x86/geos/target.mk =================================================================== --- target/linux/x86/geos/target.mk (revision 0) +++ target/linux/x86/geos/target.mk (revision 0) @@ -0,0 +1,24 @@ +BOARDNAME:=Traverse Geos +FEATURES:=squashfs pci usb gpio +DEFAULT_PACKAGES += kmod-ata-via-sata kmod-crypto-hw-geode \ + kmod-gpio-cs5535 kmod-gpio-nsc \ + kmod-wdt-geode kmod-hwmon-core kmod-hwmon-lm90 \ + kmod-8139cp kmod-solos-pci \ + kmod-i2c-core kmod-i2c-gpio \ + kmod-i2c-algo-bit kmod-i2c-algo-pca kmod-i2c-algo-pcf \ + kmod-usb-core kmod-usb2 kmod-usb-uhci \ + kmod-cfg80211 kmod-mac80211 \ + kmod-mppe kmod-pppoe kmod-pppoa kmod-pppol2tp \ + kmod-ath kmod-ath5k kmod-ath9k + +# target requires slightly modified module handling +MOD_NOAUTOLOAD += mppe pppoa pppoe pppol2tp +MOD_OPTIONS_cs5535_gpio:=mask=0x0E000048 + +CFLAGS += -march=k6-2 -fno-align-functions -fno-align-loops -fno-align-jumps \ + -fno-align-labels + +define Target/Description + Build firmware images for Traverse Geos board +endef + _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
