From 837de2988b8b5c97e42b91ffc8c59ea84102f42a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 23 Feb 2015 15:03:14 -0600 Subject: another special handling for cris malloc needs to be fixed for linuxthreads in uClibc-ng git. --- mk/vars.mk | 7 +++++++ target/config/Config.in.cpu | 7 +++++-- target/cris/uclibc.config | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mk/vars.mk b/mk/vars.mk index 73929643c..b47ee053b 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -107,6 +107,7 @@ TARGET_LDFLAGS:= -L$(STAGING_TARGET_DIR)/lib -L$(STAGING_TARGET_DIR)/usr/lib \ -Wl,-O1 -Wl,-rpath -Wl,/usr/lib \ -Wl,-rpath-link -Wl,${STAGING_TARGET_DIR}/usr/lib +# for archiectures where gcc --with-cpu matches -mcpu= ifneq ($(ADK_TARGET_GCC_CPU),) ifeq ($(ADK_CPU_ARC700),y) TARGET_CFLAGS+= -mcpu=ARC700 @@ -117,11 +118,17 @@ TARGET_CXXFLAGS+= -mcpu=$(ADK_TARGET_GCC_CPU) endif endif +# for archiectures where gcc --with-arch matches -march= ifneq ($(ADK_TARGET_GCC_ARCH),) TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH) TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH) endif +ifneq ($(ADK_TARGET_CPU_FLAGS),) +TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS) +TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS) +endif + ifeq ($(ADK_TARGET_BINFMT_FLAT),y) TARGET_LDFLAGS+= -elf2flt endif diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu index f41204db4..d823501ba 100644 --- a/target/config/Config.in.cpu +++ b/target/config/Config.in.cpu @@ -305,8 +305,6 @@ config ADK_TARGET_GCC_CPU default "powerpc" if ADK_CPU_PPC default "powerpc64" if ADK_CPU_PPC64 default "ultrasparc" if ADK_CPU_SPARC_V9 - default "v10" if ADK_CPU_CRIS_V10 - default "v32" if ADK_CPU_CRIS_V32 default "v7.10.d" if ADK_CPU_MICROBLAZE default "v8" if ADK_CPU_SPARC_V8 default "x86-64" if ADK_CPU_X86_64 @@ -320,6 +318,11 @@ config ADK_TARGET_GCC_ARCH default "mips64" if ADK_CPU_MIPS64 default "mips64r2" if ADK_CPU_MIPS64R2 +config ADK_TARGET_CPU_FLAGS + string + default "-mcpu=v10" if ADK_CPU_CRIS_V10 + default "-mcpu=v32" if ADK_CPU_CRIS_V32 + config ADK_TARGET_CPU_ARCH string default "aarch64" if ADK_TARGET_ARCH_AARCH64 && ADK_little diff --git a/target/cris/uclibc.config b/target/cris/uclibc.config index 5d952788d..6911ce9cc 100644 --- a/target/cris/uclibc.config +++ b/target/cris/uclibc.config @@ -89,9 +89,9 @@ UCLIBC_HAS_THREADS=y PTHREADS_DEBUG_SUPPORT=y UCLIBC_HAS_SYSLOG=y UCLIBC_HAS_LFS=y -MALLOC=y +# MALLOC=y # MALLOC_SIMPLE is not set -# MALLOC_STANDARD is not set +MALLOC_STANDARD=y MALLOC_GLIBC_COMPAT=y UCLIBC_HAS_OBSTACK=y UCLIBC_DYNAMIC_ATEXIT=y -- cgit v1.2.3 From f7fb97a8e2160a791487f5a2cd9f744b04cf39bb Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 19:26:26 +0100 Subject: always use .defconfig, otherwise make menuconfig and ADK_APPLIANCE does not work --- mk/build.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mk/build.mk b/mk/build.mk index 214c52e88..0e41b0002 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -458,9 +458,7 @@ endif |sed -e "s#^config \(.*\)#\1=y#" \ >> $(ADK_TOPDIR)/.defconfig; \ fi - @if [ ! -z "$(ADK_APPLIANCE)" ];then \ - $(CONFIG)/conf --defconfig=.defconfig $(CONFIG_CONFIG_IN); \ - fi + @$(CONFIG)/conf --defconfig=.defconfig $(CONFIG_CONFIG_IN) allconfig: ifeq (${OStype},Linux) -- cgit v1.2.3 From 9424fa05a9f81f661d61ce3bef02a44ffbda3a53 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 19:30:21 +0100 Subject: add an useful example for appliance option files --- target/appliances/mpd.options | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 target/appliances/mpd.options diff --git a/target/appliances/mpd.options b/target/appliances/mpd.options new file mode 100644 index 000000000..dac0ba37c --- /dev/null +++ b/target/appliances/mpd.options @@ -0,0 +1,16 @@ +choice +prompt "Choose a GUI" +depends on ADK_APPLIANCE_MPD + +config ADK_APPLIANCE_MPD_MPDBOX + bool "use mpdbox html/javascript frontend" + select ADK_PACKAGE_MPDBOX + +config ADK_APPLIANCE_MPD_YMPD + bool "use ympd frontend" + select ADK_PACKAGE_YMPD + +config ADK_APPLIANCE_MPD_NOGUI + bool "use no gui frontend" + +endchoice -- cgit v1.2.3 From 8717248d7a639bd9463cd593cd6b7a8549970879 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 13:26:18 -0600 Subject: disable uClibc-ng (not ready). fix gcc configure --- target/config/Config.in.cpu | 2 +- target/config/Config.in.libc.choice | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/config/Config.in.cpu b/target/config/Config.in.cpu index d823501ba..dc0cc5478 100644 --- a/target/config/Config.in.cpu +++ b/target/config/Config.in.cpu @@ -305,7 +305,6 @@ config ADK_TARGET_GCC_CPU default "powerpc" if ADK_CPU_PPC default "powerpc64" if ADK_CPU_PPC64 default "ultrasparc" if ADK_CPU_SPARC_V9 - default "v7.10.d" if ADK_CPU_MICROBLAZE default "v8" if ADK_CPU_SPARC_V8 default "x86-64" if ADK_CPU_X86_64 default "xscale" if ADK_CPU_XSCALE @@ -322,6 +321,7 @@ config ADK_TARGET_CPU_FLAGS string default "-mcpu=v10" if ADK_CPU_CRIS_V10 default "-mcpu=v32" if ADK_CPU_CRIS_V32 + default "-mcpu=v7.10.d" if ADK_CPU_MICROBLAZE config ADK_TARGET_CPU_ARCH string diff --git a/target/config/Config.in.libc.choice b/target/config/Config.in.libc.choice index 572beae75..9a3587131 100644 --- a/target/config/Config.in.libc.choice +++ b/target/config/Config.in.libc.choice @@ -10,6 +10,7 @@ config ADK_TARGET_LIB_UCLIBC_NG depends on \ !ADK_TARGET_ARCH_AARCH64 && \ !ADK_TARGET_ARCH_ALPHA && \ + !ADK_TARGET_ARCH_MICROBLAZE && \ !ADK_TARGET_ARCH_NIOS2 && \ !ADK_TARGET_ARCH_SPARC64 && \ !ADK_TARGET_ARCH_PPC64 && \ -- cgit v1.2.3 From fece8b08c7cd7ea201958224fd35b0456ed53dd3 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 13:27:54 -0600 Subject: set CFLAGS for float/fpu correctly --- mk/vars.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mk/vars.mk b/mk/vars.mk index b47ee053b..ec5d89fdb 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -129,6 +129,22 @@ TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS) TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS) endif +ifneq ($(ADK_TARGET_FPU),) +TARGET_CFLAGS+= -mfpu=$(ADK_TARGET_FPU) +TARGET_CXXFLAGS+= -mfpu=$(ADK_TARGET_FPU) +endif + +ifneq ($(ADK_TARGET_FLOAT),) +ifeq ($(ADK_TARGET_ARCH_ARM),y) +TARGET_CFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT) +TARGET_CXXFLAGS+= -mfloat-abi=$(ADK_TARGET_FLOAT) +endif +ifeq ($(ADK_TARGET_ARCH_MIPS),y) +TARGET_CFLAGS+= -m$(ADK_TARGET_FLOAT)-float +TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float +endif +endif + ifeq ($(ADK_TARGET_BINFMT_FLAT),y) TARGET_LDFLAGS+= -elf2flt endif -- cgit v1.2.3 From 8deba1c4a219fea66444eb4335dbb24134da4302 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 13:32:15 -0600 Subject: strip variable --- rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.mk b/rules.mk index 14935b928..d3abcf90c 100644 --- a/rules.mk +++ b/rules.mk @@ -39,6 +39,7 @@ ADK_TARGET_FLOAT:= $(strip $(subst ",, $(ADK_TARGET_FLOAT))) ADK_TARGET_FPU:= $(strip $(subst ",, $(ADK_TARGET_FPU))) ADK_TARGET_ARM_MODE:= $(strip $(subst ",, $(ADK_TARGET_ARM_MODE))) ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS))) +ADK_TARGET_CPU_FLAGS:= $(strip $(subst ",, $(ADK_TARGET_CPU_FLAGS))) ADK_TARGET_CFLAGS_OPT:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS_OPT))) ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS))) ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI))) -- cgit v1.2.3 From 48e41e6921d8817afe9bd6a79f476f34957fbc60 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 13:35:33 -0600 Subject: m68k specific LDFLAGS --- mk/vars.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/vars.mk b/mk/vars.mk index ec5d89fdb..ba4a29924 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -124,6 +124,7 @@ TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH) TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH) endif +<<<<<<< HEAD ifneq ($(ADK_TARGET_CPU_FLAGS),) TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS) TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS) @@ -145,11 +146,10 @@ TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float endif endif +ifeq ($(ADK_TARGET_ARCH_M68K),y) ifeq ($(ADK_TARGET_BINFMT_FLAT),y) TARGET_LDFLAGS+= -elf2flt endif - -ifeq ($(ADK_TARGET_ARCH_M68K),y) ifeq ($(ADK_TARGET_BINFMT_FLAT_SEP_DATA),y) TARGET_CFLAGS+= -msep-data TARGET_CXXFLAGS+= -msep-data -- cgit v1.2.3 From 0d5476f287f4f5c0a74c4f5b42025dfe0ce3b253 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Feb 2015 14:09:55 -0600 Subject: use elf2flt CFLAGS for ARM with BINFMT_FLAT --- mk/vars.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mk/vars.mk b/mk/vars.mk index ba4a29924..563806b44 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -124,7 +124,6 @@ TARGET_CFLAGS+= -march=$(ADK_TARGET_GCC_ARCH) TARGET_CXXFLAGS+= -march=$(ADK_TARGET_GCC_ARCH) endif -<<<<<<< HEAD ifneq ($(ADK_TARGET_CPU_FLAGS),) TARGET_CFLAGS+= $(ADK_TARGET_CPU_FLAGS) TARGET_CXXFLAGS+= $(ADK_TARGET_CPU_FLAGS) @@ -146,6 +145,12 @@ TARGET_CXXFLAGS+= -m$(ADK_TARGET_FLOAT)-float endif endif +ifeq ($(ADK_TARGET_ARCH_ARM),y) +ifeq ($(ADK_TARGET_BINFMT_FLAT),y) +TARGET_CFLAGS+= -Wl,-elf2flt +endif +endif + ifeq ($(ADK_TARGET_ARCH_M68K),y) ifeq ($(ADK_TARGET_BINFMT_FLAT),y) TARGET_LDFLAGS+= -elf2flt -- cgit v1.2.3 From bc0da7eef3742cab7ed9c2efc4a42a85cc4ea767 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 26 Feb 2015 19:44:50 +0100 Subject: build for mips64 big endian soft-float generates warnings Cairo's check for threads does not work correclty when assembler or linker give warnings. Add a workaround for this. --- package/cairo/Makefile | 10 +--- package/cairo/patches/patch-Makefile_in | 8 +-- package/cairo/patches/patch-configure | 101 ++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 package/cairo/patches/patch-configure diff --git a/package/cairo/Makefile b/package/cairo/Makefile index a3cba33f8..146876d44 100644 --- a/package/cairo/Makefile +++ b/package/cairo/Makefile @@ -4,9 +4,9 @@ include ${ADK_TOPDIR}/rules.mk PKG_NAME:= cairo -PKG_VERSION:= 1.12.16 -PKG_RELEASE:= 4 -PKG_HASH:= 2505959eb3f1de3e1841023b61585bfd35684b9733c7b6a3643f4f4cbde6d846 +PKG_VERSION:= 1.14.0 +PKG_RELEASE:= 1 +PKG_HASH:= 2cf5f81432e77ea4359af9dcd0f4faf37d015934501391c311bfd2d19a0134b7 PKG_DESCR:= cairo graphics library PKG_SECTION:= libs/image PKG_DEPENDS:= fontconfig libfreetype libx11 pixman @@ -35,8 +35,6 @@ include ${ADK_TOPDIR}/mk/package.mk $(eval $(call HOST_template,CAIRO,cairo,${PKG_VERSION}-${PKG_RELEASE})) $(eval $(call PKG_template,CAIRO,cairo,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS})) - - HOST_CONFIGURE_ARGS+= --enable-ft=yes \ --enable-png=yes \ --enable-fc=yes \ @@ -88,8 +86,6 @@ else CONFIGURE_ARGS+= --enable-tee=no endif - - CONFIGURE_ARGS+= --enable-ft=yes \ --enable-fc=yes \ --enable-xlib=yes \ diff --git a/package/cairo/patches/patch-Makefile_in b/package/cairo/patches/patch-Makefile_in index 266149788..8716b0820 100644 --- a/package/cairo/patches/patch-Makefile_in +++ b/package/cairo/patches/patch-Makefile_in @@ -1,6 +1,6 @@ ---- cairo-1.12.16.orig/Makefile.in 2013-08-26 19:00:44.000000000 +0200 -+++ cairo-1.12.16/Makefile.in 2014-02-10 14:44:58.000000000 +0100 -@@ -80,7 +80,7 @@ EXTRA_PROGRAMS = +--- cairo-1.14.0.orig/Makefile.in 2014-10-14 03:47:28.000000000 +0200 ++++ cairo-1.14.0/Makefile.in 2015-02-26 11:39:05.000000000 +0100 +@@ -63,7 +63,7 @@ EXTRA_PROGRAMS = TESTS = check_PROGRAMS = # libpng is required for our test programs @@ -9,7 +9,7 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/build/aclocal.cairo.m4 \ -@@ -439,7 +439,7 @@ MAINTAINERCLEANFILES = Makefile.in $(src +@@ -417,7 +417,7 @@ MAINTAINERCLEANFILES = Makefile.in $(src # $(srcdir)/build/Makefile.win32.features-h \ # $(NULL) ACLOCAL_AMFLAGS = -I build ${ACLOCAL_FLAGS} diff --git a/package/cairo/patches/patch-configure b/package/cairo/patches/patch-configure new file mode 100644 index 000000000..9e0f39f0d --- /dev/null +++ b/package/cairo/patches/patch-configure @@ -0,0 +1,101 @@ +--- cairo-1.14.0.orig/configure 2014-10-14 03:47:29.000000000 +0200 ++++ cairo-1.14.0/configure 2015-02-26 13:27:59.000000000 +0100 +@@ -18371,7 +18371,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -18418,7 +18418,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -18469,7 +18469,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -18516,7 +18516,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -18585,7 +18585,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -18641,7 +18641,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -20089,7 +20089,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -20136,7 +20136,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -33208,7 +33208,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -33327,7 +33327,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false ; then + cairo_cc_flag=no + fi + +@@ -33408,7 +33408,7 @@ fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +- if test "x$cairo_cc_stderr" != "x"; then ++ if false; then + cairo_cc_flag=no + fi + -- cgit v1.2.3 From 8c769691094121b098709c66001c5aca6d34f0bb Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 26 Feb 2015 20:51:09 +0100 Subject: Revert "always use .defconfig, otherwise make menuconfig and ADK_APPLIANCE does not work" This reverts commit f7fb97a8e2160a791487f5a2cd9f744b04cf39bb. --- mk/build.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mk/build.mk b/mk/build.mk index 0e41b0002..214c52e88 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -458,7 +458,9 @@ endif |sed -e "s#^config \(.*\)#\1=y#" \ >> $(ADK_TOPDIR)/.defconfig; \ fi - @$(CONFIG)/conf --defconfig=.defconfig $(CONFIG_CONFIG_IN) + @if [ ! -z "$(ADK_APPLIANCE)" ];then \ + $(CONFIG)/conf --defconfig=.defconfig $(CONFIG_CONFIG_IN); \ + fi allconfig: ifeq (${OStype},Linux) -- cgit v1.2.3 From f2179916b592f8a0a1feb89f992e1d496f0d62cb Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:46 +0100 Subject: Config.in: show kernel configuration menu only if ADK_TARGET_KERNEL_CUSTOMISING is set --- Config.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config.in b/Config.in index d3bbbfd3d..210c68dab 100644 --- a/Config.in +++ b/Config.in @@ -102,7 +102,7 @@ source "target/config/Config.in.runtime" endmenu menu "Kernel configuration" - visible if !ADK_CHOOSE_APPLIANCE + visible if !ADK_CHOOSE_APPLIANCE && ADK_TARGET_KERNEL_CUSTOMISING source "target/linux/Config.in" endmenu -- cgit v1.2.3 From a1f303c316be60e5a282a6a6a27726152b529a51 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:47 +0100 Subject: extend KERNEL_MAKE_OPTS by the target directory This change is straightforward but in toolchain/kernel-headers/Makefile which seems to be called before ${BUILD_DIR}/linux symlink exists. Therefore define LINUX_DIR to the correct value in between inclusion of vars.mk (through rules.mk) and kernel-vars.mk. --- mk/build.mk | 2 +- mk/image.mk | 2 +- mk/kernel-build.mk | 6 +++--- mk/kernel-vars.mk | 2 +- target/arm/Makefile | 5 ++--- target/ppc/Makefile | 2 +- toolchain/kernel-headers/Makefile | 11 ++++++++--- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/mk/build.mk b/mk/build.mk index 214c52e88..29c99bd6f 100644 --- a/mk/build.mk +++ b/mk/build.mk @@ -223,7 +223,7 @@ kernelconfig: ${KERNEL_MAKE_ENV} ${MAKE} \ ARCH=$(ADK_TARGET_ARCH) \ ${KERNEL_MAKE_OPTS} \ - -C $(BUILD_DIR)/linux menuconfig + menuconfig # create a new package from package/.template newpackage: diff --git a/mk/image.mk b/mk/image.mk index bd7d66f96..1563c2a63 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -203,7 +203,7 @@ ifeq ($(ADK_KERNEL_COMP_BZIP2),y) echo "CONFIG_INITRAMFS_COMPRESSION_BZIP2=y" >> ${LINUX_DIR}/.config endif @-rm $(LINUX_DIR)/usr/initramfs_data.cpio* 2>/dev/null - env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \ + env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \ -j${ADK_MAKE_JOBS} $(ADK_TARGET_KERNEL) $(MAKE_TRACE) @cp $(KERNEL) $(FW_DIR)/$(TARGET_KERNEL) diff --git a/mk/kernel-build.mk b/mk/kernel-build.mk index b66f71132..37570909e 100644 --- a/mk/kernel-build.mk +++ b/mk/kernel-build.mk @@ -35,18 +35,18 @@ $(LINUX_DIR)/.config: $(LINUX_DIR)/.prepared $(BUILD_DIR)/.kernelconfig $(ADK_TO $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-configure -for f in $(TARGETS);do if [ -f $$f ];then rm $$f;fi;done $(CP) $(BUILD_DIR)/.kernelconfig $(LINUX_DIR)/mini.config - ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG=mini.config allnoconfig $(MAKE_TRACE) + ${KERNEL_MAKE_ENV} $(MAKE) ${KERNEL_MAKE_OPTS} KCONFIG_ALLCONFIG=mini.config allnoconfig $(MAKE_TRACE) touch -c $(LINUX_DIR)/.config $(LINUX_DIR)/$(KERNEL_FILE): $(LINUX_DIR)/.config $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-compile - ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} LOCALVERSION="" $(KERNEL_TARGET) modules $(MAKE_TRACE) + ${KERNEL_MAKE_ENV} $(MAKE) ${KERNEL_MAKE_OPTS} -j${ADK_MAKE_JOBS} LOCALVERSION="" $(KERNEL_TARGET) modules $(MAKE_TRACE) touch -c $(LINUX_DIR)/$(KERNEL_FILE) $(LINUX_BUILD_DIR)/modules: $(LINUX_DIR)/$(KERNEL_FILE) $(TRACE) target/$(ADK_TARGET_ARCH)-kernel-modules-install rm -rf $(LINUX_BUILD_DIR)/modules - ${KERNEL_MAKE_ENV} $(MAKE) -C "${LINUX_DIR}" ${KERNEL_MAKE_OPTS} DEPMOD=true \ + ${KERNEL_MAKE_ENV} $(MAKE) ${KERNEL_MAKE_OPTS} DEPMOD=true \ INSTALL_MOD_PATH=$(LINUX_BUILD_DIR)/modules \ LOCALVERSION="" \ modules_install $(MAKE_TRACE) diff --git a/mk/kernel-vars.mk b/mk/kernel-vars.mk index 17a8d23a2..89ba10dd9 100644 --- a/mk/kernel-vars.mk +++ b/mk/kernel-vars.mk @@ -1,7 +1,7 @@ # This file is part of the OpenADK project. OpenADK is copyrighted # material, please see the LICENCE file in the top-level directory. -KERNEL_MAKE_OPTS:= V=1 \ +KERNEL_MAKE_OPTS:= V=1 -C "${LINUX_DIR}" \ ARCH="$(ADK_TARGET_KARCH)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ diff --git a/target/arm/Makefile b/target/arm/Makefile index 9efddfac9..634bee924 100644 --- a/target/arm/Makefile +++ b/target/arm/Makefile @@ -108,11 +108,10 @@ kernel-install: kernel-strip dtb-install: ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y) - env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \ - dtbs $(MAKE_TRACE) + env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) dtbs $(MAKE_TRACE) endif ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y) - env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \ + env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \ imx6q-cubox-i.dtb imx6dl-cubox-i.dtb imx6dl-hummingboard.dtb imx6q-hummingboard.dtb $(MAKE_TRACE) endif for x in $(LINUX_DIR)/arch/arm/boot/dts/*.dtb; do \ diff --git a/target/ppc/Makefile b/target/ppc/Makefile index e1df1ef29..9a5529642 100644 --- a/target/ppc/Makefile +++ b/target/ppc/Makefile @@ -71,7 +71,7 @@ kernel-install: kernel-strip @cp $(BUILD_DIR)/$(TARGET_KERNEL) $(FW_DIR)/${TARGET_KERNEL} dtb-install: - env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \ + env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \ -j${ADK_MAKE_JOBS} virtex440-ml507.dtb $(MAKE_TRACE) $(CP) $(LINUX_DIR)/arch/powerpc/boot/virtex440-ml507.dtb \ $(FW_DIR)/ppc.dtb diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 1b28c151a..1d24d3853 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -5,9 +5,14 @@ include $(ADK_TOPDIR)/rules.mk include ../rules.mk include $(ADK_TOPDIR)/mk/kernel-ver.mk include $(ADK_TOPDIR)/mk/linux.mk -include $(ADK_TOPDIR)/mk/kernel-vars.mk include $(ADK_TOPDIR)/mk/buildhlp.mk +# override linux dir here, as build_bla_bla/linux does not exist yet +LINUX_DIR=${WRKBUILD} + +include $(ADK_TOPDIR)/mk/kernel-vars.mk + + $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched: ifeq ($(ADK_TARGET_SYSTEM_PCENGINES_APU),y) ifeq ($(ADK_KERNEL_ROOT_NFS),y) @@ -60,8 +65,8 @@ endif touch $@ $(WRKBUILD)/.headers: $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/linux-$(KERNEL_VERSION)/.patched - $(KERNEL_MAKE_ENV) $(MAKE) -C $(WRKBUILD) $(KERNEL_MAKE_OPTS) headers_check - $(KERNEL_MAKE_ENV) $(MAKE) -C $(WRKBUILD) $(KERNEL_MAKE_OPTS) \ + $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) headers_check + $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \ INSTALL_HDR_PATH=$(STAGING_TARGET_DIR)/usr \ headers_install ifeq ($(ADK_TARGET_ARCH_CRIS),y) -- cgit v1.2.3 From 9405258299212c12f639e0d200c5721e24c887f3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:48 +0100 Subject: mk/fetch.mk: fix .nohash hack for packages with multiple distfiles --- mk/fetch.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/fetch.mk b/mk/fetch.mk index 5fb13a29e..6365b4c13 100644 --- a/mk/fetch.mk +++ b/mk/fetch.mk @@ -28,7 +28,7 @@ ifeq ($(strip ${PKG_NOCHECKSUM}),) ${_CHECKSUM_COOKIE}: ${FULLDISTFILES} -rm -rf ${WRKDIR} ifneq ($(ADK_DISABLE_CHECKSUM),y) - @if [ ! -e "${FULLDISTFILES}.nohash" ]; then \ + @if [ ! -e $(firstword ${FULLDISTFILES}).nohash ]; then \ OK=n; \ allsums="$(strip ${PKG_HASH})"; \ (shasum -a 256 ${FULLDISTFILES}; echo exit) | while read sum name; do \ -- cgit v1.2.3 From b35d9328163f84e2d7dc6f2504c5e7c3fffc92dd Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:49 +0100 Subject: toolchain: add cross prelinking tool from yoctoproject and hook it into build system --- mk/image.mk | 15 ++++++++++++++- target/config/Config.in.adk | 12 ++++++++++++ toolchain/Makefile | 3 +++ toolchain/prelink-cross/Config.in | 1 + toolchain/prelink-cross/Makefile | 34 ++++++++++++++++++++++++++++++++++ toolchain/prelink-cross/Makefile.inc | 8 ++++++++ 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 toolchain/prelink-cross/Config.in create mode 100644 toolchain/prelink-cross/Makefile create mode 100644 toolchain/prelink-cross/Makefile.inc diff --git a/mk/image.mk b/mk/image.mk index 1563c2a63..7d982d773 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -37,7 +37,7 @@ else $(error No login shell configured!) endif -imageprepare: image-prepare-post extra-install +imageprepare: image-prepare-post extra-install prelink # if an extra directory exist in ADK_TOPDIR, copy all content over the # root directory, do the same if make extra=/dir/to/extra is used @@ -79,6 +79,19 @@ ifneq ($(ADK_TARGET_ARCH_AARCH64)$(ADK_TARGET_ARCH_X86_64)$(ADK_TARGET_ARCH_PPC6 (cd ${TARGET_DIR}/usr ; ln -sf ${ADK_TARGET_LIBC_PATH} lib) endif +ifeq (${ADK_PRELINK},) +prelink: +else +${TARGET_DIR}/etc/prelink.conf: + echo '/' > $@ + +prelink: ${TARGET_DIR}/etc/prelink.conf + $(TRACE) target/prelink + ${TARGET_CROSS}prelink ${ADK_PRELINK_OPTS} \ + --ld-library-path=${STAGING_TARGET_DIR}/usr/lib:${STAGING_TARGET_DIR}/lib \ + --root=${TARGET_DIR} -a $(MAKE_TRACE) +endif + KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(KERNEL_VERSION)_$(ADK_TARGET_CPU_ARCH).$(PKG_SUFFIX) TARGET_KERNEL= ${ADK_TARGET_SYSTEM}-${ADK_TARGET_FS}-kernel diff --git a/target/config/Config.in.adk b/target/config/Config.in.adk index 86f38c2dd..90759cea2 100644 --- a/target/config/Config.in.adk +++ b/target/config/Config.in.adk @@ -110,4 +110,16 @@ config ADK_HOST_CYGWIN bool "Cygwin" endchoice + +config ADK_PRELINK + prompt "Prelink binaries and libraries in Image" + boolean + help + Do prelinking for faster loading of binaries. + +config ADK_PRELINK_OPTS + string "additional options to pass to prelink" + default "-mR" + depends on ADK_PRELINK + endmenu diff --git a/toolchain/Makefile b/toolchain/Makefile index 23f206ee7..e06e58de9 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -44,6 +44,9 @@ ifeq ($(ADK_TARGET_ARCH_ARC),) TARGETS+=gdb GDB:=gdb-install endif +ifeq (${ADK_PRELINK},y) +TARGETS+=prelink-cross +endif DOWNLOAD:=kernel-headers-download $(patsubst %,%-download,$(TARGETS)) TARGETS_INSTALL:=$(patsubst %,%-install,$(TARGETS)) diff --git a/toolchain/prelink-cross/Config.in b/toolchain/prelink-cross/Config.in new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/toolchain/prelink-cross/Config.in @@ -0,0 +1 @@ + diff --git a/toolchain/prelink-cross/Makefile b/toolchain/prelink-cross/Makefile new file mode 100644 index 000000000..d1cc58c07 --- /dev/null +++ b/toolchain/prelink-cross/Makefile @@ -0,0 +1,34 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk +include ../rules.mk +include Makefile.inc +include ${ADK_TOPDIR}/mk/buildhlp.mk + +$(WRKBUILD)/.headers: +$(WRKBUILD)/.configured: + (cd $(WRKBUILD)/trunk; \ + ./configure \ + --prefix=$(STAGING_HOST_DIR) \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_HOST_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --disable-dependency-tracking \ + --disable-libtool-lock \ + --with-gnu-ld \ + ); + touch $@ + +$(WRKBUILD)/.compiled: + $(MAKE) -C $(WRKBUILD)/trunk CFLAGS="-fPIC ${CFLAGS_FOR_BUILD}" + touch $@ + +$(WRKBUILD)/.installed: + install -c ${WRKBUILD}/trunk/src/prelink \ + ${TARGET_CROSS}prelink + install -c ${WRKBUILD}/trunk/src/prelink-rtld \ + ${TARGET_CROSS}prelink-rtld + touch $@ + +include ${ADK_TOPDIR}/mk/toolchain.mk diff --git a/toolchain/prelink-cross/Makefile.inc b/toolchain/prelink-cross/Makefile.inc new file mode 100644 index 000000000..634a18b84 --- /dev/null +++ b/toolchain/prelink-cross/Makefile.inc @@ -0,0 +1,8 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +# this is branch cross_prelink_r185 in git +PKG_NAME:= prelink-cross +PKG_VERSION:= 909470ee441237563d6236c505cb2d02ddc48704 +PKG_RELEASE:= 1 +PKG_SITES:= git://git.yoctoproject.org/prelink-cross -- cgit v1.2.3 From 1081ca94b8738cb63f01641d4a615bb0d9ff8dcf Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:50 +0100 Subject: mk/package.mk: fix for cleaning packages Due to using the wrong name, the packages stamp file was not removed and therefore it was not rebuilt at all. --- mk/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/package.mk b/mk/package.mk index 65d9c8f9f..3b27d1278 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -308,7 +308,7 @@ clean-targets: clean: @$(CMD_TRACE) "cleaning... " @$(MAKE) clean-targets $(MAKE_TRACE) - rm -rf ${WRKDIR} ${ALL_IPKGS} ${STAGING_PKG_DIR}/stamps/${PKG_NAME}${PKG_VERSION} + rm -rf ${WRKDIR} ${ALL_IPKGS} ${_IPKGS_COOKIE} distclean: clean rm -f ${FULLDISTFILES} -- cgit v1.2.3 From 078ea350bf6ec3102215491e342266254c4fd845 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:51 +0100 Subject: import package aufs-util --- package/aufs-util/Makefile | 44 ++++++++++++++++++++++++++++++++ package/aufs-util/patches/patch-Makefile | 23 +++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 package/aufs-util/Makefile create mode 100644 package/aufs-util/patches/patch-Makefile diff --git a/package/aufs-util/Makefile b/package/aufs-util/Makefile new file mode 100644 index 000000000..e00b5bdde --- /dev/null +++ b/package/aufs-util/Makefile @@ -0,0 +1,44 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= aufs-util +# branch aufs3.x-rcN (of around June 6th, 2014) +PKG_VERSION:= a0eb20c75c07299bfc50c3d80023e1d22c86b4cc +PKG_RELEASE:= 1 +PKG_HASH:= asdf +PKG_DESCR:= aufs utilities (version 3 and above) +PKG_SECTION:= sys/fs +PKG_URL:= http://aufs.sf.net/ +PKG_SITES:= git://aufs.git.sourceforge.net/gitroot/aufs/aufs-util + +PKG_HOST_DEPENDS:= !cygwin !freebsd !openbsd !netbsd + +PKG_SUBPKGS:= AUFS_UTIL LIBAU +PKGSD_LIBAU:= aufs userspace library + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,AUFS_UTIL,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) +$(eval $(call PKG_template,LIBAU,libau,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_LIBAU},${PKG_SECTION})) + +CONFIG_STYLE:= manual +XAKE_FLAGS+= Install=install \ + HOSTCC="${HOST_CC}" \ + CPPFLAGS_FOR_BUILD="-I${STAGING_TARGET_DIR}/usr/include -I./libau" + +post-install: + $(INSTALL_DIR) $(IDIR_AUFS_UTIL)/sbin + $(INSTALL_BIN) ${WRKINST}/sbin/{{u,}mount.aufs,auplink} \ + $(IDIR_AUFS_UTIL)/sbin + $(INSTALL_DIR) $(IDIR_AUFS_UTIL)/usr/bin + $(INSTALL_BIN) ${WRKINST}/usr/bin/au{brsync,chk} \ + $(IDIR_AUFS_UTIL)/usr/bin + $(INSTALL_DIR) $(IDIR_AUFS_UTIL)/etc/default + $(INSTALL_DATA) ${WRKINST}/etc/default/aufs \ + $(IDIR_AUFS_UTIL)/etc/default + $(INSTALL_DIR) $(IDIR_LIBAU)/usr/lib + ${CP} ${WRKINST}/usr/lib/libau* ${IDIR_LIBAU}/usr/lib + +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/aufs-util/patches/patch-Makefile b/package/aufs-util/patches/patch-Makefile new file mode 100644 index 000000000..0253076f1 --- /dev/null +++ b/package/aufs-util/patches/patch-Makefile @@ -0,0 +1,23 @@ + - Ensure correct (HOST-)FLAGS when compiling the intermediates + - Drop version test, this cant work anyway since there is no aufs3.12 branch anywhere +--- w-aufs-util-3.x-rcN-050614-1.orig/Makefile 2014-05-06 15:36:53.000000000 +0200 ++++ w-aufs-util-3.x-rcN-050614-1/Makefile 2014-06-05 14:32:53.496611173 +0200 +@@ -49,7 +49,7 @@ LibUtilObj = perror.o proc_mnt.o br.o pl + LibUtilHdr = au_util.h + export + +-all: ver_test ${Man} ${Bin} ${Etc} ++all: ${Man} ${Bin} ${Etc} + ${MAKE} -C libau $@ + ln -sf ./libau/libau*.so . + +@@ -85,6 +85,9 @@ aufs.5: aufs.in.5 c2tmac + chmod a-w $@ + + c2sh c2tmac ver: CC = ${HOSTCC} ++c2sh c2tmac ver: CFLAGS = ${CFLAGS_FOR_BUILD} ++c2sh c2tmac ver: LDFLAGS = ${LDFLAGS_FOR_BUILD} ++c2sh c2tmac ver: CPPFLAGS = ${CPPFLAGS_FOR_BUILD} + .INTERMEDIATE: c2sh c2tmac ver + + Install = install -o root -g root -p -- cgit v1.2.3 From 4b45b4b6517d76d769dafa6da23ef13aa1315388 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:52 +0100 Subject: package/busybox: prevent ip applet compile when iproute2 is active --- package/busybox/config/networking/Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/package/busybox/config/networking/Config.in b/package/busybox/config/networking/Config.in index 6e68fc786..d5bbad0ef 100644 --- a/package/busybox/config/networking/Config.in +++ b/package/busybox/config/networking/Config.in @@ -488,6 +488,7 @@ config BUSYBOX_FEATURE_IFUPDOWN_IP_BUILTIN bool "Use busybox ip applet" default y depends on BUSYBOX_FEATURE_IFUPDOWN_IP + depends on !ADK_PACKAGE_IP select BUSYBOX_PLATFORM_LINUX select BUSYBOX_IP select BUSYBOX_FEATURE_IP_ADDRESS -- cgit v1.2.3 From 2c5a022d3e65779668f071446d80cf27bfe4c037 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 24 Feb 2015 12:46:53 +0100 Subject: port packages mISDN, mISDNuser and capi4k-utils mISDN still has some unresolved problems with sysfs object creation, to be fixed. --- package/capi4k-utils/Makefile | 47 ++ package/capi4k-utils/patches/patch-Makefile | 42 + .../capi4k-utils/patches/patch-avmb1_Makefile_in | 14 + package/capi4k-utils/patches/patch-capi20_capi20_h | 11 + .../patches/patch-capiinfo_Makefile_in | 18 + .../patches/patch-pppdcapiplugin_Makefile | 12 + .../patches/patch-pppdcapiplugin_Rules_make | 18 + .../capi4k-utils/patches/patch-rcapid_Makefile_in | 23 + .../src/pppdcapiplugin/ppp-2.4.5/Makefile | 14 + .../src/pppdcapiplugin/ppp-2.4.5/pppd/patchlevel.h | 2 + .../src/pppdcapiplugin/ppp-2.4.5/pppd/pppd.h | 909 +++++++++++++++++++++ package/mISDN/Makefile | 36 + package/mISDN/patches/patch-Makefile | 53 ++ .../patch-drivers_isdn_hardware_mISDN_contr_c | 65 ++ .../patch-drivers_isdn_hardware_mISDN_core_c | 75 ++ .../patch-drivers_isdn_hardware_mISDN_core_h | 19 + .../patch-drivers_isdn_hardware_mISDN_debugtool_c | 49 ++ .../patch-drivers_isdn_hardware_mISDN_hfcs_usb_c | 17 + .../patch-drivers_isdn_hardware_mISDN_stack_c | 34 + .../patch-drivers_isdn_hardware_mISDN_sysfs_inst_c | 30 + .../patch-drivers_isdn_hardware_mISDN_sysfs_obj_c | 33 + .../patch-drivers_isdn_hardware_mISDN_sysfs_st_c | 18 + .../patch-drivers_isdn_hardware_mISDN_udevice_c | 36 + package/mISDNuser/Makefile | 32 + package/mISDNuser/patches/patch-Makefile | 16 + package/mISDNuser/patches/patch-debugtool_Makefile | 9 + package/mISDNuser/patches/patch-i4lnet_Makefile | 9 + package/mISDNuser/patches/patch-lib_Makefile | 9 + package/mISDNuser/patches/patch-suppserv_Makefile | 9 + 29 files changed, 1659 insertions(+) create mode 100644 package/capi4k-utils/Makefile create mode 100644 package/capi4k-utils/patches/patch-Makefile create mode 100644 package/capi4k-utils/patches/patch-avmb1_Makefile_in create mode 100644 package/capi4k-utils/patches/patch-capi20_capi20_h create mode 100644 package/capi4k-utils/patches/patch-capiinfo_Makefile_in create mode 100644 package/capi4k-utils/patches/patch-pppdcapiplugin_Makefile create mode 100644 package/capi4k-utils/patches/patch-pppdcapiplugin_Rules_make create mode 100644 package/capi4k-utils/patches/patch-rcapid_Makefile_in create mode 100755 package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/Makefile create mode 100644 package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/patchlevel.h create mode 100644 package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/pppd.h create mode 100644 package/mISDN/Makefile create mode 100644 package/mISDN/patches/patch-Makefile create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_contr_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_core_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_core_h create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_debugtool_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_hfcs_usb_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_stack_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_sysfs_inst_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_sysfs_obj_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_sysfs_st_c create mode 100644 package/mISDN/patches/patch-drivers_isdn_hardware_mISDN_udevice_c create mode 100644 package/mISDNuser/Makefile create mode 100644 package/mISDNuser/patches/patch-Makefile create mode 100644 package/mISDNuser/patches/patch-debugtool_Makefile create mode 100644 package/mISDNuser/patches/patch-i4lnet_Makefile create mode 100644 package/mISDNuser/patches/patch-lib_Makefile create mode 100644 package/mISDNuser/patches/patch-suppserv_Makefile diff --git a/package/capi4k-utils/Makefile b/package/capi4k-utils/Makefile new file mode 100644 index 000000000..8363c4b33 --- /dev/null +++ b/package/capi4k-utils/Makefile @@ -0,0 +1,47 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= capi4k-utils +PKG_VERSION:= 2005-07-18 +PKG_RELEASE:= 1 +PKG_MD5SUM:= c745759b6b3d64e19763727176648cdf +PKG_DESCR:= CAPI4Linux Utils +PKG_SECTION:= net/voip +PKG_URL:= ftp://ftp.in-berlin.de/pub/capi4linux/ +PKG_SITES:= ftp://ftp.in-berlin.de/pub/capi4linux/ +WRKDIST= ${WRKDIR}/${PKG_NAME} + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,CAPI4K_UTILS,$(PKG_NAME),$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION})) + +CONFIG_STYLE:= manual +XAKE_FLAGS+= PPPVERSIONS=2.4.5 + +do-configure: + echo "CONFIG_KERNELDIR='${LINUX_DIR}'" >${WRKDIST}/.config + echo "CONFIG_BINDIR='/usr/bin'" >>${WRKDIST}/.config + echo "CONFIG_SBINDIR='/usr/sbin'" >>${WRKDIST}/.config + echo "CONFIG_MANDIR='/usr/man'" >>${WRKDIST}/.config + #echo "CONFIG_AVMCAPICTRL=y" >>${WRKDIST}/.config + #echo "CONFIG_CAPIFAX=y" >>${WRKDIST}/.config + echo "CONFIG_RCAPID=y" >>${WRKDIST}/.config + echo "CONFIG_PPPDCAPIPLUGIN=y" >>${WRKDIST}/.config + (cd ${WRKDIST}; \ + cp Makefile Makefile.tmp; \ + ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} -f Makefile.tmp subconfig; \ + rm -f Makefile.tmp; \ + ) + +post-install: + $(INSTALL_DIR) $(IDIR_CAPI4K_UTILS)/usr/{bin,lib/pppd/2.4.5} + $(INSTALL_BIN) $(WRKINST)/usr/bin/capiinfo \ + $(IDIR_CAPI4K_UTILS)/usr/bin + ${CP} $(WRKINST)/usr/lib/libcapi20.so* \ + $(IDIR_CAPI4K_UTILS)/usr/lib + $(INSTALL_DATA) $(WRKINST)/usr/lib/pppd/2.4.5/*.so \ + $(IDIR_CAPI4K_UTILS)/usr/lib/pppd/2.4.5 + +include ${ADK_TOPDIR}/mk/pkg-bottom.mk diff --git a/package/capi4k-utils/patches/patch-Makefile b/package/capi4k-utils/patches/patch-Makefile new file mode 100644 index 000000000..08e26f592 --- /dev/null +++ b/package/capi4k-utils/patches/patch-Makefile @@ -0,0 +1,42 @@ + - pass CC, CFLAGS and LDFLAGS when running subdir configure and make + - install without root-permissions, do not create device nodes + - need to pass PPPVERSIONS to subtargets +--- capi4k-utils.orig/Makefile 2002-11-20 14:45:14.000000000 +0100 ++++ capi4k-utils/Makefile 2011-07-15 14:15:21.446001582 +0200 +@@ -53,7 +53,7 @@ ifneq ($(SUBDIRS),) + endif + + subtargets: $(CONFIGURATION) +- set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i all; done ++ set -e; for i in `echo $(SUBDIRS)`; do CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" PPPVERSIONS="${PPPVERSIONS}" $(MAKE) -C $$i all; done + + rootperm: + @echo 'main(int argc,char**argv){unlink(argv[0]);return(getuid()==0);}'>g +@@ -62,16 +62,10 @@ rootperm: + exit 1; \ + fi + +-install: rootperm ++install: + set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i install; done +- @if [ -c $(DESTDIR)/dev/isdnctrl0 ] && ls -l $(DESTDIR)/dev/isdnctrl0 | egrep "[[:space:]]45,[[:space:]]+64[[:space:]]" > /dev/null; \ +- then \ +- echo -e '(some) ISDN devices already exist, not creating them.\nUse scripts/makedev.sh manually if necessary.'; \ +- else \ +- sh scripts/makedev.sh $(DESTDIR) ; \ +- fi + +-uninstall: rootperm ++uninstall: + set -e; for i in `echo $(SUBDIRS)`; do $(MAKE) -C $$i uninstall; done + + # +@@ -134,7 +128,7 @@ subconfig: scripts/autoconf.h + @set -e; for i in `echo $(SUBDIRS)`; do \ + if [ -x $$i/configure ] ; then \ + echo -e "\nRunning configure in $$i ...\n"; sleep 1; \ +- (cd $$i; ./configure --sbindir=$(CONFIG_SBINDIR) --bindir=$(CONFIG_BINDIR) --mandir=$(CONFIG_MANDIR) || $(MAKE) -C ../ ERRDIR=$$i cfgerror); \ ++ (cd $$i; CC="${CC}" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" ./configure --sbindir=$(CONFIG_SBINDIR) --bindir=$(CONFIG_BINDIR) --mandir=$(CONFIG_MANDIR) || $(MAKE) -C ../ ERRDIR=$$i cfgerror); \ + elif [ -f $$i/Makefile.in ] ; then \ + echo -e "\nRunning make -f Makefile.in config in $$i ...\n"; sleep 1; \ + $(MAKE) -C $$i -f Makefile.in config; \ diff --git a/package/capi4k-utils/patches/patch-avmb1_Makefile_in b/package/capi4k-utils/patches/patch-avmb1_Makefile_in new file mode 100644 index 000000000..f8d42a1cd --- /dev/null +++ b/package/capi4k-utils/patches/patch-avmb1_Makefile_in @@ -0,0 +1,14 @@ + - do not set uid/gid while installing +--- capi4k-utils.orig/avmb1/Makefile.in 2002-10-26 21:27:40.000000000 +0200 ++++ capi4k-utils/avmb1/Makefile.in 2011-07-14 19:14:42.879001566 +0200 +@@ -15,8 +15,8 @@ SBINDIR = @CONFIG_SBINDIR@ + MANDIR = @CONFIG_MANDIR@ + MAN8DIR = $(MANDIR)/man8 + INSTALL = @INSTALL@ +-INSTALL_PROGRAM = $(INSTALL) -o 0 -g 0 -m 0750 +-INSTALL_MAN = $(INSTALL) -o 0 -g 0 -m 0644 ++INSTALL_PROGRAM = $(INSTALL) -m 0750 ++INSTALL_MAN = $(INSTALL) -m 0644 + prefix = @prefix@ + exec_prefix = @exec_prefix@ + CC = @CC@ diff --git a/package/capi4k-utils/patches/patch-capi20_capi20_h b/package/capi4k-utils/patches/patch-capi20_capi20_h new file mode 100644 index 000000000..856eaba79 --- /dev/null +++ b/package/capi4k-utils/patches/patch-capi20_capi20_h @@ -0,0 +1,11 @@ + - somehow this header misses sys/types.h (for size_t definition) +--- capi4k-utils.orig/capi20/capi20.h 2000-11-19 11:15:01.000000000 +0100 ++++ capi4k-utils/capi20/capi20.h 2011-07-14 17:26:51.680001337 +0200 +@@ -21,6 +21,7 @@ + #define __CAPI20_H__ + + #include ++#include + + #ifdef __cplusplus + extern "C" { diff --git a/package/capi4k-utils/patches/patch-capiinfo_Makefile_in b/package/capi4k-utils/patches/patch-capiinfo_Makefile_in new file mode 100644 index 000000000..5a5ae1c4b --- /dev/null +++ b/package/capi4k-utils/patches/patch-capiinfo_Makefile_in @@ -0,0 +1,18 @@ + allow CFLAGS override +--- capi4k-utils.orig/capiinfo/Makefile.in 2002-11-27 09:08:04.000000000 +0100 ++++ capi4k-utils/capiinfo/Makefile.in 2011-07-14 18:55:40.657001559 +0200 +@@ -72,10 +72,10 @@ CLEANFILES = *~ comperr + MAINTAINERCLEANFILES = configure aclocal.m4 Makefile.in config.h.in stamp-h.in comperr + + +-INCLUDES = -I../capi20 $(all_includes) +-CFLAGS = -Wall -O2 +-LDFLAGS = -L../capi20/.libs -L../capi20 $(all_libraries) +-LDADD = -lcapi20 ++INCLUDES += -I../capi20 $(all_includes) ++CFLAGS += -Wall -O2 ++LDFLAGS += -L../capi20/.libs -L../capi20 $(all_libraries) ++LDADD += -lcapi20 + + bin_PROGRAMS = capiinfo + diff --git a/package/capi4k-utils/patches/patch-pppdcapiplugin_Makefile b/package/capi4k-utils/patches/patch-pppdcapiplugin_Makefile new file mode 100644 index 000000000..b31e9b393 --- /dev/null +++ b/package/capi4k-utils/patches/patch-pppdcapiplugin_Makefile @@ -0,0 +1,12 @@ + - do not set uid when installing +--- capi4k-utils.orig/pppdcapiplugin/Makefile 2005-07-18 11:11:25.000000000 +0200 ++++ capi4k-utils/pppdcapiplugin/Makefile 2011-07-14 19:22:54.660001648 +0200 +@@ -12,7 +12,7 @@ export TOPDIR=$(shell pwd) + export CAPIINC=$(TOPDIR)/../capi20 + export CAPILIB=$(TOPDIR)/../capi20 + export INSTALL=$(TOPDIR)/install-sh -c +-export INSTALLDATA=$(TOPDIR)/install-sh -c -o root -m 600 ++export INSTALLDATA=$(TOPDIR)/install-sh -c -m 600 + export MKDIR=$(TOPDIR)/mkinstalldirs + + PPPSRCDIRS=/src/isdn/pppd diff --git a/package/capi4k-utils/patches/patch-pppdcapiplugin_Rules_make b/package/capi4k-utils/patches/patch-pppdcapiplugin_Rules_make new file mode 100644 index 000000000..cd54324e6 --- /dev/null +++ b/package/capi4k-utils/patches/patch-pppdcapiplugin_Rules_make @@ -0,0 +1,18 @@ + allow CC, CFLAGS and LDFLAGS override +--- capi4k-utils.orig/pppdcapiplugin/Rules.make 2001-05-01 14:43:49.000000000 +0200 ++++ capi4k-utils/pppdcapiplugin/Rules.make 2011-07-14 17:13:53.567001779 +0200 +@@ -10,11 +10,11 @@ + + vpath %.c $(TOPDIR) + +-CC = gcc ++CC ?= gcc + INC = -I$(TOPDIR) -I$(CAPIINC) -Ipppd + DEFS = -DPPPVER=$(shell $(TOPDIR)/pversion $(PPPVERSION)) +-CFLAGS = -O2 -Wall -fPIC $(DEFS) $(INC) -L$(CAPILIB) +-LDFLAGS = -shared -L$(CAPILIB) ++CFLAGS += -O2 -Wall -fPIC $(DEFS) $(INC) -L$(CAPILIB) ++LDFLAGS += -shared -L$(CAPILIB) + + ALL = capiplugin.so userpass.so + diff --git a/package/capi4k-utils/patches/patch-rcapid_Makefile_in b/package/capi4k-utils/patches/patch-rcapid_Makefile_in new file mode 100644 index 000000000..135d5fe25 --- /dev/null +++ b/package/capi4k-utils/patches/patch-rcapid_Makefile_in @@ -0,0 +1,23 @@ + allow overriding things +--- capi4k-utils.orig/rcapid/Makefile.in 2003-06-16 13:44:29.000000000 +0200 ++++ capi4k-utils/rcapid/Makefile.in 2011-07-14 19:01:46.376001436 +0200 +@@ -57,7 +57,7 @@ POST_INSTALL = : + NORMAL_UNINSTALL = : + PRE_UNINSTALL = : + POST_UNINSTALL = : +-CC = @CC@ ++CC ?= @CC@ + CONFIG_MANDIR = @CONFIG_MANDIR@ + CONFIG_SBINDIR = @CONFIG_SBINDIR@ + CPP = @CPP@ +@@ -72,8 +72,8 @@ MAINTAINERCLEANFILES = configure aclocal + + + INCLUDES = -I../capi20 $(all_includes) +-CFLAGS = -Wall -O2 +-LDFLAGS = -L../capi20/.libs -L../capi20 $(all_libraries) ++CFLAGS += -Wall -O2 ++LDFLAGS += -L../capi20/.libs -L../capi20 $(all_libraries) + LDADD = -lcapi20 + + sbin_PROGRAMS = rcapid diff --git a/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/Makefile b/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/Makefile new file mode 100755 index 000000000..d12b2373a --- /dev/null +++ b/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/Makefile @@ -0,0 +1,14 @@ +# Makefile for the capiplugin for pppd(8). +# +# Copyright 2000 Carsten Paeth (calle@calle.in-berlin.de) +# Copyright 2000 AVM GmbH Berlin (info@avm.de) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version +# 2 of the License, or (at your option) any later version. + +PLUGINDIR=${DESTDIR}/usr/lib/pppd/$(PPPVERSION) + +include $(TOPDIR)/Rules.make + diff --git a/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/patchlevel.h b/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/patchlevel.h new file mode 100644 index 000000000..b7d6ce335 --- /dev/null +++ b/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/patchlevel.h @@ -0,0 +1,2 @@ +#define VERSION "2.4.5" +#define DATE "17 November 2009" diff --git a/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/pppd.h b/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/pppd.h new file mode 100644 index 000000000..cf9840a41 --- /dev/null +++ b/package/capi4k-utils/src/pppdcapiplugin/ppp-2.4.5/pppd/pppd.h @@ -0,0 +1,909 @@ +/* + * pppd.h - PPP daemon global declarations. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The name "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: pppd.h,v 1.96 2008/06/23 11:47:18 paulus Exp $ + */ + +/* + * TODO: + */ + +#ifndef __PPPD_H__ +#define __PPPD_H__ + +#include /* for FILE */ +#include /* for NGROUPS_MAX */ +#include /* for MAXPATHLEN and BSD4_4, if defined */ +#include /* for u_int32_t, if defined */ +#include /* for struct timeval */ +#include +#include "patchlevel.h" + +#if defined(__STDC__) +#include +#define __V(x) x +#else +#include +#define __V(x) (va_alist) va_dcl +#define const +#define volatile +#endif + +#ifdef INET6 +#include "eui64.h" +#endif + +/* + * Limits. + */ + +#define NUM_PPP 1 /* One PPP interface supported (per process) */ +#define MAXWORDLEN 1024 /* max length of word in file (incl null) */ +#define MAXARGS 1 /* max # args to a command */ +#define MAXNAMELEN 256 /* max length of hostname or name for auth */ +#define MAXSECRETLEN 256 /* max length of password or secret */ + +/* + * Option descriptor structure. + */ + +typedef unsigned char bool; + +enum opt_type { + o_special_noarg = 0, + o_special = 1, + o_bool, + o_int, + o_uint32, + o_string, + o_wild +}; + +typedef struct { + char *name; /* name of the option */ + enum opt_type type; + void *addr; + char *description; + unsigned int flags; + void *addr2; + int upper_limit; + int lower_limit; + const char *source; + short int priority; + short int winner; +} option_t; + +/* Values for flags */ +#define OPT_VALUE 0xff /* mask for presupplied value */ +#define OPT_HEX 0x100 /* int option is in hex */ +#define OPT_NOARG 0x200 /* option doesn't take argument */ +#define OPT_OR 0x400 /* for u32, OR in argument to value */ +#define OPT_INC 0x400 /* for o_int, increment value */ +#define OPT_A2OR 0x800 /* for o_bool, OR arg to *(u_char *)addr2 */ +#define OPT_PRIV 0x1000 /* privileged option */ +#define OPT_STATIC 0x2000 /* string option goes into static array */ +#define OPT_NOINCR 0x2000 /* for o_int, value mustn't be increased */ +#define OPT_LLIMIT 0x4000 /* check value against lower limit */ +#define OPT_ULIMIT 0x8000 /* check value against upper limit */ +#define OPT_LIMITS (OPT_LLIMIT|OPT_ULIMIT) +#define OPT_ZEROOK 0x10000 /* 0 value is OK even if not within limits */ +#define OPT_HIDE 0x10000 /* for o_string, print value as ?????? */ +#define OPT_A2LIST 0x20000 /* for o_special, keep list of values */ +#define OPT_A2CLRB 0x20000 /* o_bool, clr val bits in *(u_char *)addr2 */ +#define OPT_ZEROINF 0x40000 /* with OPT_NOINCR, 0 == infinity */ +#define OPT_PRIO 0x80000 /* process option priorities for this option */ +#define OPT_PRIOSUB 0x100000 /* subsidiary member of priority group */ +#define OPT_ALIAS 0x200000 /* option is alias for previous option */ +#define OPT_A2COPY 0x400000 /* addr2 -> second location to rcv value */ +#define OPT_ENABLE 0x800000 /* use *addr2 as enable for option */ +#define OPT_A2CLR 0x1000000 /* clear *(bool *)addr2 */ +#define OPT_PRIVFIX 0x2000000 /* user can't override if set by root */ +#define OPT_INITONLY 0x4000000 /* option can only be set in init phase */ +#define OPT_DEVEQUIV 0x8000000 /* equiv to device name */ +#define OPT_DEVNAM (OPT_INITONLY | OPT_DEVEQUIV) +#define OPT_A2PRINTER 0x10000000 /* *addr2 is a fn for printing option */ +#define OPT_A2STRVAL 0x20000000 /* *addr2 points to current string value */ +#define OPT_NOPRINT 0x40000000 /* don't print this option at all */ + +#define OPT_VAL(x) ((x) & OPT_VALUE) + +/* Values for priority */ +#define OPRIO_DEFAULT 0 /* a default value */ +#define OPRIO_CFGFILE 1 /* value from a configuration file */ +#define OPRIO_CMDLINE 2 /* value from the command line */ +#define OPRIO_SECFILE 3 /* value from options in a secrets file */ +#define OPRIO_ROOT 100 /* added to priority if OPT_PRIVFIX && root */ + +#ifndef GIDSET_TYPE +#define GIDSET_TYPE gid_t +#endif + +/* Structure representing a list of permitted IP addresses. */ +struct permitted_ip { + int permit; /* 1 = permit, 0 = forbid */ + u_int32_t base; /* match if (addr & mask) == base */ + u_int32_t mask; /* base and mask are in network byte order */ +}; + +/* + * Unfortunately, the linux kernel driver uses a different structure + * for statistics from the rest of the ports. + * This structure serves as a common representation for the bits + * pppd needs. + */ +struct pppd_stats { + unsigned int bytes_in; + unsigned int bytes_out; + unsigned int pkts_in; + unsigned int pkts_out; +}; + +/* Used for storing a sequence of words. Usually malloced. */ +struct wordlist { + struct wordlist *next; + char *word; +}; + +/* An endpoint discriminator, used with multilink. */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +struct epdisc { + unsigned char class; + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; +}; + +/* values for epdisc.class */ +#define EPD_NULL 0 /* null discriminator, no data */ +#define EPD_LOCAL 1 +#define EPD_IP 2 +#define EPD_MAC 3 +#define EPD_MAGIC 4 +#define EPD_PHONENUM 5 + +typedef void (*notify_func) __P((void *, int)); + +struct notifier { + struct notifier *next; + notify_func func; + void *arg; +}; + +/* + * Global variables. + */ + +extern int hungup; /* Physical layer has disconnected */ +extern int ifunit; /* Interface unit number */ +extern char ifname[]; /* Interface name */ +extern char hostname[]; /* Our hostname */ +extern u_char outpacket_buf[]; /* Buffer for outgoing packets */ +extern int devfd; /* fd of underlying device */ +extern int fd_ppp; /* fd for talking PPP */ +extern int phase; /* Current state of link - see values below */ +extern int baud_rate; /* Current link speed in bits/sec */ +extern char *progname; /* Name of this program */ +extern int redirect_stderr;/* Connector's stderr should go to file */ +extern char peer_authname[];/* Authenticated name of peer */ +extern int auth_done[NUM_PPP]; /* Methods actually used for auth */ +extern int privileged; /* We were run by real-uid root */ +extern int need_holdoff; /* Need holdoff period after link terminates */ +extern char **script_env; /* Environment variables for scripts */ +extern int detached; /* Have detached from controlling tty */ +extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */ +extern int ngroups; /* How many groups valid in groups */ +extern struct pppd_stats link_stats; /* byte/packet counts etc. for link */ +extern int link_stats_valid; /* set if link_stats is valid */ +extern unsigned link_connect_time; /* time the link was up for */ +extern int using_pty; /* using pty as device (notty or pty opt.) */ +extern int log_to_fd; /* logging to this fd as well as syslog */ +extern bool log_default; /* log_to_fd is default (stdout) */ +extern char *no_ppp_msg; /* message to print if ppp not in kernel */ +extern volatile int status; /* exit status for pppd */ +extern bool devnam_fixed; /* can no longer change devnam */ +extern int unsuccess; /* # unsuccessful connection attempts */ +extern int do_callback; /* set if we want to do callback next */ +extern int doing_callback; /* set if this is a callback */ +extern int error_count; /* # of times error() has been called */ +extern char ppp_devnam[MAXPATHLEN]; +extern char remote_number[MAXNAMELEN]; /* Remote telephone number, if avail. */ +extern int ppp_session_number; /* Session number (eg PPPoE session) */ +extern int fd_devnull; /* fd open to /dev/null */ + +extern int listen_time; /* time to listen first (ms) */ +extern bool doing_multilink; +extern bool multilink_master; +extern bool bundle_eof; +extern bool bundle_terminating; + +extern struct notifier *pidchange; /* for notifications of pid changing */ +extern struct notifier *phasechange; /* for notifications of phase changes */ +extern struct notifier *exitnotify; /* for notification that we're exiting */ +extern struct notifier *sigreceived; /* notification of received signal */ +extern struct notifier *ip_up_notifier; /* IPCP has come up */ +extern struct notifier *ip_down_notifier; /* IPCP has gone down */ +extern struct notifier *auth_up_notifier; /* peer has authenticated */ +extern struct notifier *link_down_notifier; /* link has gone down */ +extern struct notifier *fork_notifier; /* we are a new child process */ + +/* Values for do_callback and doing_callback */ +#define CALLBACK_DIALIN 1 /* we are expecting the call back */ +#define CALLBACK_DIALOUT 2 /* we are dialling out to call back */ + +/* + * Variables set by command-line options. + */ + +extern int debug; /* Debug flag */ +extern int kdebugflag; /* Tell kernel to print debug messages */ +extern int default_device; /* Using /dev/tty or equivalent */ +extern char devnam[MAXPATHLEN]; /* Device name */ +extern int crtscts; /* Use hardware flow control */ +extern bool modem; /* Use modem control lines */ +extern int inspeed; /* Input/Output speed requested */ +extern u_int32_t netmask; /* IP netmask to set on interface */ +extern bool lockflag; /* Create lock file to lock the serial dev */ +extern bool nodetach; /* Don't detach from controlling tty */ +extern bool updetach; /* Detach from controlling tty when link up */ +extern char *initializer; /* Script to initialize physical link */ +extern char *connect_script; /* Script to establish physical link */ +extern char *disconnect_script; /* Script to disestablish physical link */ +extern char *welcomer; /* Script to welcome client after connection */ +extern char *ptycommand; /* Command to run on other side of pty */ +extern int maxconnect; /* Maximum connect time (seconds) */ +extern char user[MAXNAMELEN];/* Our name for authenticating ourselves */ +extern char passwd[MAXSECRETLEN]; /* Password for PAP or CHAP */ +extern bool auth_required; /* Peer is required to authenticate */ +extern bool persist; /* Reopen link after it goes down */ +extern bool uselogin; /* Use /etc/passwd for checking PAP */ +extern bool session_mgmt; /* Do session management (login records) */ +extern char our_name[MAXNAMELEN];/* Our name for authentication purposes */ +extern char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ +extern bool explicit_remote;/* remote_name specified with remotename opt */ +extern bool demand; /* Do dial-on-demand */ +extern char *ipparam; /* Extra parameter for ip up/down scripts */ +extern bool cryptpap; /* Others' PAP passwords are encrypted */ +extern int idle_time_limit;/* Shut down link if idle for this long */ +extern int holdoff; /* Dead time before restarting */ +extern bool holdoff_specified; /* true if user gave a holdoff value */ +extern bool notty; /* Stdin/out is not a tty */ +extern char *pty_socket; /* Socket to connect to pty */ +extern char *record_file; /* File to record chars sent/received */ +extern bool sync_serial; /* Device is synchronous serial device */ +extern int maxfail; /* Max # of unsuccessful connection attempts */ +extern char linkname[MAXPATHLEN]; /* logical name for link */ +extern bool tune_kernel; /* May alter kernel settings as necessary */ +extern int connect_delay; /* Time to delay after connect script */ +extern int max_data_rate; /* max bytes/sec through charshunt */ +extern int req_unit; /* interface unit number to use */ +extern bool multilink; /* enable multilink operation */ +extern bool noendpoint; /* don't send or accept endpt. discrim. */ +extern char *bundle_name; /* bundle name for multilink */ +extern bool dump_options; /* print out option values */ +extern bool dryrun; /* check everything, print options, exit */ +extern int child_wait; /* # seconds to wait for children at end */ + +#ifdef MAXOCTETS +extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +extern int maxoctets_dir; /* Direction : + 0 - in+out (default) + 1 - in + 2 - out + 3 - max(in,out) */ +extern int maxoctets_timeout; /* Timeout for check of octets limit */ +#define PPP_OCTETS_DIRECTION_SUM 0 +#define PPP_OCTETS_DIRECTION_IN 1 +#define PPP_OCTETS_DIRECTION_OUT 2 +#define PPP_OCTETS_DIRECTION_MAXOVERAL 3 +/* same as previos, but little different on RADIUS side */ +#define PPP_OCTETS_DIRECTION_MAXSESSION 4 +#endif + +#ifdef PPP_FILTER +extern struct bpf_program pass_filter; /* Filter for pkts to pass */ +extern struct bpf_program active_filter; /* Filter for link-active pkts */ +#endif + +#ifdef MSLANMAN +extern bool ms_lanman; /* Use LanMan password instead of NT */ + /* Has meaning only with MS-CHAP challenges */ +#endif + +/* Values for auth_pending, auth_done */ +#define PAP_WITHPEER 0x1 +#define PAP_PEER 0x2 +#define CHAP_WITHPEER 0x4 +#define CHAP_PEER 0x8 +#define EAP_WITHPEER 0x10 +#define EAP_PEER 0x20 + +/* Values for auth_done only */ +#define CHAP_MD5_WITHPEER 0x40 +#define CHAP_MD5_PEER 0x80 +#define CHAP_MS_SHIFT 8 /* LSB position for MS auths */ +#define CHAP_MS_WITHPEER 0x100 +#define CHAP_MS_PEER 0x200 +#define CHAP_MS2_WITHPEER 0x400 +#define CHAP_MS2_PEER 0x800 + +extern char *current_option; /* the name of the option being parsed */ +extern int privileged_option; /* set iff the current option came from root */ +extern char *option_source; /* string saying where the option came from */ +extern int option_priority; /* priority of current options */ + +/* + * Values for phase. + */ +#define PHASE_DEAD 0 +#define PHASE_INITIALIZE 1 +#define PHASE_SERIALCONN 2 +#define PHASE_DORMANT 3 +#define PHASE_ESTABLISH 4 +#define PHASE_AUTHENTICATE 5 +#define PHASE_CALLBACK 6 +#define PHASE_NETWORK 7 +#define PHASE_RUNNING 8 +#define PHASE_TERMINATE 9 +#define PHASE_DISCONNECT 10 +#define PHASE_HOLDOFF 11 +#define PHASE_MASTER 12 + +/* + * The following struct gives the addresses of procedures to call + * for a particular protocol. + */ +struct protent { + u_short protocol; /* PPP protocol number */ + /* Initialization procedure */ + void (*init) __P((int unit)); + /* Process a received packet */ + void (*input) __P((int unit, u_char *pkt, int len)); + /* Process a received protocol-reject */ + void (*protrej) __P((int unit)); + /* Lower layer has come up */ + void (*lowerup) __P((int unit)); + /* Lower layer has gone down */ + void (*lowerdown) __P((int unit)); + /* Open the protocol */ + void (*open) __P((int unit)); + /* Close the protocol */ + void (*close) __P((int unit, char *reason)); + /* Print a packet in readable form */ + int (*printpkt) __P((u_char *pkt, int len, + void (*printer) __P((void *, char *, ...)), + void *arg)); + /* Process a received data packet */ + void (*datainput) __P((int unit, u_char *pkt, int len)); + bool enabled_flag; /* 0 iff protocol is disabled */ + char *name; /* Text name of protocol */ + char *data_name; /* Text name of corresponding data protocol */ + option_t *options; /* List of command-line options */ + /* Check requested options, assign defaults */ + void (*check_options) __P((void)); + /* Configure interface for demand-dial */ + int (*demand_conf) __P