diff options
78 files changed, 1180 insertions, 16990 deletions
diff --git a/classes/kernel.bbclass b/classes/kernel.bbclass index 463ff5f6b5..8416b8acb3 100644 --- a/classes/kernel.bbclass +++ b/classes/kernel.bbclass @@ -11,6 +11,13 @@ KERNEL_IMAGETYPE = "zImage" KERNEL_PRIORITY = "${@bb.data.getVar('PV',d,1).split('-')[0].split('.')[-1]}" +# [jbowler 20051109] ${PV}${KERNEL_LOCALVERSION} is used throughout this +# .bbclass to (apparently) find the full 'uname -r' kernel version, this +# should be the same as UTS_RELEASE or (in this file) KERNEL_VERSION: +# KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(LOCALVERSION) +# but since this is not certain this overridable setting is used here: +KERNEL_RELEASE ?= "${PV}${KERNEL_LOCALVERSION}" + KERNEL_CCSUFFIX ?= "" KERNEL_LDSUFFIX ?= "" @@ -96,9 +103,9 @@ kernel_do_stage() { cp -fR drivers/sound/*.h ${STAGING_KERNEL_DIR}/include/drivers/sound/ fi - install -m 0644 .config ${STAGING_KERNEL_DIR}/config-${PV}${KERNEL_LOCALVERSION} - ln -sf config-${PV}${KERNEL_LOCALVERSION} ${STAGING_KERNEL_DIR}/.config - ln -sf config-${PV}${KERNEL_LOCALVERSION} ${STAGING_KERNEL_DIR}/kernel-config + install -m 0644 .config ${STAGING_KERNEL_DIR}/config-${KERNEL_RELEASE} + ln -sf config-${KERNEL_RELEASE} ${STAGING_KERNEL_DIR}/.config + ln -sf config-${KERNEL_RELEASE} ${STAGING_KERNEL_DIR}/kernel-config echo "${KERNEL_VERSION}" >${STAGING_KERNEL_DIR}/kernel-abiversion echo "${S}" >${STAGING_KERNEL_DIR}/kernel-source echo "${KERNEL_CCSUFFIX}" >${STAGING_KERNEL_DIR}/kernel-ccsuffix @@ -113,7 +120,7 @@ kernel_do_stage() { fi cp -fR include/config* ${STAGING_KERNEL_DIR}/include/ install -m 0644 ${KERNEL_OUTPUT} ${STAGING_KERNEL_DIR}/${KERNEL_IMAGETYPE} - install -m 0644 System.map ${STAGING_KERNEL_DIR}/System.map-${PV}${KERNEL_LOCALVERSION} + install -m 0644 System.map ${STAGING_KERNEL_DIR}/System.map-${KERNEL_RELEASE} [ -e Module.symvers ] && install -m 0644 Module.symvers ${STAGING_KERNEL_DIR}/ cp -fR scripts ${STAGING_KERNEL_DIR}/ @@ -129,9 +136,9 @@ kernel_do_install() { install -d ${D}/${KERNEL_IMAGEDEST} install -d ${D}/boot - install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${PV}${KERNEL_LOCALVERSION} - install -m 0644 System.map ${D}/boot/System.map-${PV}${KERNEL_LOCALVERSION} - install -m 0644 .config ${D}/boot/config-${PV}${KERNEL_LOCALVERSION} + install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_RELEASE} + install -m 0644 System.map ${D}/boot/System.map-${KERNEL_RELEASE} + install -m 0644 .config ${D}/boot/config-${KERNEL_RELEASE} install -d ${D}/etc/modutils # Check if scripts/genksyms exists and if so, build it @@ -147,11 +154,11 @@ kernel_do_configure() { } pkg_postinst_kernel () { - update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${PV}${KERNEL_LOCALVERSION} ${KERNEL_PRIORITY} || true + update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_RELEASE} ${KERNEL_PRIORITY} || true } pkg_postrm_kernel () { - update-alternatives --remove ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${PV}${KERNEL_LOCALVERSION} || true + update-alternatives --remove ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_RELEASE} || true } inherit cml1 @@ -169,7 +176,7 @@ ALLOW_EMPTY_kernel-image = "1" pkg_postinst_modules () { if [ -n "$D" ]; then - ${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${PV}${KERNEL_LOCALVERSION} ${KERNEL_VERSION} + ${HOST_PREFIX}depmod -A -b $D -F ${STAGING_KERNEL_DIR}/System.map-${KERNEL_RELEASE} ${KERNEL_VERSION} else depmod -A update-modules || true @@ -230,7 +237,7 @@ python populate_packages_prepend () { bb.error("D not defined") return - kernelver = bb.data.getVar('PV', d, 1) + bb.data.getVar('KERNEL_LOCALVERSION', d, 1) + kernelver = bb.data.getVar('KERNEL_RELEASE', d, 1) kernelver_stripped = kernelver m = re.match('^(.*-hh.*)[\.\+].*$', kernelver) if m: diff --git a/packages/linux/nslu2-kernel.inc b/packages/linux/nslu2-kernel.inc index a0cc1daf25..39dcb6bed3 100644 --- a/packages/linux/nslu2-kernel.inc +++ b/packages/linux/nslu2-kernel.inc @@ -1,5 +1,3 @@ -# nslu2-kernel.inc -# # Standard definitions for any NSLU2 Linux kernel. # Include this file in a .bb which specifies, at least, # PN,PV,PR for the desired kernel @@ -7,32 +5,10 @@ # Define the following *before* including this file as # required: # -# N2K_EXTRA_FILES - kernel-tree path of extra files to install -# N2K_FILES - kernel-tree path of files to install, defaults to: -# drivers/i2c/chips/x1205-rtc.c -# arch/arm/mach-ixp4xx/nslu2-io.c -# arch/arm/mach-ixp4xx/nslu2-setup.c -# arch/arm/mach-ixp4xx/nslu2-pci.c -# arch/arm/mach-ixp4xx/nslu2-part.c -# include/asm-arm/arch-ixp4xx/nslu2.h -# ${N2K_EXTRA_FILES} -# -# N2K_EXTRA_PATCHES - list of patches to apply (can include -# patches to the files installed above) -# N2K_PATCHES - full list of patches to apply, defaults to: -# file://nslu2_2.6.11.patch;patch=1 -# file://usbnet.patch;patch=1 -# file://ixp4xx_copy_from.patch;patch=1 -# file://anonymiser.patch;patch=1 -# file://xscale-reset.patch;patch=1 -# file://mtd-shutdown.patch;patch=1 -# ${N2K_EXTRA_PATCHES} -# +# N2K_PATCHES - full list of patches to apply, to add files +# generate a patch against /dev/null # N2K_SUFFIX - the suffix to add after 'zImage-' in the -# deploy/images directory - defaults to "openslug" -# -# Notice that the N2K_PATCHES list is appropriate for -# openslug-kernel_2.6.11.2 and probably nothing else. +# deploy/images directory, should identify the image config # # DEFAULT_PREFERENCE is set automagically in this file as # follows: @@ -72,7 +48,6 @@ DEPENDS += "devio-native" # file). Files, including the all important defconfig, are # searched for in the following directories (last one first): # -# openslug-kernel-2.6.11.2 # nslu2-kernel/files # nslu2-kernel/X.Y # nslu2-kernel/X.Y.Z @@ -163,47 +138,23 @@ python () { # FILESPATH: this list is in order last-searched-first, therefore # the first entry is the *latest* and/or most specific -FILESPATH = "${FILE_DIRNAME}/${P}:${N2K_FILESPATH}:${FILE_DIRNAME}/openslug-kernel-2.6.11.2" +FILESPATH = "${FILE_DIRNAME}/${P}:${N2K_FILESPATH}" # The working directory will be the 'base' version (which may not be the # same as implied by the PV variable because it corresponds to the prior # minor version for rc and pre patched versions). S = "${WORKDIR}/linux-${N2K_SRCVER}" -# N2K_FILES is a list of additional files added to the source, these are -# put in place before the patches, so may themselves be patched. The list -# gives the path name relative to the base of the kernel source tree, the -# base file name is used to *find* the file. -N2K_EXTRA_FILES ?= -N2K_FILES ?= "\ - drivers/i2c/chips/x1205-rtc.c \ - arch/arm/mach-ixp4xx/nslu2-io.c \ - arch/arm/mach-ixp4xx/nslu2-setup.c \ - arch/arm/mach-ixp4xx/nslu2-pci.c \ - arch/arm/mach-ixp4xx/nslu2-part.c \ - include/asm-arm/arch-ixp4xx/nslu2.h \ - ${N2K_EXTRA_FILES}" - -N2K_SRCFILES = "${@( ' '.join([ ("file://" + n2k_file.split('/')[-1]) for n2k_file in bb.data.getVar("N2K_FILES",d,1).split(None) ]) )}" - -# N2K_PATCHES is a list of additional patches, the list specified -# here comes from the openslug-2.6.11.2 kernel, typically extra -# patches will be required and very often patches will need to -# be removed (i.e. the default is typically not very useful!) -N2K_EXTRA_PATCHES ?= -N2K_PATCHES ?= "\ - file://nslu2_2.6.11.patch;patch=1 \ - file://usbnet.patch;patch=1 \ - file://ixp4xx_copy_from.patch;patch=1 \ - file://anonymiser.patch;patch=1 \ - file://xscale-reset.patch;patch=1 \ - file://mtd-shutdown.patch;patch=1 \ - ${N2K_EXTRA_PATCHES}" +# N2K_PATCHES is the list of patches. +N2K_PATCHES ?= "" +# Image suffix - actually set in conf/machine/nslu2.conf as it is also +# used by anything which needs to know the name of the generated image. +# May be overridden in the distro if patches or defconfig are changed. +#FIXME: this can be removed, it is just here for safety with the old names. N2K_SUFFIX ?= "openslug" SRC_URI = "${N2K_SRCURI}" -SRC_URI += "${N2K_SRCFILES}" SRC_URI += "${N2K_PATCHES}" SRC_URI += "file://defconfig" @@ -235,27 +186,22 @@ EXTRA_OEMAKE += "EXTRAVERSION=" EXTRA_OEMAKE += "LOCALVERSION=" EXTRA_OEMAKE += "MAKEFLAGS='--no-print-directory'" -# By putting the added files in place in a separate task before -# do_patch it becomes possible to patch these files. -do_unpacklocal() { - for f in ${N2K_FILES} - do - s="$(basename "$f")" - install -m 0644 "${WORKDIR}/$s" "${S}/$f" - done -} +# Override KERNEL_RELEASE from kernel.bbclass to match: +KERNEL_RELEASE = "${KERNEL_VERSION}" addtask unpacklocal before do_patch after do_unpack +# NOTE: in MM kernel builds the config options (oldconfig, menuconfig +# and so on) do not allow an option to be overridden, so the following +# removes the options which must be changed. do_configure_prepend() { - install -m 0644 ${WORKDIR}/defconfig ${S}/.config - if test '${ARCH_BYTE_SEX}' = le + rm -f ${S}/.config + echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >>'${S}/.config' + if test '${ARCH_BYTE_SEX}' = be then - sed -i '/CONFIG_CPU_BIG_ENDIAN/d' '${S}/.config' - else echo 'CONFIG_CPU_BIG_ENDIAN=y' >>'${S}/.config' fi - echo "CONFIG_CMDLINE=\"${CMDLINE}\"" >> ${S}/.config + sed -e '/CONFIG_CPU_BIG_ENDIAN/d' -e '/CONFIG_CMDLINE=/d' '${WORKDIR}/defconfig' >>'${S}/.config' rm -rf ${S}/include/asm-arm/arch ${S}/include/asm-arm/proc \ ${S}/include/asm-arm/.proc ${S}/include/asm-arm/.arch } @@ -310,5 +256,5 @@ python () { # Don't build the kernel unless we're targeting an nslu2 mach = bb.data.getVar("MACHINE", d, 1) if mach != 'nslu2': - raise bb.parse.SkipPackage("OpenSlug only builds for the Linksys NSLU2") + raise bb.parse.SkipPackage("nslu2-kernel only builds for the Linksys NSLU2") } diff --git a/packages/linux/nslu2-kernel/2.6.13/10-ixp4xx-copy-from.patch b/packages/linux/nslu2-kernel/2.6.13/10-ixp4xx-copy-from.patch deleted file mode 100644 index 03d94d282c..0000000000 --- a/packages/linux/nslu2-kernel/2.6.13/10-ixp4xx-copy-from.patch +++ /dev/null @@ -1,39 +0,0 @@ -# This patch fixes ixp4xx_copy_from for cases where the 'from' -# pointer is odd - that would cause all the accesses to be -# misaligned in the old code. ---- linux-2.6.12.2/.pc/ixp4xx_copy_from.patch/drivers/mtd/maps/ixp4xx.c 2005-09-21 22:35:38.761014739 -0700 -+++ linux-2.6.12.2/drivers/mtd/maps/ixp4xx.c 2005-09-23 01:27:54.696223365 -0700 -@@ -54,19 +54,23 @@ - static void ixp4xx_copy_from(struct map_info *map, void *to, - unsigned long from, ssize_t len) - { -- int i; -- u8 *dest = (u8 *) to; -- u16 *src = (u16 *) (map->map_priv_1 + from); -- u16 data; -+ if (len <= 0) -+ return; - -- for (i = 0; i < (len / 2); i++) { -- data = src[i]; -- dest[i * 2] = BYTE0(data); -- dest[i * 2 + 1] = BYTE1(data); -+ u8 *dest = (u8 *) to; -+ u8 *src = (u8 *) (map->map_priv_1 + from); -+ if (from & 1) -+ *dest++ = BYTE1(*(u16 *)(src-1)), ++src, --len; -+ -+ while (len >= 2) { -+ u16 data = *(u16 *)src; src += 2; -+ *dest++ = BYTE0(data); -+ *dest++ = BYTE1(data); -+ len -= 2; - } - -- if (len & 1) -- dest[len - 1] = BYTE0(src[i]); -+ if (len > 0) -+ *dest++ = BYTE0(*(u16 *)src); - } - - /* diff --git a/packages/linux/nslu2-kernel/2.6.13/10-ixp4xx-regs.patch b/packages/linux/nslu2-kernel/2.6.13/10-ixp4xx-regs.patch deleted file mode 100644 index 32f7e3ccb8..0000000000 --- a/packages/linux/nslu2-kernel/2.6.13/10-ixp4xx-regs.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- linux-2.6.11/.pc/2.6.patch/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h 2005-03-01 23:37:49.000000000 -0800 -+++ linux-2.6.11/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h 2005-06-17 17:51:32.569981939 -0700 -@@ -52,7 +52,7 @@ - * Expansion BUS Configuration registers - */ - #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) --#define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFD000) -+#define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFE000) - #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) - - /* diff --git a/packages/linux/nslu2-kernel/2.6.13/20-timer.patch b/packages/linux/nslu2-kernel/2.6.13/20-timer.patch deleted file mode 100644 index 356da6bb28..0000000000 --- a/packages/linux/nslu2-kernel/2.6.13/20-timer.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -urN linux-2.6.13.1/include/asm-arm/arch-ixp4xx/timex.h nslu2-2.6.13.1/include/asm-arm/arch-ixp4xx/timex.h ---- linux-2.6.13.1/include/asm-arm/arch-ixp4xx/timex.h 2005-09-17 12:42:45.000000000 +0200 -+++ nslu2-2.6.13.1/include/asm-arm/arch-ixp4xx/timex.h 2005-09-17 12:15:31.000000000 +0200 -@@ -9,7 +9,12 @@ - * We use IXP425 General purpose timer for our timer needs, it runs at - * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the - * timer register ignores the bottom 2 bits of the LATCH value. -+ * The NSLU2 has a 33.00MHz crystal, so a different FREQ is required. - */ -+#ifdef CONFIG_ARCH_NSLU2 -+#define FREQ 66000000 -+#else - #define FREQ 66666666 |
