From owner-freebsd-embedded@FreeBSD.ORG Mon Apr 12 11:06:57 2010 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5754B106567F for ; Mon, 12 Apr 2010 11:06:57 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 44DA18FC08 for ; Mon, 12 Apr 2010 11:06:57 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3CB6vv4042371 for ; Mon, 12 Apr 2010 11:06:57 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3CB6ugL042369 for freebsd-embedded@FreeBSD.org; Mon, 12 Apr 2010 11:06:56 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 12 Apr 2010 11:06:56 GMT Message-Id: <201004121106.o3CB6ugL042369@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-embedded@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-embedded@FreeBSD.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2010 11:06:57 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o misc/136889 embedded [nanobsd] [path] nanobsd error reporting and other ref p misc/135588 embedded [nanobsd] simple patch for adding amd64 support o misc/52256 embedded [picobsd] picobsd build script does not read in user/s o kern/42728 embedded [picobsd] many problems in src/usr.sbin/ppp/* after c 4 problems total. From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 10:02:30 2010 Return-Path: Delivered-To: embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9920106566B; Wed, 14 Apr 2010 10:02:30 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 280A78FC1B; Wed, 14 Apr 2010 10:02:29 +0000 (UTC) Received: from gw ([192.168.10.10] helo=terran) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1O1zMX-00047o-Vj; Wed, 14 Apr 2010 12:58:26 +0300 Date: Wed, 14 Apr 2010 13:03:53 +0300 From: Alexandr Rybalko To: hackers@freebsd.org Message-Id: <20100414130353.c28d5128.ray@dlink.ua> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: embedded@FreeBSD.org Subject: Patch for config utility X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 10:02:31 -0000 Hi All, I made a patch for the config utility, which enables execution of config outside of the kernel source tree. The main purpose is to avoid large number of configuration files for many boards. I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel config files. If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf directory of platform :) Index: mkoptions.c =================================================================== --- mkoptions.c (revision 206411) +++ mkoptions.c (working copy) @@ -294,7 +294,11 @@ read_options(void) char genopt[MAXPATHLEN]; SLIST_INIT(&otab); - (void) snprintf(fname, sizeof(fname), "../../conf/options"); + if ( *ksrcdir != '\0' ) + (void) snprintf(fname, sizeof(fname), "%s/conf/options", + ksrcdir); + else + (void) snprintf(fname, sizeof(fname), "../../conf/options"); openit: fp = fopen(fname, "r"); if (fp == 0) { @@ -306,7 +310,12 @@ next: (void) fclose(fp); if (first == 1) { first++; - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); + if ( *ksrcdir != '\0' ) + (void) snprintf(fname, sizeof fname, + "%s/conf/options.%s", ksrcdir, machinename); + else + (void) snprintf(fname, sizeof fname, + "../../conf/options.%s", machinename); fp = fopen(fname, "r"); if (fp != 0) goto next; Index: main.c =================================================================== --- main.c (revision 206411) +++ main.c (working copy) @@ -72,6 +72,7 @@ static const char rcsid[] = char * PREFIX; char destdir[MAXPATHLEN]; +char ksrcdir[MAXPATHLEN]; char srcdir[MAXPATHLEN]; int debugging; @@ -110,8 +111,9 @@ main(int argc, char **argv) char xxx[MAXPATHLEN]; char *kernfile; + *ksrcdir = '\0'; kernfile = NULL; - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) switch (ch) { case 'C': filebased = 1; @@ -125,6 +127,12 @@ main(int argc, char **argv) case 'g': debugging++; break; + case 'k': + if (*ksrcdir == '\0') + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); + else + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); + break; case 'p': profiling++; break; @@ -164,7 +172,8 @@ main(int argc, char **argv) len = strlen(destdir); while (len > 1 && destdir[len - 1] == '/') destdir[--len] = '\0'; - get_srcdir(); + if (*ksrcdir == '\0') + get_srcdir(); } else { strlcpy(destdir, CDIR, sizeof(destdir)); strlcat(destdir, PREFIX, sizeof(destdir)); @@ -210,11 +219,14 @@ main(int argc, char **argv) * for "sys" (to make genassym.c work along with #include ) * and similarly for "machine". */ - if (*srcdir == '\0') - (void)snprintf(xxx, sizeof(xxx), "../../include"); - else + if (*ksrcdir != '\0') (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", + ksrcdir, machinename); + else if (*srcdir != '\0') + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", srcdir, machinename); + else + (void)snprintf(xxx, sizeof(xxx), "../../include"); (void) unlink(path("machine")); (void) symlink(xxx, path("machine")); if (strcmp(machinename, machinearch) != 0) { @@ -222,12 +234,15 @@ main(int argc, char **argv) * make symbolic links in compilation directory for * machinearch, if it is different than machinename. */ - if (*srcdir == '\0') + if (*ksrcdir != '\0') + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", + ksrcdir, machinearch); + else if (*srcdir != '\0') + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", + srcdir, machinearch); + else (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", machinearch); - else - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", - srcdir, machinearch); (void) unlink(path(machinearch)); (void) symlink(xxx, path(machinearch)); } @@ -278,7 +293,7 @@ static void usage(void) { - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); fprintf(stderr, " config -x kernel\n"); exit(EX_USAGE); } Index: mkmakefile.c =================================================================== --- mkmakefile.c (revision 206411) +++ mkmakefile.c (working copy) @@ -116,7 +116,12 @@ makefile(void) int versreq; read_files(); - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); + if (*ksrcdir != '\0') + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", + ksrcdir, machinename); + else + snprintf(line, sizeof(line), "../../conf/Makefile.%s", + machinename); ifp = fopen(line, "r"); if (ifp == 0) { snprintf(line, sizeof(line), "Makefile.%s", machinename); @@ -139,7 +144,9 @@ makefile(void) fprintf(ofp, "DEBUG=-g\n"); if (profiling) fprintf(ofp, "PROFLEVEL=%d\n", profiling); - if (*srcdir != '\0') + if (*ksrcdir != '\0') + fprintf(ofp,"S=%s\n", ksrcdir); + else if (*srcdir != '\0') fprintf(ofp,"S=%s\n", srcdir); while (fgets(line, BUFSIZ, ifp) != 0) { if (*line != '%') { @@ -347,7 +354,12 @@ next: printf("%s: missing include filename.\n", fname); exit(1); } - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); + if (*ksrcdir != '\0') + (void) snprintf(ifname, sizeof(ifname), "%s/%s", + ksrcdir, wd); + else + (void) snprintf(ifname, sizeof(ifname), "../../%s", + wd); read_file(ifname); while (((wd = get_word(fp)) != (char *)EOF) && wd) ; @@ -544,9 +556,17 @@ read_files(void) char fname[MAXPATHLEN]; struct files_name *nl, *tnl; - (void) snprintf(fname, sizeof(fname), "../../conf/files"); + if (*ksrcdir != '\0') + (void) snprintf(fname, sizeof(fname), "%s/conf/files", + ksrcdir); + else + (void) snprintf(fname, sizeof(fname), "../../conf/files"); read_file(fname); - (void) snprintf(fname, sizeof(fname), + if (*ksrcdir != '\0') + (void) snprintf(fname, sizeof(fname), + "%s/conf/files.%s", ksrcdir, machinename); + else + (void) snprintf(fname, sizeof(fname), "../../conf/files.%s", machinename); read_file(fname); for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { Index: config.8 =================================================================== --- config.8 (revision 206411) +++ config.8 (working copy) @@ -38,6 +38,7 @@ .Nm .Op Fl CVgp .Op Fl d Ar destdir +.Op Fl k Ar ksrcdir .Ar SYSTEM_NAME .Nm .Op Fl x Ar kernel @@ -78,6 +79,10 @@ Note that does not append .Ar SYSTEM_NAME to the directory given. +.It Fl k Ar ksrcdir +Use +.Ar ksrcdir +as the kernel source tree directory, instead of the default one. .It Fl g Configure a system for debugging. .It Fl x Ar kernel Index: config.h =================================================================== --- config.h (revision 206411) +++ config.h (working copy) @@ -196,6 +196,8 @@ extern int maxusers; extern char *PREFIX; /* Config file name - for error messages */ extern char srcdir[]; /* root of the kernel source tree */ +extern char ksrcdir[]; /* root of the kernel source tree + * set by -k flag */ #define eq(a,b) (!strcmp(a,b)) #define ns(s) strdup(s) Index: lang.l =================================================================== --- lang.l (revision 206411) +++ lang.l (working copy) @@ -259,7 +259,10 @@ include(const char *fname, int ateof) fnamebuf = NULL; fp = fopen(fname, "r"); if (fp == NULL && fname[0] != '.' && fname[0] != '/') { - asprintf(&fnamebuf, "../../conf/%s", fname); + if (*ksrcdir != '\0') + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); + else + asprintf(&fnamebuf, "../../conf/%s", fname); if (fnamebuf != NULL) { fp = fopen(fnamebuf, "r"); free(fnamebuf); -- Alexandr Rybalko aka Alex RAY From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 13:28:28 2010 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E2A5106564A; Wed, 14 Apr 2010 13:28:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4076B8FC1A; Wed, 14 Apr 2010 13:28:28 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id E168E46B89; Wed, 14 Apr 2010 09:28:27 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 0C8EC8A01F; Wed, 14 Apr 2010 09:28:27 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org, embedded@freebsd.org Date: Wed, 14 Apr 2010 09:06:28 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <20100414130353.c28d5128.ray@dlink.ua> In-Reply-To: <20100414130353.c28d5128.ray@dlink.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004140906.28205.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 14 Apr 2010 09:28:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.8 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Alexandr Rybalko Subject: Re: Patch for config utility X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:28:28 -0000 On Wednesday 14 April 2010 6:03:53 am Alexandr Rybalko wrote: > Hi All, > > I made a patch for the config utility, which enables execution of config outside of the kernel source tree. > The main purpose is to avoid large number of configuration files for many boards. > I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel > config files. > If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), > every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf > directory of platform :) I think the patch would be simpler if you set ksrcdir to "../.." initially. Then most of the conditionals can be collapsed as ksrcdir could always be used in the code. You could just use a simple boolean in the main() routine to warn about multiple -k options (or just let the last -k option win and not bother with a warning). > Index: mkoptions.c > =================================================================== > --- mkoptions.c (revision 206411) > +++ mkoptions.c (working copy) > @@ -294,7 +294,11 @@ read_options(void) > char genopt[MAXPATHLEN]; > > SLIST_INIT(&otab); > - (void) snprintf(fname, sizeof(fname), "../../conf/options"); > + if ( *ksrcdir != '\0' ) > + (void) snprintf(fname, sizeof(fname), "%s/conf/options", > + ksrcdir); > + else > + (void) snprintf(fname, sizeof(fname), "../../conf/options"); > openit: > fp = fopen(fname, "r"); > if (fp == 0) { > @@ -306,7 +310,12 @@ next: > (void) fclose(fp); > if (first == 1) { > first++; > - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); > + if ( *ksrcdir != '\0' ) > + (void) snprintf(fname, sizeof fname, > + "%s/conf/options.%s", ksrcdir, machinename); > + else > + (void) snprintf(fname, sizeof fname, > + "../../conf/options.%s", machinename); > fp = fopen(fname, "r"); > if (fp != 0) > goto next; > Index: main.c > =================================================================== > --- main.c (revision 206411) > +++ main.c (working copy) > @@ -72,6 +72,7 @@ static const char rcsid[] = > > char * PREFIX; > char destdir[MAXPATHLEN]; > +char ksrcdir[MAXPATHLEN]; > char srcdir[MAXPATHLEN]; > > int debugging; > @@ -110,8 +111,9 @@ main(int argc, char **argv) > char xxx[MAXPATHLEN]; > char *kernfile; > > + *ksrcdir = '\0'; > kernfile = NULL; > - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) > + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) > switch (ch) { > case 'C': > filebased = 1; > @@ -125,6 +127,12 @@ main(int argc, char **argv) > case 'g': > debugging++; > break; > + case 'k': > + if (*ksrcdir == '\0') > + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); > + else > + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); > + break; > case 'p': > profiling++; > break; > @@ -164,7 +172,8 @@ main(int argc, char **argv) > len = strlen(destdir); > while (len > 1 && destdir[len - 1] == '/') > destdir[--len] = '\0'; > - get_srcdir(); > + if (*ksrcdir == '\0') > + get_srcdir(); > } else { > strlcpy(destdir, CDIR, sizeof(destdir)); > strlcat(destdir, PREFIX, sizeof(destdir)); > @@ -210,11 +219,14 @@ main(int argc, char **argv) > * for "sys" (to make genassym.c work along with #include ) > * and similarly for "machine". > */ > - if (*srcdir == '\0') > - (void)snprintf(xxx, sizeof(xxx), "../../include"); > - else > + if (*ksrcdir != '\0') > (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > + ksrcdir, machinename); > + else if (*srcdir != '\0') > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > srcdir, machinename); > + else > + (void)snprintf(xxx, sizeof(xxx), "../../include"); > (void) unlink(path("machine")); > (void) symlink(xxx, path("machine")); > if (strcmp(machinename, machinearch) != 0) { > @@ -222,12 +234,15 @@ main(int argc, char **argv) > * make symbolic links in compilation directory for > * machinearch, if it is different than machinename. > */ > - if (*srcdir == '\0') > + if (*ksrcdir != '\0') > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > + ksrcdir, machinearch); > + else if (*srcdir != '\0') > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > + srcdir, machinearch); > + else > (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", > machinearch); > - else > - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > - srcdir, machinearch); > (void) unlink(path(machinearch)); > (void) symlink(xxx, path(machinearch)); > } > @@ -278,7 +293,7 @@ static void > usage(void) > { > > - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); > + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); > fprintf(stderr, " config -x kernel\n"); > exit(EX_USAGE); > } > Index: mkmakefile.c > =================================================================== > --- mkmakefile.c (revision 206411) > +++ mkmakefile.c (working copy) > @@ -116,7 +116,12 @@ makefile(void) > int versreq; > > read_files(); > - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); > + if (*ksrcdir != '\0') > + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", > + ksrcdir, machinename); > + else > + snprintf(line, sizeof(line), "../../conf/Makefile.%s", > + machinename); > ifp = fopen(line, "r"); > if (ifp == 0) { > snprintf(line, sizeof(line), "Makefile.%s", machinename); > @@ -139,7 +144,9 @@ makefile(void) > fprintf(ofp, "DEBUG=-g\n"); > if (profiling) > fprintf(ofp, "PROFLEVEL=%d\n", profiling); > - if (*srcdir != '\0') > + if (*ksrcdir != '\0') > + fprintf(ofp,"S=%s\n", ksrcdir); > + else if (*srcdir != '\0') > fprintf(ofp,"S=%s\n", srcdir); > while (fgets(line, BUFSIZ, ifp) != 0) { > if (*line != '%') { > @@ -347,7 +354,12 @@ next: > printf("%s: missing include filename.\n", fname); > exit(1); > } > - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); > + if (*ksrcdir != '\0') > + (void) snprintf(ifname, sizeof(ifname), "%s/%s", > + ksrcdir, wd); > + else > + (void) snprintf(ifname, sizeof(ifname), "../../%s", > + wd); > read_file(ifname); > while (((wd = get_word(fp)) != (char *)EOF) && wd) > ; > @@ -544,9 +556,17 @@ read_files(void) > char fname[MAXPATHLEN]; > struct files_name *nl, *tnl; > > - (void) snprintf(fname, sizeof(fname), "../../conf/files"); > + if (*ksrcdir != '\0') > + (void) snprintf(fname, sizeof(fname), "%s/conf/files", > + ksrcdir); > + else > + (void) snprintf(fname, sizeof(fname), "../../conf/files"); > read_file(fname); > - (void) snprintf(fname, sizeof(fname), > + if (*ksrcdir != '\0') > + (void) snprintf(fname, sizeof(fname), > + "%s/conf/files.%s", ksrcdir, machinename); > + else > + (void) snprintf(fname, sizeof(fname), > "../../conf/files.%s", machinename); > read_file(fname); > for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { > Index: config.8 > =================================================================== > --- config.8 (revision 206411) > +++ config.8 (working copy) > @@ -38,6 +38,7 @@ > .Nm > .Op Fl CVgp > .Op Fl d Ar destdir > +.Op Fl k Ar ksrcdir > .Ar SYSTEM_NAME > .Nm > .Op Fl x Ar kernel > @@ -78,6 +79,10 @@ Note that > does not append > .Ar SYSTEM_NAME > to the directory given. > +.It Fl k Ar ksrcdir > +Use > +.Ar ksrcdir > +as the kernel source tree directory, instead of the default one. > .It Fl g > Configure a system for debugging. > .It Fl x Ar kernel > Index: config.h > =================================================================== > --- config.h (revision 206411) > +++ config.h (working copy) > @@ -196,6 +196,8 @@ extern int maxusers; > > extern char *PREFIX; /* Config file name - for error messages */ > extern char srcdir[]; /* root of the kernel source tree */ > +extern char ksrcdir[]; /* root of the kernel source tree > + * set by -k flag */ > > #define eq(a,b) (!strcmp(a,b)) > #define ns(s) strdup(s) > Index: lang.l > =================================================================== > --- lang.l (revision 206411) > +++ lang.l (working copy) > @@ -259,7 +259,10 @@ include(const char *fname, int ateof) > fnamebuf = NULL; > fp = fopen(fname, "r"); > if (fp == NULL && fname[0] != '.' && fname[0] != '/') { > - asprintf(&fnamebuf, "../../conf/%s", fname); > + if (*ksrcdir != '\0') > + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); > + else > + asprintf(&fnamebuf, "../../conf/%s", fname); > if (fnamebuf != NULL) { > fp = fopen(fnamebuf, "r"); > free(fnamebuf); > > > -- > Alexandr Rybalko > aka Alex RAY > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > -- John Baldwin From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 13:46:00 2010 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF84106564A; Wed, 14 Apr 2010 13:46:00 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 7B1B48FC20; Wed, 14 Apr 2010 13:45:59 +0000 (UTC) Received: from gw ([192.168.10.10] helo=terran) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1O22qn-0008RT-VY; Wed, 14 Apr 2010 16:41:54 +0300 Date: Wed, 14 Apr 2010 16:47:22 +0300 From: Alexandr Rybalko To: John Baldwin Message-Id: <20100414164722.062cac6e.ray@dlink.ua> In-Reply-To: <201004140906.28205.jhb@freebsd.org> References: <20100414130353.c28d5128.ray@dlink.ua> <201004140906.28205.jhb@freebsd.org> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, embedded@freebsd.org Subject: Re: Patch for config utility X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 13:46:00 -0000 On Wed, 14 Apr 2010 09:06:28 -0400 John Baldwin wrote: >> On Wednesday 14 April 2010 6:03:53 am Alexandr Rybalko wrote: >> > Hi All, >> > >> > I made a patch for the config utility, which enables execution of config >> outside of the kernel source tree. >> > The main purpose is to avoid large number of configuration files for many >> boards. >> > I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than >> 4 different profiles with different kernel >> > config files. >> > If every device have 3-5 configs (with different hints files), every chip >> have ~ 5-10 vendors (producing devices on this chip), >> > every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and >> platform have 10-20 family's, so we get 40000 files in conf >> > directory of platform :) >> >> I think the patch would be simpler if you set ksrcdir to "../.." initially. >> Then most of the conditionals can be collapsed as ksrcdir could always be used >> in the code. You could just use a simple boolean in the main() routine to >> warn about multiple -k options (or just let the last -k option win and not >> bother with a warning). Thanks for review. I try to use more simplify, using existing srcdir variable, but in some places I get problem with full and relative paths, so I add different variable with full path to kernel source tree. >> >> > Index: mkoptions.c >> > =================================================================== >> > --- mkoptions.c (revision 206411) >> > +++ mkoptions.c (working copy) >> > @@ -294,7 +294,11 @@ read_options(void) >> > char genopt[MAXPATHLEN]; >> > >> > SLIST_INIT(&otab); >> > - (void) snprintf(fname, sizeof(fname), "../../conf/options"); >> > + if ( *ksrcdir != '\0' ) >> > + (void) snprintf(fname, sizeof(fname), "%s/conf/options", >> > + ksrcdir); >> > + else >> > + (void) snprintf(fname, sizeof(fname), "../../conf/options"); >> > openit: >> > fp = fopen(fname, "r"); >> > if (fp == 0) { >> > @@ -306,7 +310,12 @@ next: >> > (void) fclose(fp); >> > if (first == 1) { >> > first++; >> > - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", >> machinename); >> > + if ( *ksrcdir != '\0' ) >> > + (void) snprintf(fname, sizeof fname, >> > + "%s/conf/options.%s", ksrcdir, machinename); >> > + else >> > + (void) snprintf(fname, sizeof fname, >> > + "../../conf/options.%s", machinename); >> > fp = fopen(fname, "r"); >> > if (fp != 0) >> > goto next; >> > Index: main.c >> > =================================================================== >> > --- main.c (revision 206411) >> > +++ main.c (working copy) >> > @@ -72,6 +72,7 @@ static const char rcsid[] = >> > >> > char * PREFIX; >> > char destdir[MAXPATHLEN]; >> > +char ksrcdir[MAXPATHLEN]; >> > char srcdir[MAXPATHLEN]; >> > >> > int debugging; >> > @@ -110,8 +111,9 @@ main(int argc, char **argv) >> > char xxx[MAXPATHLEN]; >> > char *kernfile; >> > >> > + *ksrcdir = '\0'; >> > kernfile = NULL; >> > - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) >> > + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) >> > switch (ch) { >> > case 'C': >> > filebased = 1; >> > @@ -125,6 +127,12 @@ main(int argc, char **argv) >> > case 'g': >> > debugging++; >> > break; >> > + case 'k': >> > + if (*ksrcdir == '\0') >> > + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); >> > + else >> > + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); >> > + break; >> > case 'p': >> > profiling++; >> > break; >> > @@ -164,7 +172,8 @@ main(int argc, char **argv) >> > len = strlen(destdir); >> > while (len > 1 && destdir[len - 1] == '/') >> > destdir[--len] = '\0'; >> > - get_srcdir(); >> > + if (*ksrcdir == '\0') >> > + get_srcdir(); >> > } else { >> > strlcpy(destdir, CDIR, sizeof(destdir)); >> > strlcat(destdir, PREFIX, sizeof(destdir)); >> > @@ -210,11 +219,14 @@ main(int argc, char **argv) >> > * for "sys" (to make genassym.c work along with #include ) >> > * and similarly for "machine". >> > */ >> > - if (*srcdir == '\0') >> > - (void)snprintf(xxx, sizeof(xxx), "../../include"); >> > - else >> > + if (*ksrcdir != '\0') >> > (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > + ksrcdir, machinename); >> > + else if (*srcdir != '\0') >> > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > srcdir, machinename); >> > + else >> > + (void)snprintf(xxx, sizeof(xxx), "../../include"); >> > (void) unlink(path("machine")); >> > (void) symlink(xxx, path("machine")); >> > if (strcmp(machinename, machinearch) != 0) { >> > @@ -222,12 +234,15 @@ main(int argc, char **argv) >> > * make symbolic links in compilation directory for >> > * machinearch, if it is different than machinename. >> > */ >> > - if (*srcdir == '\0') >> > + if (*ksrcdir != '\0') >> > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > + ksrcdir, machinearch); >> > + else if (*srcdir != '\0') >> > + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > + srcdir, machinearch); >> > + else >> > (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", >> > machinearch); >> > - else >> > - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", >> > - srcdir, machinearch); >> > (void) unlink(path(machinearch)); >> > (void) symlink(xxx, path(machinearch)); >> > } >> > @@ -278,7 +293,7 @@ static void >> > usage(void) >> > { >> > >> > - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); >> > + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] >> sysname\n"); >> > fprintf(stderr, " config -x kernel\n"); >> > exit(EX_USAGE); >> > } >> > Index: mkmakefile.c >> > =================================================================== >> > --- mkmakefile.c (revision 206411) >> > +++ mkmakefile.c (working copy) >> > @@ -116,7 +116,12 @@ makefile(void) >> > int versreq; >> > >> > read_files(); >> > - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); >> > + if (*ksrcdir != '\0') >> > + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", >> > + ksrcdir, machinename); >> > + else >> > + snprintf(line, sizeof(line), "../../conf/Makefile.%s", >> > + machinename); >> > ifp = fopen(line, "r"); >> > if (ifp == 0) { >> > snprintf(line, sizeof(line), "Makefile.%s", machinename); >> > @@ -139,7 +144,9 @@ makefile(void) >> > fprintf(ofp, "DEBUG=-g\n"); >> > if (profiling) >> > fprintf(ofp, "PROFLEVEL=%d\n", profiling); >> > - if (*srcdir != '\0') >> > + if (*ksrcdir != '\0') >> > + fprintf(ofp,"S=%s\n", ksrcdir); >> > + else if (*srcdir != '\0') >> > fprintf(ofp,"S=%s\n", srcdir); >> > while (fgets(line, BUFSIZ, ifp) != 0) { >> > if (*line != '%') { >> > @@ -347,7 +354,12 @@ next: >> > printf("%s: missing include filename.\n", fname); >> > exit(1); >> > } >> > - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); >> > + if (*ksrcdir != '\0') >> > + (void) snprintf(ifname, sizeof(ifname), "%s/%s", >> > + ksrcdir, wd); >> > + else >> > + (void) snprintf(ifname, sizeof(ifname), "../../%s", >> > + wd); >> > read_file(ifname); >> > while (((wd = get_word(fp)) != (char *)EOF) && wd) >> > ; >> > @@ -544,9 +556,17 @@ read_files(void) >> > char fname[MAXPATHLEN]; >> > struct files_name *nl, *tnl; >> > >> > - (void) snprintf(fname, sizeof(fname), "../../conf/files"); >> > + if (*ksrcdir != '\0') >> > + (void) snprintf(fname, sizeof(fname), "%s/conf/files", >> > + ksrcdir); >> > + else >> > + (void) snprintf(fname, sizeof(fname), "../../conf/files"); >> > read_file(fname); >> > - (void) snprintf(fname, sizeof(fname), >> > + if (*ksrcdir != '\0') >> > + (void) snprintf(fname, sizeof(fname), >> > + "%s/conf/files.%s", ksrcdir, machinename); >> > + else >> > + (void) snprintf(fname, sizeof(fname), >> > "../../conf/files.%s", machinename); >> > read_file(fname); >> > for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { >> > Index: config.8 >> > =================================================================== >> > --- config.8 (revision 206411) >> > +++ config.8 (working copy) >> > @@ -38,6 +38,7 @@ >> > .Nm >> > .Op Fl CVgp >> > .Op Fl d Ar destdir >> > +.Op Fl k Ar ksrcdir >> > .Ar SYSTEM_NAME >> > .Nm >> > .Op Fl x Ar kernel >> > @@ -78,6 +79,10 @@ Note that >> > does not append >> > .Ar SYSTEM_NAME >> > to the directory given. >> > +.It Fl k Ar ksrcdir >> > +Use >> > +.Ar ksrcdir >> > +as the kernel source tree directory, instead of the default one. >> > .It Fl g >> > Configure a system for debugging. >> > .It Fl x Ar kernel >> > Index: config.h >> > =================================================================== >> > --- config.h (revision 206411) >> > +++ config.h (working copy) >> > @@ -196,6 +196,8 @@ extern int maxusers; >> > >> > extern char *PREFIX; /* Config file name - for error messages */ >> > extern char srcdir[]; /* root of the kernel source tree */ >> > +extern char ksrcdir[]; /* root of the kernel source tree >> > + * set by -k flag */ >> > >> > #define eq(a,b) (!strcmp(a,b)) >> > #define ns(s) strdup(s) >> > Index: lang.l >> > =================================================================== >> > --- lang.l (revision 206411) >> > +++ lang.l (working copy) >> > @@ -259,7 +259,10 @@ include(const char *fname, int ateof) >> > fnamebuf = NULL; >> > fp = fopen(fname, "r"); >> > if (fp == NULL && fname[0] != '.' && fname[0] != '/') { >> > - asprintf(&fnamebuf, "../../conf/%s", fname); >> > + if (*ksrcdir != '\0') >> > + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); >> > + else >> > + asprintf(&fnamebuf, "../../conf/%s", fname); >> > if (fnamebuf != NULL) { >> > fp = fopen(fnamebuf, "r"); >> > free(fnamebuf); >> > >> > >> > -- >> > Alexandr Rybalko >> > aka Alex RAY >> > _______________________________________________ >> > freebsd-hackers@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" >> > >> >> -- >> John Baldwin -- Alexandr Rybalko aka Alex RAY From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 15:56:16 2010 Return-Path: Delivered-To: embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 114B71065672; Wed, 14 Apr 2010 15:56:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B0A298FC19; Wed, 14 Apr 2010 15:56:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3EFjNwW047018; Wed, 14 Apr 2010 09:45:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 14 Apr 2010 09:45:36 -0600 (MDT) Message-Id: <20100414.094536.918765004165097153.imp@bsdimp.com> To: ray@dlink.ua From: "M. Warner Losh" In-Reply-To: <20100414130353.c28d5128.ray@dlink.ua> References: <20100414130353.c28d5128.ray@dlink.ua> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: hackers@FreeBSD.org, embedded@FreeBSD.org Subject: Re: Patch for config utility X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 15:56:16 -0000 Quick comment: Why not set srcdir instead of inventing ksrcdir? Warner In message: <20100414130353.c28d5128.ray@dlink.ua> Alexandr Rybalko writes: : Hi All, : : I made a patch for the config utility, which enables execution of config outside of the kernel source tree. : The main purpose is to avoid large number of configuration files for many boards. : I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel : config files. : If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), : every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf : directory of platform :) : : : Index: mkoptions.c : =================================================================== : --- mkoptions.c (revision 206411) : +++ mkoptions.c (working copy) : @@ -294,7 +294,11 @@ read_options(void) : char genopt[MAXPATHLEN]; : : SLIST_INIT(&otab); : - (void) snprintf(fname, sizeof(fname), "../../conf/options"); : + if ( *ksrcdir != '\0' ) : + (void) snprintf(fname, sizeof(fname), "%s/conf/options", : + ksrcdir); : + else : + (void) snprintf(fname, sizeof(fname), "../../conf/options"); : openit: : fp = fopen(fname, "r"); : if (fp == 0) { : @@ -306,7 +310,12 @@ next: : (void) fclose(fp); : if (first == 1) { : first++; : - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); : + if ( *ksrcdir != '\0' ) : + (void) snprintf(fname, sizeof fname, : + "%s/conf/options.%s", ksrcdir, machinename); : + else : + (void) snprintf(fname, sizeof fname, : + "../../conf/options.%s", machinename); : fp = fopen(fname, "r"); : if (fp != 0) : goto next; : Index: main.c : =================================================================== : --- main.c (revision 206411) : +++ main.c (working copy) : @@ -72,6 +72,7 @@ static const char rcsid[] = : : char * PREFIX; : char destdir[MAXPATHLEN]; : +char ksrcdir[MAXPATHLEN]; : char srcdir[MAXPATHLEN]; : : int debugging; : @@ -110,8 +111,9 @@ main(int argc, char **argv) : char xxx[MAXPATHLEN]; : char *kernfile; : : + *ksrcdir = '\0'; : kernfile = NULL; : - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) : + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) : switch (ch) { : case 'C': : filebased = 1; : @@ -125,6 +127,12 @@ main(int argc, char **argv) : case 'g': : debugging++; : break; : + case 'k': : + if (*ksrcdir == '\0') : + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); : + else : + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); : + break; : case 'p': : profiling++; : break; : @@ -164,7 +172,8 @@ main(int argc, char **argv) : len = strlen(destdir); : while (len > 1 && destdir[len - 1] == '/') : destdir[--len] = '\0'; : - get_srcdir(); : + if (*ksrcdir == '\0') : + get_srcdir(); : } else { : strlcpy(destdir, CDIR, sizeof(destdir)); : strlcat(destdir, PREFIX, sizeof(destdir)); : @@ -210,11 +219,14 @@ main(int argc, char **argv) : * for "sys" (to make genassym.c work along with #include ) : * and similarly for "machine". : */ : - if (*srcdir == '\0') : - (void)snprintf(xxx, sizeof(xxx), "../../include"); : - else : + if (*ksrcdir != '\0') : (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : + ksrcdir, machinename); : + else if (*srcdir != '\0') : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : srcdir, machinename); : + else : + (void)snprintf(xxx, sizeof(xxx), "../../include"); : (void) unlink(path("machine")); : (void) symlink(xxx, path("machine")); : if (strcmp(machinename, machinearch) != 0) { : @@ -222,12 +234,15 @@ main(int argc, char **argv) : * make symbolic links in compilation directory for : * machinearch, if it is different than machinename. : */ : - if (*srcdir == '\0') : + if (*ksrcdir != '\0') : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : + ksrcdir, machinearch); : + else if (*srcdir != '\0') : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : + srcdir, machinearch); : + else : (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", : machinearch); : - else : - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", : - srcdir, machinearch); : (void) unlink(path(machinearch)); : (void) symlink(xxx, path(machinearch)); : } : @@ -278,7 +293,7 @@ static void : usage(void) : { : : - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); : + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); : fprintf(stderr, " config -x kernel\n"); : exit(EX_USAGE); : } : Index: mkmakefile.c : =================================================================== : --- mkmakefile.c (revision 206411) : +++ mkmakefile.c (working copy) : @@ -116,7 +116,12 @@ makefile(void) : int versreq; : : read_files(); : - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); : + if (*ksrcdir != '\0') : + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", : + ksrcdir, machinename); : + else : + snprintf(line, sizeof(line), "../../conf/Makefile.%s", : + machinename); : ifp = fopen(line, "r"); : if (ifp == 0) { : snprintf(line, sizeof(line), "Makefile.%s", machinename); : @@ -139,7 +144,9 @@ makefile(void) : fprintf(ofp, "DEBUG=-g\n"); : if (profiling) : fprintf(ofp, "PROFLEVEL=%d\n", profiling); : - if (*srcdir != '\0') : + if (*ksrcdir != '\0') : + fprintf(ofp,"S=%s\n", ksrcdir); : + else if (*srcdir != '\0') : fprintf(ofp,"S=%s\n", srcdir); : while (fgets(line, BUFSIZ, ifp) != 0) { : if (*line != '%') { : @@ -347,7 +354,12 @@ next: : printf("%s: missing include filename.\n", fname); : exit(1); : } : - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); : + if (*ksrcdir != '\0') : + (void) snprintf(ifname, sizeof(ifname), "%s/%s", : + ksrcdir, wd); : + else : + (void) snprintf(ifname, sizeof(ifname), "../../%s", : + wd); : read_file(ifname); : while (((wd = get_word(fp)) != (char *)EOF) && wd) : ; : @@ -544,9 +556,17 @@ read_files(void) : char fname[MAXPATHLEN]; : struct files_name *nl, *tnl; : : - (void) snprintf(fname, sizeof(fname), "../../conf/files"); : + if (*ksrcdir != '\0') : + (void) snprintf(fname, sizeof(fname), "%s/conf/files", : + ksrcdir); : + else : + (void) snprintf(fname, sizeof(fname), "../../conf/files"); : read_file(fname); : - (void) snprintf(fname, sizeof(fname), : + if (*ksrcdir != '\0') : + (void) snprintf(fname, sizeof(fname), : + "%s/conf/files.%s", ksrcdir, machinename); : + else : + (void) snprintf(fname, sizeof(fname), : "../../conf/files.%s", machinename); : read_file(fname); : for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { : Index: config.8 : =================================================================== : --- config.8 (revision 206411) : +++ config.8 (working copy) : @@ -38,6 +38,7 @@ : .Nm : .Op Fl CVgp : .Op Fl d Ar destdir : +.Op Fl k Ar ksrcdir : .Ar SYSTEM_NAME : .Nm : .Op Fl x Ar kernel : @@ -78,6 +79,10 @@ Note that : does not append : .Ar SYSTEM_NAME : to the directory given. : +.It Fl k Ar ksrcdir : +Use : +.Ar ksrcdir : +as the kernel source tree directory, instead of the default one. : .It Fl g : Configure a system for debugging. : .It Fl x Ar kernel : Index: config.h : =================================================================== : --- config.h (revision 206411) : +++ config.h (working copy) : @@ -196,6 +196,8 @@ extern int maxusers; : : extern char *PREFIX; /* Config file name - for error messages */ : extern char srcdir[]; /* root of the kernel source tree */ : +extern char ksrcdir[]; /* root of the kernel source tree : + * set by -k flag */ : : #define eq(a,b) (!strcmp(a,b)) : #define ns(s) strdup(s) : Index: lang.l : =================================================================== : --- lang.l (revision 206411) : +++ lang.l (working copy) : @@ -259,7 +259,10 @@ include(const char *fname, int ateof) : fnamebuf = NULL; : fp = fopen(fname, "r"); : if (fp == NULL && fname[0] != '.' && fname[0] != '/') { : - asprintf(&fnamebuf, "../../conf/%s", fname); : + if (*ksrcdir != '\0') : + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); : + else : + asprintf(&fnamebuf, "../../conf/%s", fname); : if (fnamebuf != NULL) { : fp = fopen(fnamebuf, "r"); : free(fnamebuf); : : : -- : Alexandr Rybalko : aka Alex RAY : _______________________________________________ : freebsd-embedded@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-embedded : To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" : : From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 19:56:48 2010 Return-Path: Delivered-To: embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61201106564A; Wed, 14 Apr 2010 19:56:48 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id AC09F8FC22; Wed, 14 Apr 2010 19:56:47 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so179939fge.13 for ; Wed, 14 Apr 2010 12:56:46 -0700 (PDT) Received: by 10.86.6.39 with SMTP id 39mr6329437fgf.4.1271275006382; Wed, 14 Apr 2010 12:56:46 -0700 (PDT) Received: from localhost (246-58-132-95.pool.ukrtel.net [95.132.58.246]) by mx.google.com with ESMTPS id e11sm126862fga.18.2010.04.14.12.56.43 (version=SSLv3 cipher=RC4-MD5); Wed, 14 Apr 2010 12:56:44 -0700 (PDT) Date: Wed, 14 Apr 2010 22:56:13 +0300 From: Alex RAY To: "M. Warner Losh" Message-Id: <20100414225613.99ceff5d.ray@ddteam.net> In-Reply-To: <20100414.094536.918765004165097153.imp@bsdimp.com> References: <20100414130353.c28d5128.ray@dlink.ua> <20100414.094536.918765004165097153.imp@bsdimp.com> Organization: DDTeam.net X-Mailer: Sylpheed 2.7.1 (GTK+ 2.16.6; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: ray@dlink.ua, hackers@FreeBSD.org, embedded@FreeBSD.org Subject: Re: Patch for config utility X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 19:56:48 -0000 Thanks for On Wed, 14 Apr 2010 09:45:36 -0600 (MDT) "M. Warner Losh" wrote: > Quick comment: Why not set srcdir instead of inventing ksrcdir? I've tried to use a variable srcdir, but found several points where need to change relative to absolute paths. Because I tried to minimize the impact on the behavior of utilities and tried to make the code of changes easier to read, then decided to make a separate variable. > > Warner > > In message: <20100414130353.c28d5128.ray@dlink.ua> > Alexandr Rybalko writes: > : Hi All, > : > : I made a patch for the config utility, which enables execution of config outside of the kernel source tree. > : The main purpose is to avoid large number of configuration files for many boards. > : I work on D-Link DIR-320 device (Broadcom BCM5354) which must have more than 4 different profiles with different kernel > : config files. > : If every device have 3-5 configs (with different hints files), every chip have ~ 5-10 vendors (producing devices on this chip), > : every chip family have 10-20 chips (BCM5354 is a BCM4700 family), and platform have 10-20 family's, so we get 40000 files in conf > : directory of platform :) > : > : > : Index: mkoptions.c > : =================================================================== > : --- mkoptions.c (revision 206411) > : +++ mkoptions.c (working copy) > : @@ -294,7 +294,11 @@ read_options(void) > : char genopt[MAXPATHLEN]; > : > : SLIST_INIT(&otab); > : - (void) snprintf(fname, sizeof(fname), "../../conf/options"); > : + if ( *ksrcdir != '\0' ) > : + (void) snprintf(fname, sizeof(fname), "%s/conf/options", > : + ksrcdir); > : + else > : + (void) snprintf(fname, sizeof(fname), "../../conf/options"); > : openit: > : fp = fopen(fname, "r"); > : if (fp == 0) { > : @@ -306,7 +310,12 @@ next: > : (void) fclose(fp); > : if (first == 1) { > : first++; > : - (void) snprintf(fname, sizeof fname, "../../conf/options.%s", machinename); > : + if ( *ksrcdir != '\0' ) > : + (void) snprintf(fname, sizeof fname, > : + "%s/conf/options.%s", ksrcdir, machinename); > : + else > : + (void) snprintf(fname, sizeof fname, > : + "../../conf/options.%s", machinename); > : fp = fopen(fname, "r"); > : if (fp != 0) > : goto next; > : Index: main.c > : =================================================================== > : --- main.c (revision 206411) > : +++ main.c (working copy) > : @@ -72,6 +72,7 @@ static const char rcsid[] = > : > : char * PREFIX; > : char destdir[MAXPATHLEN]; > : +char ksrcdir[MAXPATHLEN]; > : char srcdir[MAXPATHLEN]; > : > : int debugging; > : @@ -110,8 +111,9 @@ main(int argc, char **argv) > : char xxx[MAXPATHLEN]; > : char *kernfile; > : > : + *ksrcdir = '\0'; > : kernfile = NULL; > : - while ((ch = getopt(argc, argv, "Cd:gpVx:")) != -1) > : + while ((ch = getopt(argc, argv, "Cd:gk:pVx:")) != -1) > : switch (ch) { > : case 'C': > : filebased = 1; > : @@ -125,6 +127,12 @@ main(int argc, char **argv) > : case 'g': > : debugging++; > : break; > : + case 'k': > : + if (*ksrcdir == '\0') > : + strlcpy(ksrcdir, optarg, sizeof(ksrcdir)); > : + else > : + errx(EXIT_FAILURE, "Kernel ksrcdir already set"); > : + break; > : case 'p': > : profiling++; > : break; > : @@ -164,7 +172,8 @@ main(int argc, char **argv) > : len = strlen(destdir); > : while (len > 1 && destdir[len - 1] == '/') > : destdir[--len] = '\0'; > : - get_srcdir(); > : + if (*ksrcdir == '\0') > : + get_srcdir(); > : } else { > : strlcpy(destdir, CDIR, sizeof(destdir)); > : strlcat(destdir, PREFIX, sizeof(destdir)); > : @@ -210,11 +219,14 @@ main(int argc, char **argv) > : * for "sys" (to make genassym.c work along with #include ) > : * and similarly for "machine". > : */ > : - if (*srcdir == '\0') > : - (void)snprintf(xxx, sizeof(xxx), "../../include"); > : - else > : + if (*ksrcdir != '\0') > : (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : + ksrcdir, machinename); > : + else if (*srcdir != '\0') > : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : srcdir, machinename); > : + else > : + (void)snprintf(xxx, sizeof(xxx), "../../include"); > : (void) unlink(path("machine")); > : (void) symlink(xxx, path("machine")); > : if (strcmp(machinename, machinearch) != 0) { > : @@ -222,12 +234,15 @@ main(int argc, char **argv) > : * make symbolic links in compilation directory for > : * machinearch, if it is different than machinename. > : */ > : - if (*srcdir == '\0') > : + if (*ksrcdir != '\0') > : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : + ksrcdir, machinearch); > : + else if (*srcdir != '\0') > : + (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : + srcdir, machinearch); > : + else > : (void)snprintf(xxx, sizeof(xxx), "../../../%s/include", > : machinearch); > : - else > : - (void)snprintf(xxx, sizeof(xxx), "%s/%s/include", > : - srcdir, machinearch); > : (void) unlink(path(machinearch)); > : (void) symlink(xxx, path(machinearch)); > : } > : @@ -278,7 +293,7 @@ static void > : usage(void) > : { > : > : - fprintf(stderr, "usage: config [-CgpV] [-d destdir] sysname\n"); > : + fprintf(stderr, "usage: config [-CgpV] [-k srcdir] [-d destdir] sysname\n"); > : fprintf(stderr, " config -x kernel\n"); > : exit(EX_USAGE); > : } > : Index: mkmakefile.c > : =================================================================== > : --- mkmakefile.c (revision 206411) > : +++ mkmakefile.c (working copy) > : @@ -116,7 +116,12 @@ makefile(void) > : int versreq; > : > : read_files(); > : - snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); > : + if (*ksrcdir != '\0') > : + snprintf(line, sizeof(line), "%s/conf/Makefile.%s", > : + ksrcdir, machinename); > : + else > : + snprintf(line, sizeof(line), "../../conf/Makefile.%s", > : + machinename); > : ifp = fopen(line, "r"); > : if (ifp == 0) { > : snprintf(line, sizeof(line), "Makefile.%s", machinename); > : @@ -139,7 +144,9 @@ makefile(void) > : fprintf(ofp, "DEBUG=-g\n"); > : if (profiling) > : fprintf(ofp, "PROFLEVEL=%d\n", profiling); > : - if (*srcdir != '\0') > : + if (*ksrcdir != '\0') > : + fprintf(ofp,"S=%s\n", ksrcdir); > : + else if (*srcdir != '\0') > : fprintf(ofp,"S=%s\n", srcdir); > : while (fgets(line, BUFSIZ, ifp) != 0) { > : if (*line != '%') { > : @@ -347,7 +354,12 @@ next: > : printf("%s: missing include filename.\n", fname); > : exit(1); > : } > : - (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); > : + if (*ksrcdir != '\0') > : + (void) snprintf(ifname, sizeof(ifname), "%s/%s", > : + ksrcdir, wd); > : + else > : + (void) snprintf(ifname, sizeof(ifname), "../../%s", > : + wd); > : read_file(ifname); > : while (((wd = get_word(fp)) != (char *)EOF) && wd) > : ; > : @@ -544,9 +556,17 @@ read_files(void) > : char fname[MAXPATHLEN]; > : struct files_name *nl, *tnl; > : > : - (void) snprintf(fname, sizeof(fname), "../../conf/files"); > : + if (*ksrcdir != '\0') > : + (void) snprintf(fname, sizeof(fname), "%s/conf/files", > : + ksrcdir); > : + else > : + (void) snprintf(fname, sizeof(fname), "../../conf/files"); > : read_file(fname); > : - (void) snprintf(fname, sizeof(fname), > : + if (*ksrcdir != '\0') > : + (void) snprintf(fname, sizeof(fname), > : + "%s/conf/files.%s", ksrcdir, machinename); > : + else > : + (void) snprintf(fname, sizeof(fname), > : "../../conf/files.%s", machinename); > : read_file(fname); > : for (nl = STAILQ_FIRST(&fntab); nl != NULL; nl = tnl) { > : Index: config.8 > : =================================================================== > : --- config.8 (revision 206411) > : +++ config.8 (working copy) > : @@ -38,6 +38,7 @@ > : .Nm > : .Op Fl CVgp > : .Op Fl d Ar destdir > : +.Op Fl k Ar ksrcdir > : .Ar SYSTEM_NAME > : .Nm > : .Op Fl x Ar kernel > : @@ -78,6 +79,10 @@ Note that > : does not append > : .Ar SYSTEM_NAME > : to the directory given. > : +.It Fl k Ar ksrcdir > : +Use > : +.Ar ksrcdir > : +as the kernel source tree directory, instead of the default one. > : .It Fl g > : Configure a system for debugging. > : .It Fl x Ar kernel > : Index: config.h > : =================================================================== > : --- config.h (revision 206411) > : +++ config.h (working copy) > : @@ -196,6 +196,8 @@ extern int maxusers; > : > : extern char *PREFIX; /* Config file name - for error messages */ > : extern char srcdir[]; /* root of the kernel source tree */ > : +extern char ksrcdir[]; /* root of the kernel source tree > : + * set by -k flag */ > : > : #define eq(a,b) (!strcmp(a,b)) > : #define ns(s) strdup(s) > : Index: lang.l > : =================================================================== > : --- lang.l (revision 206411) > : +++ lang.l (working copy) > : @@ -259,7 +259,10 @@ include(const char *fname, int ateof) > : fnamebuf = NULL; > : fp = fopen(fname, "r"); > : if (fp == NULL && fname[0] != '.' && fname[0] != '/') { > : - asprintf(&fnamebuf, "../../conf/%s", fname); > : + if (*ksrcdir != '\0') > : + asprintf(&fnamebuf, "%s/conf/%s", ksrcdir, fname); > : + else > : + asprintf(&fnamebuf, "../../conf/%s", fname); > : if (fnamebuf != NULL) { > : fp = fopen(fnamebuf, "r"); > : free(fnamebuf); > : > : > : -- > : Alexandr Rybalko > : aka Alex RAY > : _______________________________________________ > : freebsd-embedded@freebsd.org mailing list > : http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > : To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" > : > : -- Alex RAY From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 20:26:03 2010 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B32F9106566B for ; Wed, 14 Apr 2010 20:26:03 +0000 (UTC) (envelope-from aucampia@gmail.com) Received: from mail-bw0-f214.google.com (mail-bw0-f214.google.com [209.85.218.214]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC0F8FC1E for ; Wed, 14 Apr 2010 20:26:02 +0000 (UTC) Received: by bwz6 with SMTP id 6so565600bwz.13 for ; Wed, 14 Apr 2010 13:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=u5/qLasNR9d7G74+e75+7PhIIahk5yonw5EsSz7QF70=; b=fZjGBel4LbntAtaiBE6/3sck/4VWhCJ2UXQzxxQiauSacJzUWqrrOp1QoQYNW2yhP6 SJOvXQZNJn/ZKV+G2qpFXbZvgLOkuCIpph7VIpUnNtWU2Wry1z3+lfGjYoa545ucLr4s VbE5UY7wYYBRlKJ9J2U0gb/JjSUVl8EFvf5mQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=wNSF2zctiG3uJ6u6uz+cLI9SnzHi2SQB+irs2d+489RwHs0fgTpD413HH8aJkGY7uV KERh4yMQZgUbSn7lxmqAD95ifmZvzoqRyJXrK1XTS3TbIs+5xlZy0766iEkxEW2A62Xv Rpb3iaUyH/jzI4sdCNn+FAmA+lZSSJw1gEShU= Received: by 10.204.25.145 with SMTP id z17mr2761850bkb.181.1271274912337; Wed, 14 Apr 2010 12:55:12 -0700 (PDT) Received: from [192.168.0.50] (196-210-40-13.dynamic.isadsl.co.za [196.210.40.13]) by mx.google.com with ESMTPS id x16sm684008bku.5.2010.04.14.12.55.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 14 Apr 2010 12:55:11 -0700 (PDT) Message-ID: <4BC61E1C.9000101@gmail.com> Date: Wed, 14 Apr 2010 21:57:16 +0200 From: Iwan Aucamp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 To: freebsd-embedded@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Wireless Router X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:26:03 -0000 I'm looking for a device which I intend to use as a wireless router - and would like to load either bsd or linux on - with at least following: 1xusb, 2xethernet, 2xmini-pci(e). I found this : http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8377EWLAN A bit pricey for what you get - but quite reasonable - would likely be cheaper if it was for mass market - think they maybe sell 100 a year if that. I have looked also at: - routerboard : mikrotik doesn't really want to help people to load other OS on it - and it's a mission from what i've seen to do it - alix : a bit slow - and I don't really like the amd geode (seems like its not really made for router applications) - routerstation pro : probably best option price wise - but a bit more power would be nice - and board layout is bit awkward. Any other ideas ? From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 20:33:09 2010 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79C001065672 for ; Wed, 14 Apr 2010 20:33:09 +0000 (UTC) (envelope-from info@martenvijn.nl) Received: from sirius.math.leidenuniv.nl (sirius.math.leidenuniv.nl [132.229.228.2]) by mx1.freebsd.org (Postfix) with ESMTP id 379DF8FC13 for ; Wed, 14 Apr 2010 20:33:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sirius.math.leidenuniv.nl (Postfix) with ESMTP id A2280B5835; Wed, 14 Apr 2010 21:30:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at math.leidenuniv.nl Received: from sirius.math.leidenuniv.nl ([127.0.0.1]) by localhost (sirius.math.leidenuniv.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G1x21UiO-RJ2; Wed, 14 Apr 2010 21:29:59 +0200 (CEST) Received: from [192.168.178.116] (martenvijn.xs4all.nl [80.101.161.153]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mvn) by sirius.math.leidenuniv.nl (Postfix) with ESMTPSA id 86C09B582F; Wed, 14 Apr 2010 21:29:55 +0200 (CEST) From: Marten Vijn To: Iwan Aucamp In-Reply-To: <4BC61E1C.9000101@gmail.com> References: <4BC61E1C.9000101@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Wed, 14 Apr 2010 22:33:01 +0200 Message-ID: <1271277181.14240.78.camel@tor> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Cc: freebsd-embedded@freebsd.org Subject: Re: Wireless Router X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 20:33:09 -0000 On Wed, 2010-04-14 at 21:57 +0200, Iwan Aucamp wrote: > I'm looking for a device which I intend to use as a wireless router - > and would like to load either bsd or linux on - with at least following: > 1xusb, 2xethernet, 2xmini-pci(e). > > I found this : > http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8377EWLAN > A bit pricey for what you get - but quite reasonable - would likely be > cheaper if it was for mass market - think they maybe sell 100 a year if > that. > > I have looked also at: > > - routerboard : mikrotik doesn't really want to help people to load > other OS on it - and it's a mission from what i've seen to do it > - alix : a bit slow - and I don't really like the amd geode (seems > like its not really made for router applications) > - routerstation pro : probably best option price wise - but a bit more > power would be nice - and board layout is bit awkward. > > Any other ideas ? maybe try: pcengines.ch soekris.com cheers, Marten > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 21:25:10 2010 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E41A106566B for ; Wed, 14 Apr 2010 21:25:10 +0000 (UTC) (envelope-from mike@jellydonut.org) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.221.175]) by mx1.freebsd.org (Postfix) with ESMTP id 246768FC20 for ; Wed, 14 Apr 2010 21:25:09 +0000 (UTC) Received: by qyk5 with SMTP id 5so830333qyk.3 for ; Wed, 14 Apr 2010 14:25:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.183.8 with HTTP; Wed, 14 Apr 2010 14:00:39 -0700 (PDT) In-Reply-To: <4BC61E1C.9000101@gmail.com> References: <4BC61E1C.9000101@gmail.com> Date: Wed, 14 Apr 2010 17:00:39 -0400 Received: by 10.229.236.16 with SMTP id ki16mr1720714qcb.68.1271278839999; Wed, 14 Apr 2010 14:00:39 -0700 (PDT) Message-ID: From: Michael Proto To: Iwan Aucamp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-embedded@freebsd.org Subject: Re: Wireless Router X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:25:10 -0000 On Wed, Apr 14, 2010 at 3:57 PM, Iwan Aucamp wrote: > I'm looking for a device which I intend to use as a wireless router - and > would like to load either bsd or linux on - with at least following: 1xus= b, > 2xethernet, 2xmini-pci(e). > > I found this : > http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=3DMPC8377E= WLAN > A bit pricey for what you get - but quite reasonable - would likely be > cheaper if it was for mass market - think they maybe sell 100 a year if > that. > > I have looked also at: > > =A0- routerboard : mikrotik doesn't really want to help people to load ot= her > OS on it - and it's a mission from what i've seen to do it > =A0- alix : a bit slow - and I don't really like the amd geode (seems lik= e its > not really made for router applications) > =A0- routerstation pro : probably best option price wise - but a bit more > power would be nice - and board layout is bit awkward. > > Any other ideas ? > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.or= g" > I don't know what's wrong with the ALIX platform in this case. I've got one running a custom build of FreeBSD 8 on a 32MB CompactFlash (not NanoBSD but my own cut-down build) as a wireless router with 3 LAN and 1 MiniPCI. It works extremely well and I can max-out my 12MB cable connection before I get anywhere close to hitting a CPU limit on the device (I've got one of the older LX700 models, not the LX800 that only seems to be available now). It works very well as a wireless router platform in a moderately-inexpensive price point, and has an onboard glxsb crypto accelerator for AES-128 IPSec. -Proto From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 21:27:14 2010 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADE60106566B for ; Wed, 14 Apr 2010 21:27:14 +0000 (UTC) (envelope-from outbackdingo@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5ED8A8FC1C for ; Wed, 14 Apr 2010 21:27:14 +0000 (UTC) Received: by gyh20 with SMTP id 20so283509gyh.13 for ; Wed, 14 Apr 2010 14:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type; bh=Pv5tTYRASgAU18yILtmDOLFjgANYSyk5R4PpZurgZLY=; b=IfcK7og3ekj5XukG2YFz8UMkUdcTUiDQcO+V/f4CM0aOjrau8iVZy+9/rg/OF6x8od qe5PYeczIb+pw1IVsuSbruXMPcEaeFmsGPIKl8VbefL/5MKQQ8l2HhX/wewSuOWATgEt 4FD62w4zly+izM7T2jexNWlBswIxjihZpdSR4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=JKGW/uYPjhuZKrmU62qr0wna7ghvtFhyW+yT0EgGZiVLZ9Eebri7VLZstd/0DRrFlR jg5+GOfLITOetCGuRQOLxuPttCDnIF237LX91lOmqoA3DvGhC/JTAunvE9PnY0hJLLSc j8n7c4wKnkDoH6hCZdLQDga63+k879dvBBtWU= MIME-Version: 1.0 Received: by 10.100.178.3 with HTTP; Wed, 14 Apr 2010 14:00:26 -0700 (PDT) In-Reply-To: <4BC61E1C.9000101@gmail.com> References: <4BC61E1C.9000101@gmail.com> Date: Wed, 14 Apr 2010 17:00:26 -0400 Received: by 10.101.127.15 with SMTP id e15mr5853089ann.96.1271278826721; Wed, 14 Apr 2010 14:00:26 -0700 (PDT) Message-ID: From: Outback Dingo To: Iwan Aucamp Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-embedded@freebsd.org Subject: Re: Wireless Router X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:27:14 -0000 On Wed, Apr 14, 2010 at 3:57 PM, Iwan Aucamp wrote: > I'm looking for a device which I intend to use as a wireless router - and > would like to load either bsd or linux on - with at least following: 1xusb, > 2xethernet, 2xmini-pci(e). > > I found this : > http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8377EWLAN > A bit pricey for what you get - but quite reasonable - would likely be > cheaper if it was for mass market - think they maybe sell 100 a year if > that. > > I have looked also at: > > - routerboard : mikrotik doesn't really want to help people to load other > OS on it - and it's a mission from what i've seen to do it > - alix : a bit slow - and I don't really like the amd geode (seems like > its not really made for router applications) > - routerstation pro : probably best option price wise - but a bit more > power would be nice - and board layout is bit awkward. > > Any other ideas ? > routerstation pros are nice though > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org > " > From owner-freebsd-embedded@FreeBSD.ORG Wed Apr 14 21:54:25 2010 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86FBD106566B for ; Wed, 14 Apr 2010 21:54:25 +0000 (UTC) (envelope-from joe@rewt.org.uk) Received: from smtpauth.rollernet.us (smtpauth6.rollernet.us [IPv6:2620:0:950:f000:213:72ff:fe4f:6a76]) by mx1.freebsd.org (Postfix) with ESMTP id 66C8B8FC14 for ; Wed, 14 Apr 2010 21:54:25 +0000 (UTC) Received: from smtpauth.rollernet.us (localhost [127.0.0.1]) by smtpauth.rollernet.us (Postfix) with ESMTP id D5B13594014; Wed, 14 Apr 2010 14:54:23 -0700 (PDT) Received: from jasmine.barbary (nat2.kaya.stf.rewt.org.uk [62.84.188.41]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jasmine) by smtpauth.rollernet.us (Postfix) with ESMTPSA; Wed, 14 Apr 2010 14:54:23 -0700 (PDT) Received: by jasmine.barbary (Postfix, from userid 1000) id F30A5130B46; Wed, 14 Apr 2010 22:56:04 +0100 (BST) Date: Wed, 14 Apr 2010 22:56:04 +0100 From: Joe Holden To: Iwan Aucamp Message-ID: <20100414215604.GA9303@jasmine.barbary> References: <4BC61E1C.9000101@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BC61E1C.9000101@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Rollernet-Abuse: Processed by Roller Network Mail Services. Contact abuse@rollernet.us to report violations. Abuse policy: http://rollernet.us/abuse.php X-Rollernet-Submit: Submit ID 17be.4bc6398f.ccff3.0 Cc: freebsd-embedded@freebsd.org Subject: Re: Wireless Router X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 21:54:25 -0000 On Wed, Apr 14, 2010 at 09:57:16PM +0200, Iwan Aucamp wrote: > I'm looking for a device which I intend to use as a wireless router > - and would like to load either bsd or linux on - with at least > following: 1xusb, 2xethernet, 2xmini-pci(e). > > I found this : http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8377EWLAN > A bit pricey for what you get - but quite reasonable - would likely > be cheaper if it was for mass market - think they maybe sell 100 a > year if that. > > I have looked also at: > > - routerboard : mikrotik doesn't really want to help people to load > other OS on it - and it's a mission from what i've seen to do it > - alix : a bit slow - and I don't really like the amd geode (seems > like its not really made for router applications) > - routerstation pro : probably best option price wise - but a bit > more power would be nice - and board layout is bit awkward. > > Any other ideas ? > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" I use an ALIX as headless FreeBSD CPE without a problem, can easily do 100meg and as they also have a crypto device, I offload openvpn aes processing to it which means 0 cpu impact. Out of the solutions I evaluated, the ALIX boxes were the easiest to get going Thanks, J From owner-freebsd-embedded@FreeBSD.ORG Thu Apr 15 08:20:37 2010 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66A3D106564A for ; Thu, 15 Apr 2010 08:20:37 +0000 (UTC) (envelope-from info@martenvijn.nl) Received: from sirius.math.leidenuniv.nl (sirius.math.leidenuniv.nl [132.229.228.2]) by mx1.freebsd.org (Postfix) with ESMTP id 252B98FC12 for ; Thu, 15 Apr 2010 08:20:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sirius.math.leidenuniv.nl (Postfix) with ESMTP id 372CBB5838; Thu, 15 Apr 2010 09:17:25 +0200 (CEST) X-Virus-Scanned: amavisd-new at math.leidenuniv.nl Received: from sirius.math.leidenuniv.nl ([127.0.0.1]) by localhost (sirius.math.leidenuniv.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uZW2uRgYkKfc; Thu, 15 Apr 2010 09:17:23 +0200 (CEST) Received: from [192.168.178.116] (martenvijn.xs4all.nl [80.101.161.153]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mvn) by sirius.math.leidenuniv.nl (Postfix) with ESMTPSA id 85978B5830; Thu, 15 Apr 2010 09:17:17 +0200 (CEST) From: Marten Vijn To: Joe Holden In-Reply-To: <20100414215604.GA9303@jasmine.barbary> References: <4BC61E1C.9000101@gmail.com> <20100414215604.GA9303@jasmine.barbary> Content-Type: text/plain; charset="UTF-8" Date: Thu, 15 Apr 2010 10:20:27 +0200 Message-ID: <1271319627.18002.2.camel@tor> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Cc: freebsd-embedded@freebsd.org Subject: Re: Wireless Router X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 08:20:37 -0000 On Wed, 2010-04-14 at 22:56 +0100, Joe Holden wrote: > On Wed, Apr 14, 2010 at 09:57:16PM +0200, Iwan Aucamp wrote: > > I'm looking for a device which I intend to use as a wireless router > > - and would like to load either bsd or linux on - with at least > > following: 1xusb, 2xethernet, 2xmini-pci(e). > > > > I found this : http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC8377EWLAN > > A bit pricey for what you get - but quite reasonable - would likely > > be cheaper if it was for mass market - think they maybe sell 100 a > > year if that. > > > > I have looked also at: > > > > - routerboard : mikrotik doesn't really want to help people to load > > other OS on it - and it's a mission from what i've seen to do it > > - alix : a bit slow - and I don't really like the amd geode (seems > > like its not really made for router applications) > > - routerstation pro : probably best option price wise - but a bit > > more power would be nice - and board layout is bit awkward. > > > > Any other ideas ? > > _______________________________________________ > > freebsd-embedded@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org" > > I use an ALIX as headless FreeBSD CPE without a problem, can easily do 100meg and as they also have a crypto device, I offload openvpn aes processing to it which means 0 cpu impact. > > Out of the solutions I evaluated, the ALIX boxes were the easiest to get going We use them in the Network Event Kit, http://bsd.wifisoft.org/nek for more info, a hardware overview is on http://bsd.wifisoft.org/trac/wiki/nek_hardware cheers Marten > > Thanks, > J > _______________________________________________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to "freebsd-embedded-unsubscribe@freebsd.org"