1. Different package names to each kernel. Now we can provide packages to more than one kernel at the same repository.
2. Creating inc file.
3. Including init.d script to configure the right module.
4. Adapting task-mamona to these changes
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@openbossa.org>
PREFERRED_VERSION_gpsd ?= "2.33"
PREFERRED_VERSION_hal_nokia770 = "0.5.7"
PREFERRED_VERSION_networkmanager ?= "0.6.6"
-PREFERRED_VERSION_cx3110x = "0.8.1"
# Mplayer
PREFERRED_VERSION_mplayer_nokia770 ?= "1.0maemo0"
--- /dev/null
+#!/bin/sh
+
+MODULE="/lib/modules/`uname -r`/cx3110x.ko"
+
+swap_module () {
+ if [ -e $MODULE ]; then
+ # Removing builtin driver
+ rmmod cx3110x
+ # Inserting the new one
+ insmod $MODULE
+ # Getting up the interface to make the firmware being loaded (stupid, i know)
+ ifconfig wlan0 up
+ else
+ echo "OOPS: $MODULE not found, the switch is not possible" 1>&2
+ fi
+}
+
+case "$1" in
+ start)
+ swap_module
+ ;;
+ stop)
+ ifconfig $IFACE down
+ rmmod cx3110x
+ ;;
+ force-reload | restart)
+ swap_module
+ ;;
+ *)
+ echo "Usage: /etc/init.d/cx3110x {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
--- /dev/null
+PR = "r0"\r
+\r
+KERVER = "2.6.16"\r
+\r
+COMPATIBLE_MACHINE = "(nokia770)"\r
+\r
+S = "${WORKDIR}/cx3110x-0.8.1"\r
+SKERNEL = "${WORKDIR}/kernel-source-${KERVER}"\r
+\r
+# The following require must be after S{S}, ${SKERNEL}, ${KERVER}\r
+require cx3110x.inc\r
+\r
+SRC_URI += "https://garage.maemo.org/frs/download.php/2443/cx3110x-0.8.1.tar.gz \\r
+ http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \\r
+ http://dev.openbossa.org/mamona/sources/kernel-source-${KERVER}.tar.gz \\r
+ file://defconfig \\r
+ file://fix_mem_corruption.patch;patch=1 \\r
+ file://fix_mem_allign.patch;patch=1 \\r
+ file://cx3110x.patch;patch=1 \\r
+ file://fix_cross_makefile.patch;patch=1 \\r
+ file://fix_ssid_data_length.patch;patch=1 \\r
+ file://770_performance_improvements.patch;patch=1 \\r
+ file://create_sysfs_link_for_wlan0.patch;patch=1 \\r
+"\r
+\r
+do_compile() {\r
+ cp ${WORKDIR}/defconfig ${SKERNEL}/.config\r
+ KERNEL_SRC_DIR=${SKERNEL} PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules\r
+}\r
--- /dev/null
+#!/bin/sh
+
+MODULE="/lib/modules/`uname -r`/cx3110x.ko"
+
+swap_module () {
+ if [ -e $MODULE ]; then
+ # Removing builtin driver
+ rmmod cx3110x
+ # Inserting the new one
+ insmod $MODULE
+ # Getting up the interface to make the firmware being loaded (stupid, i know)
+ ifconfig wlan0 up
+ else
+ echo "OOPS: $MODULE not found, the switch is not possible" 1>&2
+ fi
+}
+
+case "$1" in
+ start)
+ swap_module
+ ;;
+ stop)
+ ifconfig $IFACE down
+ rmmod cx3110x
+ ;;
+ force-reload | restart)
+ swap_module
+ ;;
+ *)
+ echo "Usage: /etc/init.d/cx3110x {start|stop|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0
+
--- /dev/null
+PR = "r0"\r
+\r
+KERVER = "2.6.21"\r
+\r
+COMPATIBLE_MACHINE = "(nokia800|nokia810)"\r
+\r
+S = "${WORKDIR}/cx3110x-module-src-2.0.15"\r
+SKERNEL = "${WORKDIR}/kernel-source-diablo-${KERVER}/kernel-source"\r
+\r
+# The following require must be after S{S}, ${SKERNEL}, ${KERVER}\r
+require cx3110x.inc\r
+\r
+SRC_URI += "\\r
+ http://repository.maemo.org/pool/maemo4.1/free/c/cx3110x-module-src/cx3110x-module-src_2.0.15-1.tar.gz \\r
+ http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \\r
+ http://repository.maemo.org/pool/maemo4.1/free/k/kernel-source-diablo/kernel-source-diablo_2.6.21-200823maemo6.tar.gz \\r
+ file://cx3110x.patch;patch=1 \\r
+ file://create_sysfs_link_for_wlan0.patch;patch=1 \\r
+ file://fix_old_include.patch;patch=1 \\r
+"\r
+\r
+do_compile() {\r
+ PATH=${WORKDIR}/bin/:$PATH make -C ${SKERNEL} CROSS_COMPILE=arm-none-eabi- nokia_2420_defconfig prepare scripts\r
+ KERNEL_SRC_DIR=${SKERNEL} PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules\r
+}\r
--- /dev/null
+DESCRIPTION = "cx3110x wifi support to Nokia IT"
+SECTION = "kernel/modules"
+LICENSE = "GPL"
+
+INITSCRIPT_NAME = "cx3110x"
+INITSCRIPT_PARAMS = "defaults 10"
+SRC_URI += "file://cx3110x"
+inherit update-rc.d
+
+PACKAGES = "${PN}"
+
+FILES_${PN} += "/lib/modules"
+
+LDFLAGS=""
+BUILD_LDFLAGS=""
+CFLAGS=""
+BUILD_CFLAGS=""
+TARGET_LDFLAGS=""
+
+do_configure() {
+}
+
+do_install() {
+ UNAME_R=`grep "Linux kernel version:" ${SKERNEL}/.config | sed 's/.*: //'`
+ install -d ${D}/lib/modules/${UNAME_R}
+ install -m 0644 ${S}/src/cx3110x.ko ${D}/lib/modules/${UNAME_R}
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 755 ${WORKDIR}/${INITSCRIPT_NAME} ${D}/${sysconfdir}/init.d
+}
+++ /dev/null
-DESCRIPTION = "cx3110x wifi support as found in the Nokia 770"
-SECTION = "kernel/modules"
-LICENSE = "GPL"
-PR = "r0"
-
-PACKAGES = "${PN}"
-
-FILES_${PN} += "/lib/modules/cx3110x.ko"
-
-COMPATIBLE_MACHINE = "(nokia770)"
-
-SRC_URI = "https://garage.maemo.org/frs/download.php/2443/cx3110x-0.8.1.tar.gz \
- http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \
- http://dev.openbossa.org/mamona/sources/kernel-source-2.6.16.tar.gz \
- file://defconfig \
- file://fix_mem_corruption.patch;patch=1 \
- file://fix_mem_allign.patch;patch=1 \
- file://cx3110x.patch;patch=1 \
- file://fix_cross_makefile.patch;patch=1 \
- file://fix_ssid_data_length.patch;patch=1 \
- file://770_performance_improvements.patch;patch=1 \
- file://create_sysfs_link_for_wlan0.patch;patch=1 \
-"
-# add service file
-
-LDFLAGS=""
-BUILD_LDFLAGS=""
-CFLAGS=""
-BUILD_CFLAGS=""
-TARGET_LDFLAGS=""
-
-do_configure() {
-}
-
-do_compile() {
- export KERNEL_SRC_DIR=${WORKDIR}/kernel-source-2.6.16
- cp ${WORKDIR}/defconfig ${KERNEL_SRC_DIR}/.config
- KERNEL_SRC_DIR=${WORKDIR}/kernel-source-2.6.16 PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules
-}
-
-do_install() {
- install -d ${D}/lib/modules/
- install -m 0644 ${S}/src/cx3110x.ko ${D}/lib/modules/
-}
+++ /dev/null
-DESCRIPTION = "cx3110x wifi support as found in the Nokia 800/810"\r
-SECTION = "kernel/modules"\r
-LICENSE = "GPL"\r
-PR = "r0"\r
-\r
-PACKAGES = "${PN}"\r
-\r
-FILES_${PN} += "/lib/modules/cx3110x.ko"\r
-\r
-COMPATIBLE_MACHINE = "(nokia800|nokia810)"\r
-\r
-S = "${WORKDIR}/cx3110x-module-src-${PV}"\r
-\r
-SRC_URI = " \\r
- http://repository.maemo.org/pool/maemo4.1/free/c/cx3110x-module-src/cx3110x-module-src_2.0.15-1.tar.gz \\r
- http://www.codesourcery.com/public/gnu_toolchain/arm-none-eabi/arm-2005q3-2-arm-none-eabi-i686-pc-linux-gnu.tar.bz2 \\r
- http://repository.maemo.org/pool/maemo4.1/free/k/kernel-source-diablo/kernel-source-diablo_2.6.21-200823maemo6.tar.gz \\r
- file://cx3110x.patch;patch=1 \\r
- file://create_sysfs_link_for_wlan0.patch;patch=1 \\r
- file://fix_old_include.patch;patch=1 \\r
-"\r
-# add service file\r
-\r
-LDFLAGS=""\r
-BUILD_LDFLAGS=""\r
-CFLAGS=""\r
-BUILD_CFLAGS=""\r
-TARGET_LDFLAGS=""\r
-\r
-do_configure() {\r
-}\r
-\r
-do_compile() {\r
- export KERNEL_SRC_DIR=${WORKDIR}/kernel-source-diablo-2.6.21/kernel-source/\r
- PATH=${WORKDIR}/bin/:$PATH make -C ${KERNEL_SRC_DIR} CROSS_COMPILE=arm-none-eabi- nokia_2420_defconfig prepare scripts\r
- KERNEL_SRC_DIR=${WORKDIR}/kernel-source-diablo-2.6.21/kernel-source/ PATH=${WORKDIR}/bin/:$PATH CROSS_COMPILE=arm-none-eabi- make modules\r
-}\r
-\r
-do_install() {\r
- install -d ${D}/lib/modules/\r
- install -m 0644 ${S}/src/cx3110x.ko ${D}/lib/modules/\r
-}\r
"
RDEPENDS_append_nokia770 = " \
- cx3110x \
+ cx3110x-770he \
libasound-module-ctl-dsp-ctl \
libasound-module-pcm-alsa-dsp \
mamona-sound-n770 \
"
RDEPENDS_append_nokia800 = " \
- cx3110x \
+ cx3110x-chinooke \
libasound-module-ctl-dsp-ctl \
libasound-module-pcm-alsa-dsp \
mamona-sound-n800 \