From a1464dd60077f3867adaed70dc33abcfb6f2c978 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 18 Apr 2011 17:41:17 +0200 Subject: package/busybox: add some fix and enhancement for the nameif applet --- .../0001-nameif-fix-parsing-proc-net-dev.patch | 31 +++++++ ...02-nameif-Added-matching-for-PhyAddresses.patch | 103 +++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 package/busybox/patches/0001-nameif-fix-parsing-proc-net-dev.patch create mode 100644 package/busybox/patches/0002-nameif-Added-matching-for-PhyAddresses.patch (limited to 'package') diff --git a/package/busybox/patches/0001-nameif-fix-parsing-proc-net-dev.patch b/package/busybox/patches/0001-nameif-fix-parsing-proc-net-dev.patch new file mode 100644 index 000000000..2c5ef6b41 --- /dev/null +++ b/package/busybox/patches/0001-nameif-fix-parsing-proc-net-dev.patch @@ -0,0 +1,31 @@ +From ea80044062500c7473cf214010576ea2681d8d2e Mon Sep 17 00:00:00 2001 +From: Phil Sutter +Date: Thu, 3 Mar 2011 15:13:57 +0100 +Subject: [PATCH 1/2] nameif: fix parsing /proc/net/dev + +The parser field lineno is initially zero and incremented upon each +call to config_read(). So lineno is effectively a "real" line number, +not an index. Fix the off-by-one bug here, which led to parsing for an +interface named "face". + +Signed-off-by: Phil Sutter +--- + networking/nameif.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/networking/nameif.c b/networking/nameif.c +index 6cf1c50..8e325e7 100644 +--- a/networking/nameif.c ++++ b/networking/nameif.c +@@ -174,7 +174,7 @@ int nameif_main(int argc, char **argv) + #if ENABLE_FEATURE_NAMEIF_EXTENDED + struct ethtool_drvinfo drvinfo; + #endif +- if (parser->lineno < 2) ++ if (parser->lineno < 3) + continue; /* Skip the first two lines */ + + /* Find the current interface name and copy it to ifr.ifr_name */ +-- +1.7.3.4 + diff --git a/package/busybox/patches/0002-nameif-Added-matching-for-PhyAddresses.patch b/package/busybox/patches/0002-nameif-Added-matching-for-PhyAddresses.patch new file mode 100644 index 000000000..e388c4c5b --- /dev/null +++ b/package/busybox/patches/0002-nameif-Added-matching-for-PhyAddresses.patch @@ -0,0 +1,103 @@ +From eb65132adca3fe1e7c39fc6032266a8d04150561 Mon Sep 17 00:00:00 2001 +From: Nico Erfurth +Date: Sun, 27 Feb 2011 17:57:30 +0100 +Subject: [PATCH 2/2] nameif: Added matching for PhyAddresses + +Very useful when trying to distinguish platform-devices served by the +same driver, which is actually quite common in embedded-devices. + +Signed-off-by: Nico Erfurth +Signed-off-by: Phil Sutter +--- + networking/nameif.c | 33 +++++++++++++++++++++++++++++++++ + 1 files changed, 33 insertions(+), 0 deletions(-) + +diff --git a/networking/nameif.c b/networking/nameif.c +index 8e325e7..8d64b37 100644 +--- a/networking/nameif.c ++++ b/networking/nameif.c +@@ -38,6 +38,7 @@ typedef struct ethtable_s { + #if ENABLE_FEATURE_NAMEIF_EXTENDED + char *bus_info; + char *driver; ++ int32_t phy_address; + #endif + } ethtable_t; + +@@ -59,6 +60,25 @@ struct ethtool_drvinfo { + uint32_t eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */ + uint32_t regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */ + }; ++ ++struct ethtool_cmd { ++ __u32 cmd; ++ __u32 supported; /* Features this interface supports */ ++ __u32 advertising; /* Features this interface advertises */ ++ __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */ ++ __u8 duplex; /* Duplex, half or full */ ++ __u8 port; /* Which connector port */ ++ __u8 phy_address; ++ __u8 transceiver; /* Which transceiver to use */ ++ __u8 autoneg; /* Enable or disable autonegotiation */ ++ __u32 maxtxpkt; /* Tx pkts before generating tx int */ ++ __u32 maxrxpkt; /* Rx pkts before generating rx int */ ++ __u16 speed_hi; ++ __u16 reserved2; ++ __u32 reserved[3]; ++}; ++ ++#define ETHTOOL_GSET 0x00000001 /* Get settings. */ + #define ETHTOOL_GDRVINFO 0x00000003 /* Get driver info. */ + #endif + +@@ -74,6 +94,7 @@ static void nameif_parse_selector(ethtable_t *ch, char *selector) + #endif + selector = skip_whitespace(selector); + #if ENABLE_FEATURE_NAMEIF_EXTENDED ++ ch->phy_address = -1; + if (*selector == '\0') + break; + /* Search for the end .... */ +@@ -87,6 +108,9 @@ static void nameif_parse_selector(ethtable_t *ch, char *selector) + } else if (strncmp(selector, "driver=", 7) == 0) { + ch->driver = xstrdup(selector + 7); + found_selector++; ++ } else if (strncmp(selector, "phyaddr=", 8) == 0) { ++ ch->phy_address = atoi(selector + 8); ++ found_selector++; + } else { + #endif + lmac = xmalloc(ETH_ALEN); +@@ -173,6 +197,7 @@ int nameif_main(int argc, char **argv) + struct ifreq ifr; + #if ENABLE_FEATURE_NAMEIF_EXTENDED + struct ethtool_drvinfo drvinfo; ++ struct ethtool_cmd eth_settings; + #endif + if (parser->lineno < 3) + continue; /* Skip the first two lines */ +@@ -182,6 +207,12 @@ int nameif_main(int argc, char **argv) + strncpy_IFNAMSIZ(ifr.ifr_name, token[0]); + + #if ENABLE_FEATURE_NAMEIF_EXTENDED ++ /* Check for phy address */ ++ memset(ð_settings, 0, sizeof(struct ethtool_cmd)); ++ eth_settings.cmd = ETHTOOL_GSET; ++ ifr.ifr_data = (caddr_t) ð_settings; ++ ioctl(ctl_sk, SIOCETHTOOL, &ifr); ++ + /* Check for driver etc. */ + memset(&drvinfo, 0, sizeof(struct ethtool_drvinfo)); + drvinfo.cmd = ETHTOOL_GDRVINFO; +@@ -198,6 +229,8 @@ int nameif_main(int argc, char **argv) + continue; + if (ch->driver && strcmp(ch->driver, drvinfo.driver) != 0) + continue; ++ if (ch->phy_address != -1 && ch->phy_address != eth_settings.phy_address) ++ continue; + #endif + if (ch->mac && memcmp(ch->mac, ifr.ifr_hwaddr.sa_data, ETH_ALEN) != 0) + continue; +-- +1.7.3.4 + -- cgit v1.2.3 From ce140f3b1b7c9081e205710dff13f5e43879cd4f Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 18 Apr 2011 17:41:19 +0200 Subject: package/busybox: CFLAGS variable seems to be handled since last minor update Therefore drop the EXTRA_CFLAGS variable, as that makes gcc complain because of doubly passed -fhonour-copts parameter. --- package/busybox/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package') diff --git a/package/busybox/Makefile b/package/busybox/Makefile index 51cc30ddc..67884cf3e 100644 --- a/package/busybox/Makefile +++ b/package/busybox/Makefile @@ -38,7 +38,7 @@ BB_MAKE_FLAGS:= V=1 IPKG_ARCH="${CPU_ARCH}" ARCH="${ARCH}" GCC_HONOUR_COPTS=s \ HOSTCC="${CC_FOR_BUILD}" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \ -C ${WRKBUILD} ifneq (${ADK_NATIVE},y) -BB_MAKE_FLAGS+= EXTRA_CFLAGS="${TARGET_CFLAGS}" CROSS_COMPILE="$(TARGET_CROSS)" +BB_MAKE_FLAGS+= CROSS_COMPILE="$(TARGET_CROSS)" endif # XXX: Although this looks like all new symbols are enabled when 'make oldconfig' runs, they're not. -- cgit v1.2.3 From 6520531e3374531c8b4115e2e84cef63b2ceb34a Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Mon, 18 Apr 2011 17:41:13 +0200 Subject: ppp: depends on libpcap --- package/ppp/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'package') diff --git a/package/ppp/Makefile b/package/ppp/Makefile index bf50e6281..250089b4b 100644 --- a/package/ppp/Makefile +++ b/package/ppp/Makefile @@ -10,6 +10,7 @@ PKG_MD5SUM:= 4621bc56167b6953ec4071043fe0ec57 PKG_DESCR:= Point-to-Point Protocol software PKG_SECTION:= ppp PKG_DEPENDS:= kmod-ppp +PKG_BUILDDEP:= libpcap PKG_URL:= http://ppp.samba.org/ PKG_SITES:= ftp://ftp.samba.org/pub/ppp/ PKG_MULTI:= 1 -- cgit v1.2.3 From a314aacee222450e5e8d27f38bf49abe38afb10b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 26 Apr 2011 11:07:40 +0200 Subject: install when module is choosen, from phil --- package/e2fsprogs/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'package') diff --git a/package/e2fsprogs/Makefile b/package/e2fsprogs/Makefile index a61fa4e63..8c8788b2a 100644 --- a/package/e2fsprogs/Makefile +++ b/package/e2fsprogs/Makefile @@ -61,7 +61,7 @@ post-build: ${INSTALL_DIR} ${STAGING_DIR}/usr/include/uuid ${CP} ${WRKBUILD}/lib/uuid/uuid.h \ ${STAGING_DIR}/usr/include/uuid -ifeq ($(ADK_PACKAGE_E2FSCK_STATIC),y) +ifneq ($(ADK_PACKAGE_E2FSCK_STATIC),) ${MAKE} -C ${WRKBUILD}/e2fsck e2fsck.static ${INSTALL_DIR} ${WRKINST}/usr/sbin ${INSTALL_BIN} ${WRKBUILD}/e2fsck/e2fsck.static ${WRKINST}/usr/sbin @@ -121,8 +121,10 @@ libuuid-dev-install: ${IDIR_LIBUUID_DEV}/usr/include e2fsck-static-install: +ifneq ($(ADK_PACKAGE_E2FSCK_STATIC),) ${INSTALL_DIR} ${IDIR_E2FSCK_STATIC}/usr/sbin ${INSTALL_BIN} ${WRKINST}/usr/sbin/e2fsck.static \ ${IDIR_E2FSCK_STATIC}/usr/sbin/e2fsck +endif include ${TOPDIR}/mk/pkg-bottom.mk -- cgit v1.2.3