From olivas@thos.digiflux.org  Wed May 14 16:41:23 2003
Return-Path: <olivas@thos.digiflux.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 99D5737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 14 May 2003 16:41:23 -0700 (PDT)
Received: from thos.digiflux.org (43.Red-80-59-151.pooles.rima-tde.net [80.59.151.43])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1E4F943FCB
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 14 May 2003 16:41:22 -0700 (PDT)
	(envelope-from olivas@thos.digiflux.org)
Received: from thos.digiflux.org (localhost [127.0.0.1])
	by thos.digiflux.org (8.12.6/8.12.6) with ESMTP id h4ENfJFu007864
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 15 May 2003 01:41:20 +0200 (CEST)
	(envelope-from olivas@thos.digiflux.org)
Received: (from root@localhost)
	by thos.digiflux.org (8.12.6/8.12.6/Submit) id h4ENfJCP007863;
	Thu, 15 May 2003 01:41:19 +0200 (CEST)
Message-Id: <200305142341.h4ENfJCP007863@thos.digiflux.org>
Date: Thu, 15 May 2003 01:41:19 +0200 (CEST)
From: Stacy Olivas <olivas@thos.digiflux.org>
Reply-To: Stacy Olivas <olivas@thos.digiflux.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: picobsd build script does not read in user/site config before showing menu
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         52256
>Category:       misc
>Synopsis:       [picobsd] picobsd build script does not read in user/site config before showing menu
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-embedded
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 14 16:50:13 PDT 2003
>Closed-Date:    
>Last-Modified:  Mon May 29 13:05:34 GMT 2006
>Originator:     Stacy Olivas
>Release:        FreeBSD 5.0-RELEASE-p7 i386
>Organization:
>Environment:
System: FreeBSD thos.digiflux.org 5.0-RELEASE-p7 FreeBSD 5.0-RELEASE-p7 #7: Sun May 11 00:17:38 CEST 2003 olivas@thos.digiflux.org:/usr/src/sys/i386/compile/Thos i386

>Description:
	When running the picobsd build script in interactive mode, the site/user config file is
	not read in *before* the menu of options is displayed.  
>How-To-Repeat:
	Create a user config script for a picobsd build and run the picobsd build script in interactive
	mode.
>Fix:


	The config script should be read in *before* the menu is displayed, so that the user
	will know what the defaul values are for options like Floppy Disk size.  To fix, apply
	the following patch:

--- picobsd	Thu May 15 01:22:27 2003
+++ picobsd.new	Thu May 15 01:20:41 2003
@@ -5,6 +5,9 @@
 # Removed the newfs -p 0 parameter, since it's no longer supported
 # by newfs in FreeBSD 5.0 - S. Olivas
 #
+# Fixed build script so it reads in site/user config files *before*
+# it displays the user dialog screen. - S. Olivas
+#
 # The new PicoBSD build script. Invoked as
 #
 # picobsd [options] floppy_type site_name
@@ -253,6 +256,16 @@
 \t3.  Site-info: ${SITE}\n\t4.  Full-path: ${MY_TREE}\n"
 }
 
+# read config variables from a global and then a type-specific file
+# basically STAND_LINKS and MY_DEVS, but can also override other
+# variables.
+#
+read_config_files() {
+    . ${PICO_TREE}/build/config
+    if [ -f ${MY_TREE}/config ] ; then
+        . ${MY_TREE}/config
+    fi
+}
 
 # Main build procedure.
 build_image() {
@@ -262,15 +275,6 @@
     set_msgs
     printf "${MSG}---> We'll use the sources living in ${SRC}\n\n"
 
-    # read config variables from a global and then a type-specific file
-    # basically STAND_LINKS and MY_DEVS, but can also override other
-    # variables.
-    # 
-    . ${PICO_TREE}/build/config
-    if [ -f ${MY_TREE}/config ] ; then
-	. ${MY_TREE}/config
-    fi
-
     # location of the object directory
     PICO_OBJ=${l_objtree}/picobsd/${THETYPE}
     log "PICO_OBJ is ${PICO_OBJ}"
@@ -326,7 +330,7 @@
   while [ true ] ; do
     set_msgs
     rm ${c_reply}
-    dialog --menu "PicoBSD build menu -- (29 sep 2001)" 19 70 12 \
+    dialog --menu "PicoBSD build menu -- (15 May 2003)" 19 70 12 \
 	N "--> READY, build it <---" \
 	T "${MSG1}" \
 	K "edit Kernel config file" \
@@ -928,6 +932,7 @@
 done
 set_build_parameters	# things that depend on ${SRC}
 set_type $1 $2		# type and site, respectively
+read_config_files	# read in site/user config files
 
 # If $1="package", it creates a neat set of floppies
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-small 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Oct 10 23:58:37 PDT 2003 
Responsible-Changed-Why:  
Assign to -small mailing list in the absence of a picobsd maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=52256 
>Unformatted:
