diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/base-files/base-files_3.0.14.bb | 43 | ||||
-rwxr-xr-x | packages/initscripts/initscripts-1.0/populate-volatile.sh | 64 | ||||
-rw-r--r-- | packages/initscripts/initscripts-1.0/volatiles | 29 | ||||
-rw-r--r-- | packages/initscripts/initscripts_1.0.bb | 7 | ||||
-rw-r--r-- | packages/linux/nslu2-kernel/2.6.12/nslu2-setup.c | 156 | ||||
-rw-r--r-- | packages/linux/nslu2-kernel_2.6.12.2.bb | 2 | ||||
-rw-r--r-- | packages/openslug-init/openslug-init-0.10/turnup | 32 | ||||
-rw-r--r-- | packages/openslug-init/openslug-init_0.10.bb | 2 |
8 files changed, 279 insertions, 56 deletions
diff --git a/packages/base-files/base-files_3.0.14.bb b/packages/base-files/base-files_3.0.14.bb index ee691a9560..cb648f2448 100644 --- a/packages/base-files/base-files_3.0.14.bb +++ b/packages/base-files/base-files_3.0.14.bb @@ -1,7 +1,7 @@ DESCRIPTION = "Miscellaneous files for the base system." SECTION = "base" PRIORITY = "required" -PR = "r35" +PR = "r36" LICENSE = "GPL" SRC_URI = " \ @@ -103,41 +103,6 @@ do_install () { install -m 0644 ${WORKDIR}/licenses/$license ${D}${datadir}/common-licenses/ done - if (grep -q "^\(tmpfs\|ramfs\)\W\+/var" ${D}${sysconfdir}/fstab); then - # /var is in a ramdisk - install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/rcS.d - for d in ${dirs755}; do - if (echo $d|grep -q "^${localstatedir}"); then - echo "mkdir -p $d" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo "chmod 0775 $d" >> ${D}${sysconfdir}/init.d/populate-var.sh - fi - done - for d in ${dirs1777}; do - if (echo $d|grep -q "^${localstatedir}"); then - echo "mkdir -p $d" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo "chmod 1777 $d" >> ${D}${sysconfdir}/init.d/populate-var.sh - fi - done - for d in ${dirs2775}; do - if (echo $d|grep -q "^${localstatedir}"); then - echo "mkdir -p $d" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo "chmod 2775 $d" >> ${D}${sysconfdir}/init.d/populate-var.sh - fi - done - - - echo ">/var/run/utmp" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo ">/var/log/wtmp" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo ">/var/log/lastlog" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo "chmod 0664 /var/run/utmp /var/log/wtmp /var/log/lastlog" >> ${D}${sysconfdir}/init.d/populate-var.sh - echo "touch /var/run/resolv.conf" >> ${D}${sysconfdir}/init.d/populate-var.sh - -# rmdir ${D}${localstatedir}/* - chmod 0755 ${D}${sysconfdir}/init.d/populate-var.sh - ln -sf ../init.d/populate-var.sh ${D}${sysconfdir}/rcS.d/S37populate-var.sh - ln -sf ${localstatedir}/run/resolv.conf ${D}${sysconfdir}/resolv.conf - ln -sf ${localstatedir}/ld.so.cache ${D}${sysconfdir}/ld.so.cache - fi ln -sf /proc/mounts ${D}${sysconfdir}/mtab } @@ -149,8 +114,7 @@ do_install_append_mnci () { } do_install_append_nylon() { - rm ${D}${sysconfdir}/resolv.conf - touch ${D}${sysconfdir}/resolv.conf + printf "" "" >${D}${sysconfdir}/resolv.conf rm -r ${D}/mnt/* rm -r ${D}/media rm -rf ${D}/tmp @@ -158,8 +122,7 @@ do_install_append_nylon() { } do_install_append_openslug() { - rm ${D}${sysconfdir}/resolv.conf - touch ${D}${sysconfdir}/resolv.conf + printf "" "" >${D}${sysconfdir}/resolv.conf rm -r ${D}/mnt/* } diff --git a/packages/initscripts/initscripts-1.0/populate-volatile.sh b/packages/initscripts/initscripts-1.0/populate-volatile.sh new file mode 100755 index 0000000000..311a2764da --- /dev/null +++ b/packages/initscripts/initscripts-1.0/populate-volatile.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +. /etc/default/rcS +CFGFILE="/etc/default/volatiles" + +[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems." + +cat ${CFGFILE} | grep -v "^#" | \ +while read LINE; do + TTYPE=`echo ${LINE} | cut -d " " -f 1` + TUSER=`echo ${LINE} | cut -d " " -f 2` + TGROUP=`echo ${LINE} | cut -d " " -f 3` + TMODE=`echo ${LINE} | cut -d " " -f 4` + TNAME=`echo ${LINE} | cut -d " " -f 5` + + [ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-." + + [ "${TTYPE}" = "l" ] && { + [ -e "${TNAME}" ] && { + echo "Cannot create link over existing -${TNAME}-." >&2 + } || { + TSOURCE=`echo ${LINE} | cut -d " " -f 6` + [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-." + ln -s "${TSOURCE}" "${TNAME}" + } + continue + } + + [ -L "${TNAME}" ] && { + [ "${VERBOSE}" != "no" ] && echo "Found link." + NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'` + echo ${NEWNAME} | grep -v "^/" >/dev/null && { + TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-." + } || { + TNAME="${NEWNAME}" + [ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-." + } + } + + [ -e "${TNAME}" ] && { + [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping." + continue + } + + case "${TTYPE}" in + "f") [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-." + touch "${TNAME}" + ;; + "d") [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-." + mkdir -p "${TNAME}" + # Add check to see if there's an entry in fstab to mount. + ;; + *) [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-." + continue + ;; + esac + + chown ${TUSER} ${TNAME} || echo "Failed to set owner -${TUSER}- for -${TNAME}-." >&2 + chgrp ${TGROUP} ${TNAME} || echo "Failed to set group -${TGROUP}- for -${TNAME}-." >&2 + chmod ${TMODE} ${TNAME} || echo "Failed to set mode -${TMODE}- for -${TNAME}-." >&2 + + done + diff --git a/packages/initscripts/initscripts-1.0/volatiles b/packages/initscripts/initscripts-1.0/volatiles new file mode 100644 index 0000000000..45d373cedc --- /dev/null +++ b/packages/initscripts/initscripts-1.0/volatiles @@ -0,0 +1,29 @@ +# This configuration file lists filesystem objects that should get verified +# during startup and be created if missing. +# +# Every line must either be a comment starting with # +# or a definition of format: +# <type> <owner> <group> <mode> <path> [<linksource>] +# where the items are separated by whitespace ! +# +# <type> : d|f|l : (d)irectory|(f)ile|(l)ink +# +# A linking example: +# l root root 0777 /var/test /tmp/testfile +# f root root 0644 /var/test +# +d root root 0775 /var +d root root 0755 /var/backups +d root root 0755 /var/cache +d root root 0755 /var/lib +d root root 0755 /var/lib/misc +d root root 2775 /var/local +d root root 1777 /var/lock +d root root 0755 /var/lock/subsys +d root root 0755 /var/log +d root root 0755 /var/run +d root root 0755 /var/spool +d root root 1777 /var/tmp +f root root 0664 /var/run/utmp +f root root 0664 /var/log/wtmp +f root root 0664 /var/log/lastlog diff --git a/packages/initscripts/initscripts_1.0.bb b/packages/initscripts/initscripts_1.0.bb index 8c735b7a5e..3fbbda4cf8 100644 --- a/packages/initscripts/initscripts_1.0.bb +++ b/packages/initscripts/initscripts_1.0.bb @@ -6,7 +6,7 @@ DEPENDS = "makedevs" DEPENDS_openzaurus = "makedevs virtual/kernel" RDEPENDS = "makedevs" LICENSE = "GPL" -PR = "r47" +PR = "r48" SRC_URI = "file://halt \ file://ramdisk \ @@ -30,6 +30,8 @@ SRC_URI = "file://halt \ file://umountnfs.sh \ file://sysfs.sh \ file://device_table.txt \ + file://populate-volatile.sh \ + file://volatiles \ file://corgikeymap-2.6.map \ file://tosakeymap-2.6.map" @@ -82,6 +84,8 @@ do_install () { install -m 0755 ${WORKDIR}/devpts.sh ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/devpts ${D}${sysconfdir}/default install -m 0755 ${WORKDIR}/sysfs.sh ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d + install -m 0644 ${WORKDIR}/volatiles ${D}${sysconfdir}/default if [ "${TARGET_ARCH}" = "arm" ]; then install -m 0755 ${WORKDIR}/alignment.sh ${D}${sysconfdir}/init.d fi @@ -140,6 +144,7 @@ do_install () { ln -sf ../init.d/devices ${D}${sysconfdir}/rcS.d/S05devices # udev will run at S04 if installed ln -sf ../init.d/sysfs.sh ${D}${sysconfdir}/rcS.d/S03sysfs + ln -sf ../init.d/populate-volatile.sh ${D}${sysconfdir}/rcS.d/S37populate-volatile.sh ln -sf ../init.d/devpts.sh ${D}${sysconfdir}/rcS.d/S38devpts.sh if [ "${TARGET_ARCH}" = "arm" ]; then ln -sf ../init.d/alignment.sh ${D}${sysconfdir}/rcS.d/S06alignment diff --git a/packages/linux/nslu2-kernel/2.6.12/nslu2-setup.c b/packages/linux/nslu2-kernel/2.6.12/nslu2-setup.c new file mode 100644 index 0000000000..47be53bf81 --- /dev/null +++ b/packages/linux/nslu2-kernel/2.6.12/nslu2-setup.c @@ -0,0 +1,156 @@ +/* + * arch/arm/mach-ixp4xx/nslu2-setup.c + * + * NSLU2 board-setup + * + * based ixdp425-setup.c: + * Copyright (C) 2003-2004 MontaVista Software, Inc. + * + * Author: Mark Rakes <mrakes at mac.com> + * Maintainers: http://www.nslu2-linux.org/ + * + * Fixed missing init_time in MACHINE_START kas11 10/22/04 + * Changed to conform to new style __init ixdp425 kas11 10/22/04 + */ + +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/device.h> +#include <linux/serial.h> +#include <linux/tty.h> +#include <linux/serial_8250.h> + +#include <asm/types.h> +#include <asm/setup.h> +#include <asm/memory.h> +#include <asm/hardware.h> +#include <asm/mach-types.h> +#include <asm/irq.h> +#include <asm/mach/arch.h> +#include <asm/mach/flash.h> + +void __init nslu2_map_io(void) +{ + ixp4xx_map_io(); +} + +static struct flash_platform_data nslu2_flash_data = { + .map_name = "cfi_probe", + .width = 2, +}; + +static struct resource nslu2_flash_resource = { + .start = NSLU2_FLASH_BASE, + .end = NSLU2_FLASH_BASE + NSLU2_FLASH_SIZE, + .flags = IORESOURCE_MEM, +}; + +static struct platform_device nslu2_flash = { + .name = "IXP4XX-Flash", + .id = 0, + .dev = { + .platform_data = &nslu2_flash_data, + }, + .num_resources = 1, + .resource = &nslu2_flash_resource, +}; + +static struct ixp4xx_i2c_pins nslu2_i2c_gpio_pins = { + .sda_pin = NSLU2_SDA_PIN, + .scl_pin = NSLU2_SCL_PIN, +}; + +static struct platform_device nslu2_i2c_controller = { + .name = "IXP4XX-I2C", + .id = 0, + .dev = { + .platform_data = &nslu2_i2c_gpio_pins, + }, + .num_resources = 0 +}; + +static struct resource nslu2_uart_resources[] = { + { + .start = IXP4XX_UART1_BASE_PHYS, + .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + }, + { + }, +#if 0 + , { + .start = IXP4XX_UART2_BASE_PHYS, + .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + } +#endif +}; + +static struct plat_serial8250_port nslu2_uart_data[] = { + { + .mapbase = IXP4XX_UART1_BASE_PHYS, + .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, + .irq = IRQ_IXP4XX_UART1, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = IXP4XX_UART_XTAL, + }, + { + }, + +#if 0 + , { + .mapbase = IXP4XX_UART2_BASE_PHYS, + .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, + .irq = IRQ_IXP4XX_UART1, + .flags = UPF_BOOT_AUTOCONF, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = IXP4XX_UART_XTAL, + } +#endif +}; + +static struct platform_device nslu2_uart = { + .name = "serial8250", + .id = 0, + .dev.platform_data = nslu2_uart_data, + .num_resources = 2, + .resource = nslu2_uart_resources +}; + +static struct platform_device *nslu2_devices[] __initdata = { + &nslu2_i2c_controller, + &nslu2_flash, + &nslu2_uart +}; + +static void n2_power_off(void) +{ + /* This causes the box to drop the power and go dead. */ +#define GPIO_PO_BM 0x0100 //b0000 0001 0000 0000 + *IXP4XX_GPIO_GPOER &= ~GPIO_PO_BM; // enable the pwr cntl gpio + *IXP4XX_GPIO_GPOUTR |= GPIO_PO_BM; // do the deed +} + +static void __init nslu2_init(void) +{ + ixp4xx_sys_init(); + + pm_power_off = n2_power_off; + platform_add_devices(nslu2_devices, ARRAY_SIZE(nslu2_devices)); +} + +MACHINE_START(NSLU2, "Linksys NSLU2") + MAINTAINER("www.nslu2-linux.org") + BOOT_MEM(PHYS_OFFSET, IXP4XX_PERIPHERAL_BASE_PHYS, + IXP4XX_PERIPHERAL_BASE_VIRT) + MAPIO(nslu2_map_io) + INITIRQ(ixp4xx_init_irq) //FIXME: all irq are off here + .timer = &ixp4xx_timer, + // INITTIME(ixp4xx_init_time) //this was missing in 2.6.7 code ...soft reboot needed? + BOOT_PARAMS(0x0100) + INIT_MACHINE(nslu2_init) +MACHINE_END + diff --git a/packages/linux/nslu2-kernel_2.6.12.2.bb b/packages/linux/nslu2-kernel_2.6.12.2.bb index ca24279832..1ba5305902 100644 --- a/packages/linux/nslu2-kernel_2.6.12.2.bb +++ b/packages/linux/nslu2-kernel_2.6.12.2.bb @@ -1,5 +1,5 @@ # Kernel for NSLU2 -PR = r0 +PR = r1 include nslu2-kernel.inc # N2K_EXTRA_PATCHES - list of patches to apply (can include diff --git a/packages/openslug-init/openslug-init-0.10/turnup b/packages/openslug-init/openslug-init-0.10/turnup index 80afac7819..ce504b022e 100644 --- a/packages/openslug-init/openslug-init-0.10/turnup +++ b/packages/openslug-init/openslug-init-0.10/turnup @@ -4,6 +4,10 @@ # . /etc/default/functions +INRAM_MEMSTICK="/var/cache /var/lock /var/log /var/run /var/tmp /var/lib/ipkg" +INRAM_NFS="/var/cache /var/run" +INRAM_DISK="" + # # force: override certain checks force= @@ -169,29 +173,29 @@ setup_var() { } case "$2" in disk|nfs|memstick);; - *) echo "turnup: setup_var($1,$2): expected 'disk' or 'nfs'" >&2 + *) echo "turnup: setup_var($1,$2): expected 'disk', 'nfs' or 'memstick'" >&2 return 1;; esac # # populate /var, there is a shell script to do this, but it uses # absolute path names - chroot "$1" /bin/busybox sh /etc/init.d/populate-var.sh || { + chroot "$1" /bin/busybox sh /etc/init.d/populate-volatile.sh || { echo "turnup: /var: could not populate directory" >&2 return 1 } case "$2" in - nfs|memstick) - for d in "cache" "lock" "log" "run" "tmp" "lib/ipkg"; do - RAMDIR="/media/ram/${d}" - VARDIR="/var/${d}" - rm -rf "${1}/${VARDIR}" - ln -s "${RAMDIR}" "${1}/${VARDIR}" - sed -i "s@ ${VARDIR}@ ${RAMDIR}@" "$1"/etc/init.d/populate-var.sh - done - echo "mkdir -p /media/ram/lib/ipkg" >>"$1"/etc/init.d/populate-var.sh - ;; + disk) RAMTARGETS=${INRAM_DISK};; + nfs) RAMTARGETS=${INRAM_NFS};; + memstick) RAMTARGETS=${INRAM_MEMSTICK};; esac + + for d in ${RAMTARGETS}; do + RAMDIR="/media/ram${d}" + REALDIR="${d}" + rm -rf "${1}${REALDIR}" + ln -s "${RAMDIR}" "${1}${REALDIR}" + done # the startup link is left for the moment, this seems safer #rm "$1"/etc/rc?.d/[KS]??populate-var.sh # remove the /var tmpfs entry from the new /etc/fstab @@ -749,8 +753,10 @@ init_network() { read_one "First DNS server" network dns_server1 read_one "Second DNS server" network dns_server2 read_one "Third DNS server" network dns_server3 + echo "$ip_addr $disk_server_name" >> /etc/hosts + ;; + dhcp) sed -i -e "s/localhost\$/localhost $disk_server_name/" /etc/hosts ;; - dhcp) ;; *) bootproto=dhcp;; esac # diff --git a/packages/openslug-init/openslug-init_0.10.bb b/packages/openslug-init/openslug-init_0.10.bb index 0fa2da717f..537760f8d5 100644 --- a/packages/openslug-init/openslug-init_0.10.bb +++ b/packages/openslug-init/openslug-init_0.10.bb @@ -3,7 +3,7 @@ SECTION = "console/network" LICENSE = "GPL" DEPENDS = "base-files devio" RDEPENDS = "busybox devio" -PR = "r35" +PR = "r37" SRC_URI = "file://linuxrc \ file://boot/flash \ |