This patch does the following items: 1. Drops getopt in favor of getopts builtin handling. This is preferred as getopt is deprecated by POSIX. 2. Adds a -j option so that users can specify -j via the command line, which is passed to make. 3. Delays the sourcing of the nanobsd config_file so that users can depend on already on internal variables that are set later, like $NANO_MAKE_CONF_BUILD . This makes it possible for developers to depend on this file. These enhancements were based on some of the code present in the FreeNAS sourcebase. Fix: Patch attached with submission follows:
Responsible Changed From-To: freebsd-bugs->imp Over to maintainer.
----- Forwarded message from Warner Losh <imp@bsdimp.com> ----- Date: Thu, 22 Sep 2011 02:57:49 -0600 From: Warner Losh <imp@bsdimp.com> To: linimon@FreeBSD.org Cc: freebsd-bugs@FreeBSD.org, Warner Losh <imp@FreeBSD.org>, Garrett Cooper <yaneurabeya@gmail.com> Subject: Re: conf/160896: [nanobsd] [patch] use getopts, jobs option, delay -c usage improvements to nanobsd.sh X-Mailer: Apple Mail (2.1084) Rejecting parts of this patch. Specifically, the delated -c stuff is bogusly implemented. Before the change, you could have multiple -c options on the command line. after this you can't. Don't like how -j is implemented in this patch. Need to think about this because it breaks some nanobsd config files that specify NANO_PMAKE command. Other stuff looks good and it, or variations of it, will go in when we're out of the freeze. Warner ----- End forwarded message -----
----- Forwarded message from Garrett Cooper <yaneurabeya@gmail.com> ----- Date: Thu, 22 Sep 2011 08:53:16 -0700 From: Garrett Cooper <yaneurabeya@gmail.com> To: Warner Losh <imp@bsdimp.com> Cc: linimon@freebsd.org, freebsd-bugs@freebsd.org, Warner Losh <imp@freebsd.org> Subject: Re: conf/160896: [nanobsd] [patch] use getopts, jobs option, delay -c usage improvements to nanobsd.sh On Thu, Sep 22, 2011 at 1:57 AM, Warner Losh <imp@bsdimp.com> wrote: > Rejecting parts of this patch. Specifically, the delated -c stuff is > bogusly implemented. Before the change, you could have multiple -c > options on the command line. after this you can't. I'm wouldn't mind doing something like this: nano_confs while getopts '...' optch do case "$optch" in ... c) nano_confs="$nano_confs $OPTARG" ;; ... for nano_conf in $nano_confs; do . $nano_confs done The problem I was trying to work around is that (unfortunately) some packages code features (ipv6) into the names (take apr for instance), which means that the logic in FreeNAS currently always says "build a fat image" when $DEBUG == 1. > Don't like how -j is implemented in this patch. Need to think about > this because it breaks some nanobsd config files that specify NANO_PMAKE > command. My concern was that not all of my build machines are homogeneous. I have access to some "powerhouse" server machines and some low power desktops. FreeNAS had -j8 coded into NANO_PMAKE, but I made it variable ($CPUS), but I thought that was a bad idea for what should go back into nanobsd (it didn't match the defaults and could cause other issues) -- if the default (1) is incorrect, I'm all for bumping it up to 3 again. I just wasn't sure why 3 was the chosen default. > Other stuff looks good and it, or variations of it, will go in when > we're out of the freeze. Thanks for the feedback! -Garrett ----- End forwarded message -----
This version of the patch should be more acceptable as it restores the multiple -c specifier functionality. Thanks! -Garrett
Puck.. I ran into a chicken and egg problem with the MAKEOBJDIRPREFIX, where the files get sourced, etc. I'll hardcode the variable for make.conf.build in nanobsd/common and shuffle it around in the patch once I've build tested things a couple times. -Garrett
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped