Hallo!
Ich habe auf meiner 7390 seit gut einem Jahr den ISC dhcpd laufen. Bislang habe ich diesen immer händisch kompiliert und dann auf die Box geschoben. Mit der neuen Firmware habe ich nun beschlossen, das Ganze endlich vernünftig anzugehen und ein sauberes Freetz-Paket daraus zu machen. Allerdings hat der dhcpd beim Cross-Compile eine unangenehme Besonderheit: Er benötigt eine zusätzliche Datei im source tree und einen configure-Parameter. Eigentlich nicht wild, dachte ich. Bis gestern Abend. Ich habe es mit einem Patch versucht, ich habe im Makefile herumgedoktert, aber ich bekomme es einfach nicht hin. Auch das Absuchen der Makefiles und Patches anderer Pakete brachte mir keine funktionierende Idee. Kann mir hier jemand weiterhelfen?
Das Ganze auf trunk (11532), .config kann ich bei Bedarf gerne zur Verfügung stellen wenn das hilft.
Benötigte Datei: {entpackte Source}/config.cache
make/dhcp/dhcp.mk
Nachdem Pastebin hier anscheinend geschasst wird, muss ich den Output leider so hier reinklatschen:
Das Kopieren der Datei erfolgt nicht. Wahrscheinlich Syntaxfehler meinerseits? Bin mit Makefiles noch nicht so oft in Berührung gekommen.
Alternativ habe ich es mit einem Patch versucht, der die benötigte Datei erzeugen soll, dann natürlich ohne die CONFIGURE_PRE_CMDS-Zeile im Makefile:
make/dhcp/patches/100-cache.patch
Die Datei existiert im source tree nicht, deshalb das /dev/null als Quelldatei oben, den Tip habe ich ergoogelt, ich weiß aber nicht ob das wirklich der korrekte Weg ist. Die Datei wird auch erstellt, ist nach dem .configure-Durchlauf aber leer, wobei es normal ist dass im Durchlauf der Dateiinhalt verändert wird, ergo weiß ich nicht ob der Patch einfach nicht den korrekten Inhalt schreibt oder ob .configure die Datei nur im Durchlauf leert. Beim manuellen Compile wird die Datei aber kräftig gefüllt, also scheint hier eher ein Fehler vorzuliegen.
Der Output dieser Variante:
Dieser Fehler (checking for /dev/random...) legt nahe dass der Parameter nicht an .configure übergeben wurde, zumindest konnte ich ihn im manuellen Compile nur so provozieren. Habe ich hier etwas falsch gemacht?
Schon mal vielen Dank!
Ich habe auf meiner 7390 seit gut einem Jahr den ISC dhcpd laufen. Bislang habe ich diesen immer händisch kompiliert und dann auf die Box geschoben. Mit der neuen Firmware habe ich nun beschlossen, das Ganze endlich vernünftig anzugehen und ein sauberes Freetz-Paket daraus zu machen. Allerdings hat der dhcpd beim Cross-Compile eine unangenehme Besonderheit: Er benötigt eine zusätzliche Datei im source tree und einen configure-Parameter. Eigentlich nicht wild, dachte ich. Bis gestern Abend. Ich habe es mit einem Patch versucht, ich habe im Makefile herumgedoktert, aber ich bekomme es einfach nicht hin. Auch das Absuchen der Makefiles und Patches anderer Pakete brachte mir keine funktionierende Idee. Kann mir hier jemand weiterhelfen?
Das Ganze auf trunk (11532), .config kann ich bei Bedarf gerne zur Verfügung stellen wenn das hilft.
Benötigte Datei: {entpackte Source}/config.cache
Code:
ac_cv_file__dev_random=yes
make/dhcp/dhcp.mk
Code:
$(call PKG_INIT_BIN, 4.2.5-P1)
$(PKG)_SOURCE:=dhcp-$($(PKG)_VERSION).tar.gz
$(PKG)_SOURCE_MD5:=f68e3c1f00a9af5742bc5e71d567cf93
$(PKG)_SITE:=http://ftp.mirrorservice.org/sites/ftp.isc.org/isc/dhcp/$($(PKG)_VERSION)
$(PKG)_BINARY:=$($(PKG)_DIR)/server/dhcpd
$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/dhcpd
# --- Vor Aufruf von .configure eine vorbereitete config.cache aus dem make/dhcp-Verzeichnis ins build-Verzeichnis kopieren
$(PKG)_CONFIGURE_PRE_CMDS += (cp $(MAKE_DIR)/dhcp/config.cache $($(PKG)_DIR)/)
# --- Das ist der zusätzlich notwendige configure-Parameter:
$(PKG)_CONFIGURE_OPTIONS += --cache-file=config.cache
$(PKG_SOURCE_DOWNLOAD)
$(PKG_UNPACKED):
touch $($(PKG)_DIR)/config.cache
$(PKG_CONFIGURED_CONFIGURE)
$($(PKG)_BINARY): $($(PKG)_DIR)/.configured
$(SUBMAKE) -C $(DHCP_DIR) \
CC="$(TARGET_CC)" \
CFLAGS="$(TARGET_CFLAGS)"
$($(PKG)_TARGET_BINARY): $($(PKG)_BINARY)
$(INSTALL_BINARY_STRIP)
$(pkg):
$(pkg)-precompiled: $($(PKG)_TARGET_BINARY)
$(pkg)-clean:
-$(SUBMAKE) -C $(DHCP_DIR) clean
$(RM) $(DHCP_DIR)/.configured
$(pkg)-uninstall:
$(RM) $(DHCP_TARGET_BINARY)
$(PKG_FINISH)
Nachdem Pastebin hier anscheinend geschasst wird, muss ich den Output leider so hier reinklatschen:
Code:
freetz@freetz-linux:~/freetz-source/trunk$ make
mkdir -p packages/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1/root
if test -d make/dhcp/files; then tar -c -C make/dhcp/files --exclude=.svn . | tar -x -C packages/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1 ; fi
---> package/dhcp: preparing... tools/gunzip -c dl/dhcp-4.2.5-P1.tar.gz | tar -C source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl -x
set -e; shopt -s nullglob; for i in make/dhcp/patches/*.patch; do tools/freetz_patch source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1 $i; done
configuring... (conf_cmd() { ./configure "$@" || { printf "\n\\033[33m%s\\033[m\n" "ERROR: Build failed."; exit 1; } }; cd source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1; rm -f config.{cache,status}; (cp make/dhcp/config.cache source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1/) PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin:/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3/mips-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" CC="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc" CXX="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-g++-wrapper" CFLAGS="-march=24kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CXXFLAGS="-march=24kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS="" PKG_CONFIG_PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/../lib/pkgconfig" PKG_CONFIG_LIBDIR="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/../lib/pkgconfig" GLOBAL_LIBDIR=/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/usr/lib FREETZ_TARGET_LFS="y" CONFIG_SITE=/home/freetz/freetz-source/trunk/include/site/mips-linux-uclibc conf_cmd --cache-file=/home/freetz/freetz-source/trunk/source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/config.cache --target=mips-linux --host=mips-linux --build=i386-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --datadir=/usr/share --includedir=/usr/include --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --sbindir=/usr/sbin --sysconfdir=/etc --with-gnu-ld --disable-nls --cache-file=config.cache )
/bin/bash: -c: line 0: syntax error near unexpected token `PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin:/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3/mips-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"'
/bin/bash: -c: line 0: `(conf_cmd() { ./configure "$@" || { printf "\n\\033[33m%s\\033[m\n" "ERROR: Build failed."; exit 1; } }; cd source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1; rm -f config.{cache,status}; (cp make/dhcp/config.cache source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1/) PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin:/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3/mips-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" CC="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc" CXX="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-g++-wrapper" CFLAGS="-march=24kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CXXFLAGS="-march=24kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS="" PKG_CONFIG_PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/../lib/pkgconfig" PKG_CONFIG_LIBDIR="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/../lib/pkgconfig" GLOBAL_LIBDIR=/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/usr/lib FREETZ_TARGET_LFS="y" CONFIG_SITE=/home/freetz/freetz-source/trunk/include/site/mips-linux-uclibc conf_cmd --cache-file=/home/freetz/freetz-source/trunk/source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/config.cache --target=mips-linux --host=mips-linux --build=i386-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --datadir=/usr/share --includedir=/usr/include --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --sbindir=/usr/sbin --sysconfdir=/etc --with-gnu-ld --disable-nls --cache-file=config.cache )'
make: *** [source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1/.configured] Error 1
Alternativ habe ich es mit einem Patch versucht, der die benötigte Datei erzeugen soll, dann natürlich ohne die CONFIGURE_PRE_CMDS-Zeile im Makefile:
make/dhcp/patches/100-cache.patch
Code:
--- /dev/null 2014-01-10 15:17:35.640216409 +0100
+++ config.cache 2014-01-10 23:03:42.290864495 +0100
@@ -0,0 +1,1 @@
+ac_cv_file__dev_random=yes
Der Output dieser Variante:
Code:
freetz@freetz-linux:~/freetz-source/trunk$ make
mkdir -p packages/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1/root
if test -d make/dhcp/files; then tar -c -C make/dhcp/files --exclude=.svn . | tar -x -C packages/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1 ; fi
---> package/dhcp: preparing... tools/gunzip -c dl/dhcp-4.2.5-P1.tar.gz | tar -C source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl -x
set -e; shopt -s nullglob; for i in make/dhcp/patches/*.patch; do tools/freetz_patch source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1 $i; done
applying patch file make/dhcp/patches/100-cache.patch
patching file config.cache
----------------------------------------------------------------------
configuring... (conf_cmd() { ./configure "$@" || { printf "\n\\033[33m%s\\033[m\n" "ERROR: Build failed."; exit 1; } }; cd source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1; rm -f config.{cache,status}; PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin:/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3/mips-unknown-linux-gnu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" CC="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc" CXX="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-g++-wrapper" CFLAGS="-march=24kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CXXFLAGS="-march=24kc -Os -pipe -Wa,--trap -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS="" PKG_CONFIG_PATH="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/../lib/pkgconfig" PKG_CONFIG_LIBDIR="/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/../lib/pkgconfig" GLOBAL_LIBDIR=/home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/usr/lib FREETZ_TARGET_LFS="y" CONFIG_SITE=/home/freetz/freetz-source/trunk/include/site/mips-linux-uclibc conf_cmd --cache-file=/home/freetz/freetz-source/trunk/source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/config.cache --target=mips-linux --host=mips-linux --build=i386-pc-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --datadir=/usr/share --includedir=/usr/include --infodir=/usr/share/info --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --sbindir=/usr/sbin --sysconfdir=/etc --with-gnu-ld --disable-nls --cache-file=config.cache )
configure: loading site script /home/freetz/freetz-source/trunk/include/site/mips-linux-uclibc
configure: creating cache config.cache
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for mips-linux-strip... mips-linux-strip
checking whether to enable maintainer-specific portions of Makefiles... no
checking for mips-linux-gcc... /home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc accepts -g... yes
checking for /home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of /home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc... gcc3
checking how to run the C preprocessor... /home/freetz/freetz-source/trunk/toolchain/build/mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/mips-linux-uclibc/bin/mips-linux-uclibc-gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for AIX... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for mips-linux-ranlib... mips-linux-ranlib
checking whether byte ordering is bigendian... (cached) yes
checking for dhcpd.leases location.../var/lib/dhcp/dhcpd.leases
checking for dhcpd6.leases location.../var/lib/dhcp/dhcpd6.leases
checking for dhclient.leases location.../var/lib/dhcp/dhclient.leases
checking for dhclient6.leases location.../var/lib/dhcp/dhclient6.leases
checking for int8_t... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for u_int64_t... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking for linux/filter.h... yes
checking for struct lifnum... no
checking for struct if_laddrconf... no
checking for struct if_laddrreq... no
checking for GCC noreturn attribute... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking net/if_dl.h usability... no
checking net/if_dl.h presence... no
checking for net/if_dl.h... no
checking net/if6.h usability... no
checking net/if6.h presence... no
checking for net/if6.h... no
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking for library containing socket... none required
checking for library containing inet_ntoa... none required
checking for library containing inet_aton... none required
checking for library containing regcomp... none required
checking for library containing if_nametoindex... none required
checking for /dev/random... configure: error: cannot check for file existence when cross compiling
ERROR: Build failed.
make: *** [source/target-mips_gcc-4.7.3_uClibc-0.9.33.2-nptl/dhcp-4.2.5-P1/.configured] Error 1
Dieser Fehler (checking for /dev/random...) legt nahe dass der Parameter nicht an .configure übergeben wurde, zumindest konnte ich ihn im manuellen Compile nur so provozieren. Habe ich hier etwas falsch gemacht?
Schon mal vielen Dank!