summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2013-03-30 22:07:56 +0100
committerJohannes Berg <johannes@sipsolutions.net>2013-03-30 22:12:10 +0100
commit2c135574c0721d2c8e3e805f8a670011387e1608 (patch)
tree81f015bfb3f7072a6070443a47924cd47ceff98a
parentc55d433b6987292c5ebd50cc2e9d7ba30dd9bc4f (diff)
get output's build system mostly working
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
-rw-r--r--compat/compat/Makefile3
-rw-r--r--compat/compat/main.c56
-rw-r--r--plumbing/Kconfig10
-rw-r--r--plumbing/Makefile25
-rw-r--r--plumbing/Makefile.build5
-rw-r--r--plumbing/Makefile.kernel12
-rw-r--r--plumbing/Makefile.real62
-rw-r--r--plumbing/kconfig/Makefile25
-rwxr-xr-x[-rw-r--r--]plumbing/kconfig/lxdialog/check-lxdialog.sh0
9 files changed, 137 insertions, 61 deletions
diff --git a/compat/compat/Makefile b/compat/compat/Makefile
index 9f405647..f65ebb5a 100644
--- a/compat/compat/Makefile
+++ b/compat/compat/Makefile
@@ -1,4 +1,7 @@
ccflags-y += -I$(src)
+ccflags-y += -DBACKPORTS_VERSION=\"$(BACKPORTS_VERSION)\"
+ccflags-y += -DBACKPORTED_KERNEL_VERSION=\"$(BACKPORTED_KERNEL_VERSION)\"
+ccflags-y += -DBACKPORTED_KERNEL_NAME=\"$(BACKPORTED_KERNEL_NAME)\"
obj-m += compat.o
compat-y += main.o
diff --git a/compat/compat/main.c b/compat/compat/main.c
index 4e72ca55..6f1bfb75 100644
--- a/compat/compat/main.c
+++ b/compat/compat/main.c
@@ -5,42 +5,33 @@ MODULE_AUTHOR("Luis R. Rodriguez");
MODULE_DESCRIPTION("Kernel backport module");
MODULE_LICENSE("GPL");
-#ifndef COMPAT_BASE
-#error "You need a COMPAT_BASE"
+#ifndef BACKPORTED_KERNEL_NAME
+#error "You need a BACKPORTED_KERNEL_NAME"
#endif
-#ifndef COMPAT_BASE_TREE
-#error "You need a COMPAT_BASE_TREE"
+#ifndef BACKPORTED_KERNEL_VERSION
+#error "You need a BACKPORTED_KERNEL_VERSION"
#endif
-#ifndef COMPAT_BASE_TREE_VERSION
-#error "You need a COMPAT_BASE_TREE_VERSION"
+#ifndef BACKPORTS_VERSION
+#error "You need a BACKPORTS_VERSION"
#endif
-#ifndef COMPAT_VERSION
-#error "You need a COMPAT_VERSION"
-#endif
-
-static char *compat_base = COMPAT_BASE;
-static char *compat_base_tree = COMPAT_BASE_TREE;
-static char *compat_base_tree_version = COMPAT_BASE_TREE_VERSION;
-static char *compat_version = COMPAT_VERSION;
-
-module_param(compat_base, charp, 0400);
-MODULE_PARM_DESC(compat_base_tree,
- "The upstream verion of compat.git used");
+static char *backported_kernel_name = BACKPORTED_KERNEL_NAME;
+static char *backported_kernel_version = BACKPORTED_KERNEL_VERSION;
+static char *backports_version = BACKPORTS_VERSION;
-module_param(compat_base_tree, charp, 0400);
-MODULE_PARM_DESC(compat_base_tree,
- "The upstream tree used as base for this backport");
+module_param(backported_kernel_name, charp, 0400);
+MODULE_PARM_DESC(backported_kernel_name,
+ "The kernel tree name that was used for this backport (" BACKPORTED_KERNEL_NAME ")");
-module_param(compat_base_tree_version, charp, 0400);
-MODULE_PARM_DESC(compat_base_tree_version,
- "The git-describe of the upstream base tree");
+module_param(backported_kernel_version, charp, 0400);
+MODULE_PARM_DESC(backported_kernel_version,
+ "The kernel version that was used for this backport (" BACKPORTED_KERNEL_VERSION ")");
-module_param(compat_version, charp, 0400);
-MODULE_PARM_DESC(compat_version,
- "Version of the kernel compat backport work");
+module_param(backports_version, charp, 0400);
+MODULE_PARM_DESC(backports_version,
+ "The git version of the backports tree used to generate this backport (" BACKPORTS_VERSION ")");
void backport_dependency_symbol(void)
{
@@ -54,15 +45,8 @@ static int __init backport_init(void)
backport_system_workqueue_create();
backport_init_mmc_pm_flags();
- printk(KERN_INFO
- COMPAT_PROJECT " backport release: "
- COMPAT_VERSION
- "\n");
- printk(KERN_INFO "Backport based on "
- COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
- "\n");
- printk(KERN_INFO "compat.git: "
- COMPAT_BASE_TREE "\n");
+ printk(KERN_INFO "Loading modules backported from " BACKPORTED_KERNEL_NAME " version " BACKPORTED_KERNEL_VERSION "\n");
+ printk(KERN_INFO "Backport generated by backports.git " BACKPORTS_VERSION "\n");
return 0;
}
diff --git a/plumbing/Kconfig b/plumbing/Kconfig
index 2d870ea0..0383abe3 100644
--- a/plumbing/Kconfig
+++ b/plumbing/Kconfig
@@ -1,14 +1,14 @@
-mainmenu "Linux Backports from $KERNEL_NAME $KERNEL_VERSION (with backports $BACKPORTS_VERSION)"
+mainmenu "Linux Backports from $BACKPORTED_KERNEL_NAME $BACKPORTED_KERNEL_VERSION (with backports $BACKPORTS_VERSION)"
config BACKPORTS_VERSION
string
option env="BACKPORTS_VERSION"
-config KERNEL_VERSION
+config BACKPORTED_KERNEL_VERSION
string
- option env="KERNEL_VERSION"
-config KERNEL_NAME
+ option env="BACKPORTED_KERNEL_VERSION"
+config BACKPORTED_KERNEL_NAME
string
- option env="KERNEL_NAME"
+ option env="BACKPORTED_KERNEL_NAME"
source Kconfig.kernel
source Kconfig.versions
diff --git a/plumbing/Makefile b/plumbing/Makefile
index f0f0bc03..1d831799 100644
--- a/plumbing/Makefile
+++ b/plumbing/Makefile
@@ -1,21 +1,30 @@
#
# Makefile for the output source package
#
+
+ifeq ($(KERNELRELEASE),)
+
MAKEFLAGS += --no-print-directory
SHELL = /bin/bash
+PWD := $(shell pwd)
KLIB_BUILD ?= /lib/modules/$(shell uname -r)/build/
KERNEL_CONFIG := $(KLIB_BUILD)/.config
CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) | sed 's/\s.*//')
-export KLIB_BUILD
+export KLIB_BUILD PWD
-help:
- @echo HELP ME
+# disable built-in rules for this file
+.SUFFIXES:
+
+.PHONY: default
+default:
+ @$(MAKE) modules
.DEFAULT:
@set -e ; if [ "$$(cat .kernel_config_md5 2>/dev/null)" != "$(CONFIG_MD5)" ] ;\
then \
+ echo -n "Generating local configuration database from kernel ..." ;\
grep -v -f .local-symbols $(KERNEL_CONFIG) | grep = | ( \
while read l ; do \
if [ "$${l:0:7}" != "CONFIG_" ] ; then \
@@ -51,6 +60,12 @@ help:
fi ;\
if [ "$$v" = "$$kver" ] ; then print=1 ; fi ;\
done > Kconfig.versions ;\
+ echo " done." ;\
fi ;\
- echo "$(CONFIG_MD5)" > .kernel_config_md5 ;
- @make -f Makefile.real "$@"
+ echo "$(CONFIG_MD5)" > .kernel_config_md5
+ @#test -f .config && $(MAKE) -f Makefile.real oldconfig || true
+ @$(MAKE) -f Makefile.real "$@"
+
+else
+include $(PWD)/Makefile.kernel
+endif
diff --git a/plumbing/Makefile.build b/plumbing/Makefile.build
new file mode 100644
index 00000000..e1b968f6
--- /dev/null
+++ b/plumbing/Makefile.build
@@ -0,0 +1,5 @@
+include .config
+export
+
+modules:
+ @$(MAKE) -C $(KLIB_BUILD) M=$(PWD) modules
diff --git a/plumbing/Makefile.kernel b/plumbing/Makefile.kernel
new file mode 100644
index 00000000..6f310768
--- /dev/null
+++ b/plumbing/Makefile.kernel
@@ -0,0 +1,12 @@
+NOSTDINC_FLAGS := \
+ -I$(M)/include/ \
+ -I$(M)/include/uapi \
+ -I$(M)/include/drm \
+ -include $(M)/include/linux/compat-2.6.h \
+ $(CFLAGS)
+
+obj-y += compat/
+
+obj-$(CPTCFG_CFG80211) += net/wireless/
+obj-$(CPTCFG_MAC80211) += net/mac80211/
+obj-$(CPTCFG_WLAN) += drivers/net/wireless/
diff --git a/plumbing/Makefile.real b/plumbing/Makefile.real
index 94fc8bd1..e893a929 100644
--- a/plumbing/Makefile.real
+++ b/plumbing/Makefile.real
@@ -1,2 +1,62 @@
-test:
+include versions
+export BACKPORTS_VERSION BACKPORTED_KERNEL_VERSION BACKPORTED_KERNEL_NAME
+
+# disable built-in rules for this file
+.SUFFIXES:
+
+default:
@echo asdf
+
+# config section
+
+export CONFIG_=CPTCFG_
+menuconfig:
+ @$(MAKE) -C kconfig mconf
+ @./kconfig/mconf Kconfig
+
+listnewconfig oldaskconfig oldconfig \
+silentoldconfig olddefconfig oldnoconfig \
+allnoconfig allyesconfig allmodconfig \
+alldefconfig randconfig:
+ @$(MAKE) -C kconfig conf
+ @./kconfig/conf --$@ Kconfig
+
+defconfig:
+ @$(MAKE) -C kconfig conf
+ @./kconfig conf --defconfig defconfig
+
+.config:
+ @echo "/--------------"
+ @echo "| Your backport package isn't configured, please configure it"
+ @echo "| using one of the following options:"
+ @echo "| make menuconfig"
+ @echo "| make allyesconfig"
+ @echo "\--"
+ @false
+
+include/linux/compat_autoconf.h: .config
+ @echo -n "Building include/linux/compat_autoconf.h ..."
+ @grep -f .local-symbols .config | ( \
+ echo "#ifndef COMPAT_AUTOCONF_INCLUDED" ;\
+ echo "#define COMPAT_AUTOCONF_INCLUDED" ;\
+ echo "/*" ;\
+ echo " * Automatically generated file, don't edit!" ;\
+ echo " * Changes will be overwritten" ;\
+ echo " */" ;\
+ echo "" ;\
+ while read l ; do \
+ n=$${l%%=*} ;\
+ v=$${l#*=} ;\
+ case $$v in \
+ y) echo "#define $$n 1" ;; \
+ m) echo "#define $${n}_MODULE 1" ;; \
+ \"*) echo "#define $$n $$v" ;; \
+ *) echo "#warning unknown value for $$n";;\
+ esac ;\
+ done ;\
+ echo "#endif /* COMPAT_AUTOCONF_INCLUDED */" ;\
+ ) > include/linux/compat_autoconf.h
+ @echo " done."
+
+modules: include/linux/compat_autoconf.h
+ @$(MAKE) -f Makefile.build modules
diff --git a/plumbing/kconfig/Makefile b/plumbing/kconfig/Makefile
index 817c50b6..c534359c 100644
--- a/plumbing/kconfig/Makefile
+++ b/plumbing/kconfig/Makefile
@@ -1,15 +1,12 @@
-include versions
-export BACKPORTS_VERSION KERNEL_VERSION KERNEL_NAME
+CFLAGS=-Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer
-menuconfig:
- gcc -Wp,-MD,kconfig/.conf.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/conf.o kconfig/conf.c
- gcc -Wp,-MD,kconfig/lxdialog/.checklist.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/lxdialog/checklist.o kconfig/lxdialog/checklist.c
- gcc -Wp,-MD,kconfig/lxdialog/.inputbox.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/lxdialog/inputbox.o kconfig/lxdialog/inputbox.c
- gcc -Wp,-MD,kconfig/lxdialog/.menubox.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/lxdialog/menubox.o kconfig/lxdialog/menubox.c
- gcc -Wp,-MD,kconfig/lxdialog/.textbox.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/lxdialog/textbox.o kconfig/lxdialog/textbox.c
- gcc -Wp,-MD,kconfig/lxdialog/.util.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/lxdialog/util.o kconfig/lxdialog/util.c
- gcc -Wp,-MD,kconfig/lxdialog/.yesno.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/lxdialog/yesno.o kconfig/lxdialog/yesno.c
- gcc -Wp,-MD,kconfig/.mconf.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -c -o kconfig/mconf.o kconfig/mconf.c
- gcc -Wp,-MD,kconfig/.zconf.tab.o.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -DCURSES_LOC="<ncurses.h>" -DLOCALE -Ikconfig -c -o kconfig/zconf.tab.o kconfig/zconf.tab.c
- gcc -o kconfig/mconf kconfig/mconf.o kconfig/zconf.tab.o kconfig/lxdialog/checklist.o kconfig/lxdialog/util.o kconfig/lxdialog/inputbox.o kconfig/lxdialog/textbox.o kconfig/lxdialog/yesno.o kconfig/lxdialog/menubox.o -lncurses
- ./kconfig/mconf Kconfig
+LXDIALOG := lxdialog/checklist.o lxdialog/inputbox.o lxdialog/menubox.o lxdialog/textbox.o lxdialog/util.o lxdialog/yesno.o
+
+conf: conf.o zconf.tab.o
+mconf: LDFLAGS = -lncurses
+mconf: CFLAGS += -DCURSES_LOC="<ncurses.h>" -DLOCALE
+mconf: mconf.o zconf.tab.o $(LXDIALOG)
+
+.PHONY: clean
+clean:
+ @rm -f mconf conf *.o lxdialog/*.o
diff --git a/plumbing/kconfig/lxdialog/check-lxdialog.sh b/plumbing/kconfig/lxdialog/check-lxdialog.sh
index 80788137..80788137 100644..100755
--- a/plumbing/kconfig/lxdialog/check-lxdialog.sh
+++ b/plumbing/kconfig/lxdialog/check-lxdialog.sh