]> git.openpandora.org Git - openembedded.git/commitdiff
cx3110x: Rearranging completely the cx3110x driver build
authorAloisio Almeida Jr <aloisio.almeida@openbosssa.org>
Thu, 23 Oct 2008 21:03:06 +0000 (18:03 -0300)
committerRodrigo Vivi <rodrigo.vivi@openbossa.org>
Thu, 23 Oct 2008 21:03:14 +0000 (18:03 -0300)
    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>
21 files changed:
conf/distro/mamona.conf
packages/mamona/cx3110x-770he-0.8.1/770_performance_improvements.patch [moved from packages/mamona/cx3110x-0.8.1/770_performance_improvements.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/create_sysfs_link_for_wlan0.patch [moved from packages/mamona/cx3110x-0.8.1/create_sysfs_link_for_wlan0.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/cx3110x [new file with mode: 0755]
packages/mamona/cx3110x-770he-0.8.1/cx3110x.patch [moved from packages/mamona/cx3110x-0.8.1/cx3110x.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/defconfig [moved from packages/mamona/cx3110x-0.8.1/defconfig with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/fix_cross_makefile.patch [moved from packages/mamona/cx3110x-0.8.1/fix_cross_makefile.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/fix_mem_allign.patch [moved from packages/mamona/cx3110x-0.8.1/fix_mem_allign.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/fix_mem_corruption.patch [moved from packages/mamona/cx3110x-0.8.1/fix_mem_corruption.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/fix_ssid_data_length.patch [moved from packages/mamona/cx3110x-0.8.1/fix_ssid_data_length.patch with 100% similarity]
packages/mamona/cx3110x-770he-0.8.1/series [moved from packages/mamona/cx3110x-0.8.1/series with 100% similarity]
packages/mamona/cx3110x-770he_0.8.1.bb [new file with mode: 0644]
packages/mamona/cx3110x-chinooke-2.0.15/create_sysfs_link_for_wlan0.patch [moved from packages/mamona/cx3110x-2.0.15/create_sysfs_link_for_wlan0.patch with 100% similarity]
packages/mamona/cx3110x-chinooke-2.0.15/cx3110x [new file with mode: 0755]
packages/mamona/cx3110x-chinooke-2.0.15/cx3110x.patch [moved from packages/mamona/cx3110x-2.0.15/cx3110x.patch with 100% similarity]
packages/mamona/cx3110x-chinooke-2.0.15/fix_old_include.patch [moved from packages/mamona/cx3110x-2.0.15/fix_old_include.patch with 100% similarity]
packages/mamona/cx3110x-chinooke_2.0.15.bb [new file with mode: 0644]
packages/mamona/cx3110x.inc [new file with mode: 0644]
packages/mamona/cx3110x_0.8.1.bb [deleted file]
packages/mamona/cx3110x_2.0.15.bb [deleted file]
packages/tasks/task-mamona.bb

index 3df0cd434365a6592ca0453048e8732cdc7438d9..83e102663c83afa5c65238751b3521c3c07522a0 100644 (file)
@@ -88,7 +88,6 @@ PREFERRED_VERSION_apt = "0.7.6"
 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"
diff --git a/packages/mamona/cx3110x-770he-0.8.1/cx3110x b/packages/mamona/cx3110x-770he-0.8.1/cx3110x
new file mode 100755 (executable)
index 0000000..93e59af
--- /dev/null
@@ -0,0 +1,36 @@
+#!/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
+
diff --git a/packages/mamona/cx3110x-770he_0.8.1.bb b/packages/mamona/cx3110x-770he_0.8.1.bb
new file mode 100644 (file)
index 0000000..2cee32b
--- /dev/null
@@ -0,0 +1,29 @@
+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
diff --git a/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x b/packages/mamona/cx3110x-chinooke-2.0.15/cx3110x
new file mode 100755 (executable)
index 0000000..93e59af
--- /dev/null
@@ -0,0 +1,36 @@
+#!/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
+
diff --git a/packages/mamona/cx3110x-chinooke_2.0.15.bb b/packages/mamona/cx3110x-chinooke_2.0.15.bb
new file mode 100644 (file)
index 0000000..17bb1f4
--- /dev/null
@@ -0,0 +1,25 @@
+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
diff --git a/packages/mamona/cx3110x.inc b/packages/mamona/cx3110x.inc
new file mode 100644 (file)
index 0000000..0dea679
--- /dev/null
@@ -0,0 +1,29 @@
+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
+}
diff --git a/packages/mamona/cx3110x_0.8.1.bb b/packages/mamona/cx3110x_0.8.1.bb
deleted file mode 100644 (file)
index 2dbdc98..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-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/
-}
diff --git a/packages/mamona/cx3110x_2.0.15.bb b/packages/mamona/cx3110x_2.0.15.bb
deleted file mode 100644 (file)
index fcc4ce2..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-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
index c12ce9e4cb224817df4ca81b58fdadf6b1d585d0..fd4e12a9dafa2c2f59be7757708297fa4fc38e5c 100644 (file)
@@ -54,14 +54,14 @@ RDEPENDS = "\
 "
 
 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 \