Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 May 2003 01:41:19 +0200 (CEST)
From:      Stacy Olivas <olivas@thos.digiflux.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   misc/52256: picobsd build script does not read in user/site config before showing menu
Message-ID:  <200305142341.h4ENfJCP007863@thos.digiflux.org>
Resent-Message-ID: <200305142350.h4ENoDfu083379@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         52256
>Category:       misc
>Synopsis:       picobsd build script does not read in user/site config before showing menu
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>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:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305142341.h4ENfJCP007863>