Use ITEM_OMAPATAG u-boot bootmenu entry instead obsolated ITEM_REUSEATAGS
[kernel-power] / kernel-power-2.6.28 / debian / rules
index a2085af..a4eba01 100755 (executable)
@@ -18,11 +18,17 @@ DEBUG_MODULES_PACKAGE := $(PACKAGE)-modules-debug
 LIBC_PACKAGE := linux-$(PACKAGE)-headers
 
 MULTIBOOTDIR := etc/multiboot.d
-MULTIBOOTFILE := $(MULTIBOOTDIR)/01-Maemo-$(PACKAGE)-$(RELEASE).item
+MULTIBOOTFILE := $(MULTIBOOTDIR)/20-Maemo5-$(PACKAGE)-$(RELEASE).item
+BOOTMENUDIR := etc/bootmenu.d
+BOOTMENUFILE := $(BOOTMENUDIR)/20-Maemo5-$(PACKAGE)-$(RELEASE).item
 
 BUILDTMP := $(CURDIR)/debian/build
 KSRC := $(BUILDTMP)/$(PACKAGE)
 
+WIRELESS_TESTING_TREE := $(BUILDTMP)/wireless-testing
+COMPAT_TREE := $(BUILDTMP)/compat
+COMPAT_WIRELESS_TREE := $(BUILDTMP)/compat-wireless-2.6
+
 DEFCONFIG := rx51_defconfig
 ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
 INCLUDE_HEADERS_ARCH = asm-$(ARCH) config linux
@@ -64,14 +70,32 @@ modules-stamp: configure-stamp
        $(MAKE) -C $(KSRC) $(NJOBS) $(EXTRAVERSION) modules
        touch $@
 
-headers: kernel-stamp modules-stamp
+packet-injection-source-stamp:
+       dh_testdir
+       mkdir -p $(BUILDTMP)
+       cd $(BUILDTMP) && tar -xf /usr/src/compat-wireless-2.6.tar.bz2
+       cd $(BUILDTMP) && tar -xf /usr/src/compat.tar.bz2
+       cd $(BUILDTMP) && tar -xf /usr/src/wireless-testing.tar.bz2
+       touch $@
+
+packet-injection-configure-stamp: packet-injection-source-stamp
+       touch $(COMPAT_WIRELESS_TREE)/compat_version
+       cd $(COMPAT_WIRELESS_TREE) && GIT_TREE=$(WIRELESS_TESTING_TREE) GIT_COMPAT_TREE=$(COMPAT_TREE) GIT_COMPAT_WIRELESS_TREE=$(COMPAT_WIRELESS_TREE) ./scripts/admin-update.sh
+       cd $(COMPAT_WIRELESS_TREE) && ./scripts/driver-select wl12xx
+       touch $@
+
+packet-injection-build-stamp: packet-injection-configure-stamp
+       $(MAKE) -C $(COMPAT_WIRELESS_TREE) $(NJOBS) KLIB_BUILD=$(KSRC)
+       touch $@
+
+headers: kernel-stamp modules-stamp packet-injection-build-stamp
 
 clean:
        dh_testdir
        dh_testroot
        rm -rf $(BUILDTMP)
        rm -f debian/files debian/$(FLASHER_PACKAGE).postinst debian/$(MODULES_PACKAGE).postinst debian/$(MODULES_PACKAGE).postrm
-       rm -f source-stamp configure-stamp kernel-stamp modules-stamp
+       rm -f source-stamp configure-stamp kernel-stamp modules-stamp packet-injection-source-stamp packet-injection-configure-stamp packet-injection-build-stamp
        dh_clean
 
 install-kernel:
@@ -86,11 +110,14 @@ install-bootimg:
        dh_testroot
        mkdir -p $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/boot
        mkdir -p $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTDIR)
+       mkdir -p $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(BOOTMENUDIR)
        install -m644 $(KSRC)/arch/arm/boot/zImage $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/boot/zImage-$(RELEASE)
-       echo "ITEM_NAME=\"Maemo $(PACKAGE) $(RELEASE)\"" > $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE)
+       echo "ITEM_NAME=\"Maemo 5 with $(PACKAGE) $(RELEASE) (Internal Nand)\"" > $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE)
        echo "ITEM_KERNEL=\"$(RELEASE)\"" >> $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE)
-       echo "ITEM_MODULES=\"ext3\"" >> $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE)
+       echo "ITEM_OMAPATAG=\"1\"" >> $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE)
+       cp $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE) $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(BOOTMENUFILE)
        chmod 644 $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(MULTIBOOTFILE)
+       chmod 644 $(CURDIR)/debian/$(BOOTIMG_PACKAGE)/$(BOOTMENUFILE)
 
 install-flasher:
        dh_testdir
@@ -124,10 +151,17 @@ install-modules:
        dh_testroot
        mkdir -p $(CURDIR)/debian/$(MODULES_PACKAGE)/lib/modules/$(RELEASE)
        mkdir -p $(CURDIR)/debian/$(MODULES_PACKAGE)/etc/modprobe.d
+       mkdir -p $(CURDIR)/debian/$(MODULES_PACKAGE)/opt/packet-injection-modules/$(RELEASE)
        for f in $$(find $(KSRC) -name "*.ko"); do \
                install -c -m644 $$f $(CURDIR)/debian/$(MODULES_PACKAGE)/lib/modules/$(RELEASE)/$$(basename $$f); \
                strip --remove-section=.comment --remove-section=.note --strip-unneeded  $(CURDIR)/debian/$(MODULES_PACKAGE)/lib/modules/$(RELEASE)/$$(basename $$f); \
        done
+       for ko in wl1251_spi.ko wl1251.ko cfg80211.ko compat.ko rfkill_backport.ko mac80211.ko; do \
+               for f in $$(find $(COMPAT_WIRELESS_TREE) -name $$ko); do \
+                       install -c -m644 $$f $(CURDIR)/debian/$(MODULES_PACKAGE)/opt/packet-injection-modules/$(RELEASE)/$$(basename $$f); \
+                       strip --remove-section=.comment --remove-section=.note --strip-unneeded  $(CURDIR)/debian/$(MODULES_PACKAGE)/opt/packet-injection-modules/$(RELEASE)/$$(basename $$f); \
+               done; \
+       done
        install -m644 $(CURDIR)/debian/kernel-power.blacklist $(CURDIR)/debian/$(MODULES_PACKAGE)/etc/modprobe.d
 
 install-headers: