From simon@xserver.babeltech.dk  Fri Jul 13 03:09:48 2001
Return-Path: <simon@xserver.babeltech.dk>
Received: from xserver.babeltech.dk (xserver.babeltech.dk [194.255.106.97])
	by hub.freebsd.org (Postfix) with ESMTP id B825637B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jul 2001 03:09:47 -0700 (PDT)
	(envelope-from simon@xserver.babeltech.dk)
Message-Id: <200107131007.f6DA7xF34151@xserver.babeltech.dk>
Date: Fri, 13 Jul 2001 12:07:59 +0200 (CEST)
From: Simon Nielsen <simon@nitro.dk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: PicoBSD - An update to the build script to add new features
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         28938
>Category:       misc
>Synopsis:       PicoBSD - An update to the build script to add new features
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-small
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 13 03:10:00 PDT 2001
>Closed-Date:    Sun Jan 19 10:49:18 PST 2003
>Last-Modified:  Sun Jan 19 10:49:18 PST 2003
>Originator:     Simon Nielsen
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
BabelTech A/S
>Environment:
System: FreeBSD simon.babeltech.dk 4.3-STABLE FreeBSD 4.3-STABLE #18: Fri May 4 21:24:39 CEST 2001 root@babeltech.dk:/usr/obj/usr/src/sys/GENERIC i386

>Description:
A patch to the build script that adds the possibility to make make
overrides for the MFS filesystem in the type specific floppy's and
still use the main MFS as base. It also adds the -nn (or -n -n) switch
which make the script not ask for confirmation for writing the floppy
to disk when building.
>How-To-Repeat:
N/A
>Fix:
Patch is also avalible at
http://simon.nitro.dk/patch/picobsd/buildscript-nonint-mfsmerge.patch

diff -u /usr/src/release/orig.picobsd/build/config picobsd/build/config
--- /usr/src/release/orig.picobsd/build/config	Wed Jul 11 14:30:41 2001
+++ picobsd/build/config	Fri Jul 13 11:02:32 2001
@@ -13,3 +13,9 @@
 
 MY_DEVS=${MY_DEVS:-"std tun2 cuaa0 cuaa1 cuaa2 vty10 fd0 ad0 pty0 \
 	ttyd0 cuaa0 bpf0 bpf1 sa0 sa1"}
+
+# If present should the type specific MFS be merged in instead of
+# replacing the general PicoBSD MFS. Files from the type specific MFS
+# overrides files from general PicoBSD MFS.
+# Option can be yes or no. Default is no
+MERGE_TYPE_SPECIFIC_MFS=${MERGE_TYPE_SPECIFIC_MFS:-"no"}
diff -u /usr/src/release/orig.picobsd/build/picobsd picobsd/build/picobsd
--- /usr/src/release/orig.picobsd/build/picobsd	Wed Jul 11 14:30:41 2001
+++ picobsd/build/picobsd	Fri Jul 13 11:04:10 2001
@@ -82,6 +82,16 @@
     boot1=/boot/boot1
     boot2=/boot/boot2
 
+    # interactive is if interactive mode should be used.
+    interactive="YES"
+
+    # install_interactive is if the confirmation for install of the
+    #	binary image on the floppy should be interactive
+    install_interactive="YES"
+
+    # verbose is if script should be verbose
+    verbose="NO"
+
     # abort in case of error...
     set -e
 
@@ -90,10 +100,13 @@
 }
 
 # log something on stdout if verbose.
+# and wait after each log if interactive
 log() {
-    if [ "$verbose" != "" ] ; then
+    if [ "${verbose}" = "YES" ] ; then
 	printf "%s\n" "$*"
-	read -p "(log) enter to continue" foo
+	if [ "${interactive}" = "YES" ]; then
+	    read -p "(log) enter to continue" foo
+	fi
     fi
 }
 
@@ -307,18 +320,32 @@
 # Call the build procedure
 # Install image
 do_install() {
-    dialog --title "Build ${TYPE} completed" --inputbox \
-"\nThe build process was completed successfuly.\n\
+    local text_common text_interactive text_noninteractive
+
+    abort_time=10
+
+    text_common="\nThe build process was completed successfuly.\n\
 `cat .build.reply` \n\n\
 Now we are going to install the image on the floppy.\n\
-Please insert a blank floppy in /dev/fd0.\\n
-WARNING: the contents of the floppy will be permanently erased!\n\
-\n\
-Your options:\n\
+Please insert a blank floppy in /dev/fd0.\n\n\
+WARNING: the contents of the floppy will be permanently erased!\n\n"
+
+    text_interactive="Your options:\n\
 	* ^C or [Cancel] to abort,\n\
 	* Enter to install \"picobsd.bin\",\n\
-" 20 80 2> ${RISU}
-    if [ "$?" = "0" ]; then
+"
+
+    text_noninteractive="You have ${abort_time} to abort by pressing ^C\n"
+
+    if [ ${install_interactive} = "YES" ]; then
+	dialog --title "Build ${TYPE} completed" --inputbox \
+	    "${text_common}${text_interactive}" 20 80 2> ${RISU}
+    else
+	echo -e "\n\n\n${text_common}${text_noninteractive}"
+	sleep ${abort_time}
+    fi
+
+    if [ "$?" = "0" -o "${install_interactive}" = "NO" ]; then
 	echo "Writing picobsd.bin..."
 	dd if=${BUILDDIR}/picobsd.bin of=/dev/rfd0.${FLOPPY_SIZE}
     else
@@ -512,7 +539,7 @@
 	ssh-keygen -f ${MFS_MOUNTPOINT}/etc/ssh_host_key -N "" -C "root@picobsd"
     fi
 
-    if [ -d ${MY_TREE}/mfs_tree ]; then
+    if [ -d ${MY_TREE}/mfs_tree -a ${MERGE_TYPE_SPECIFIC_MFS} = "no" ]; then
 	log "---> Copy site-specific MFS tree..."
 	MFS_TREE=${MY_TREE}/mfs_tree
     else
@@ -522,6 +549,15 @@
     (cd ${MFS_TREE} ; tar -cf - --exclude CVS . ) | \
 	    (cd ${MFS_MOUNTPOINT} ; tar x${TAR_VERBOSE}f - )
 
+    # Now merge in type specific MFS if requested
+    if [ -d ${MY_TREE}/mfs_tree -a ${MERGE_TYPE_SPECIFIC_MFS} = "yes" ]; then
+	log "---> Merging  type-specific MFS tree..."
+	MFS_TREE=${MY_TREE}/mfs_tree
+
+        (cd ${MFS_TREE} ; tar -cf - --exclude CVS . ) | \
+	    (cd ${MFS_MOUNTPOINT} ; tar x${TAR_VERBOSE}f - )
+    fi
+
     if [ "${INCLUDE_FLOPPY_IN_MFS}" = "yes" ]; then
 	log "---> Copy generic floppy_tree into MFS..."
 	cp -Rp ${BUILDDIR}/floppy.tree/* ${MFS_MOUNTPOINT}/fd
@@ -658,7 +694,15 @@
 	shift
 	;;
     -n)
+	# If -n i specified two times also set install_interactive to no
+	if [ "${interactive}" = "NO" ]; then
+	    install_interactive="NO"
+	fi
+	interactive="NO"
+	;;
+    -nn)
 	interactive="NO"
+	install_interactive="NO"
 	;;
     -c*) # clean
 	clean="YES"
	
>Release-Note:
>Audit-Trail:

From: Simon Nielsen <simon@nitro.dk>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: misc/28938: PicoBSD - An update to the build script to add new
 features
Date: Sun, 12 Aug 2001 20:46:22 +0200 (CEST)

 This PR should be assigned to freebsd-small.
 
Responsible-Changed-From-To: freebsd-bugs->freebsd-small 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Sun Aug 12 12:21:05 PDT 2001 
Responsible-Changed-Why:  

According to Simon Nielsen <simon@nitro.dk> 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=28938 

From: Simon Nielsen <simon@nitro.dk>
To: <freebsd-gnats-submit@FreeBSD.org>
Cc:  
Subject: Re: misc/28938: PicoBSD - An update to the build script to add new
 features
Date: Thu, 6 Sep 2001 23:13:09 +0200 (CEST)

 There have been some changes to the build script that made the original
 patch fail. This patch should work with at least 1.1.2.12 of the build
 script.
 
 Some comments have also been changed from the original patch.
 
 Patch is also at
 http://simon.nitro.dk/patch/picobsd/buildscript-nonint-mfsmerge.2.patch
 
 Index: config
 ===================================================================
 RCS file: /home/ncvs/src/release/picobsd/build/config,v
 retrieving revision 1.1.2.1
 diff -u -d -r1.1.2.1 config
 --- config	2001/02/19 23:35:24	1.1.2.1
 +++ config	2001/09/06 21:06:51
 @@ -13,3 +13,9 @@
 
  MY_DEVS=${MY_DEVS:-"std tun2 cuaa0 cuaa1 cuaa2 vty10 fd0 ad0 pty0 \
  	ttyd0 cuaa0 bpf0 bpf1 sa0 sa1"}
 +
 +# If present should the type specific MFS be merged in instead of
 +# replacing the general PicoBSD MFS. Files from the type specific MFS
 +# overrides files from general PicoBSD MFS.
 +# Option can be yes or no. Default is no
 +MERGE_TYPE_SPECIFIC_MFS=${MERGE_TYPE_SPECIFIC_MFS:-"no"}
 Index: picobsd
 ===================================================================
 RCS file: /home/ncvs/src/release/picobsd/build/picobsd,v
 retrieving revision 1.1.2.12
 diff -u -d -r1.1.2.12 picobsd
 --- picobsd	2001/09/04 02:03:04	1.1.2.12
 +++ picobsd	2001/09/06 21:06:51
 @@ -1,6 +1,6 @@
  #!/bin/sh -
  #
 -# $FreeBSD: src/release/picobsd/build/picobsd,v 1.1.2.12 2001/09/04 02:03:04 luigi Exp $
 +# $FreeBSD$
  #
  # The new PicoBSD build script. Invoked as
  #
 @@ -87,6 +87,19 @@
      boot1=/boot/boot1
      boot2=/boot/boot2
 
 +    # Should interactive mode be used
 +    interactive=${interactive:-YES}
 +
 +    # Should the confirmation for install of the
 +    #	binary image on the floppy be interactive
 +    install_interactive=${install_interactive:-YES}
 +
 +    # Should the script be verbose
 +    verbose=${verbose:-NO}
 +
 +    # How long to wait with floppy write in "not not" interactive mode
 +    floppy_write_abort_time=10
 +
      makeopts=${MAKEOPTS:--s}	# be silent by default
      # abort in case of error...
      set -e
 @@ -96,10 +109,13 @@
  }
 
  # log something on stdout if verbose.
 +# and wait after each log if interactive
  log() {
 -    if [ "$verbose" != "" ] ; then
 +    if [ "${verbose}" = "YES" ] ; then
  	printf "%s\n" "$*"
 -	read -p "(log) enter to continue" foo
 +	if [ "${interactive}" = "YES" ]; then
 +	    read -p "(log) enter to continue" foo
 +	fi
      fi
  }
 
 @@ -313,18 +329,31 @@
  # Call the build procedure
  # Install image
  do_install() {
 -    dialog --title "Build ${THETYPE} completed" --inputbox \
 -"\nThe build process was completed successfuly.\n\
 +    local text_common text_interactive text_noninteractive
 +
 +    text_common="\nThe build process was completed successfuly.\n\
  `cat .build.reply` \n\n\
  Now we are going to install the image on the floppy.\n\
  Please insert a blank floppy in /dev/fd0.\\n
 -WARNING: the contents of the floppy will be permanently erased!\n\
 -\n\
 -Your options:\n\
 +WARNING: the contents of the floppy will be permanently erased!\n\n"
 +
 +    text_interactive="Your options:\n\
  	* ^C or [Cancel] to abort,\n\
  	* Enter to install \"picobsd.bin\",\n\
 -" 20 80 2> ${RISU}
 -    if [ "$?" = "0" ]; then
 +"
 +
 +    text_noninteractive="You have ${floppy_write_abort_time} seconds to \
 +abort by pressing ^C\n"
 +
 +    if [ ${install_interactive} = "YES" ]; then
 +	dialog --title "Build ${THETYPE} completed" --inputbox \
 +	    "${text_common}${text_interactive}" 20 80 2> ${RISU}
 +    else
 +	echo -e "\n\n\n${text_common}${text_noninteractive}"
 +	sleep ${floppy_write_abort_time}
 +    fi
 +
 +    if [ "$?" = "0" -o "${install_interactive}" = "NO" ]; then
  	echo "Writing picobsd.bin..."
  	dd if=${BUILDDIR}/picobsd.bin of=/dev/rfd0.${FLOPPY_SIZE}
      else
 @@ -506,7 +535,7 @@
  	ssh-keygen -f ${MFS_MOUNTPOINT}/etc/ssh_host_key -N "" -C "root@picobsd"
      fi
 
 -    if [ -d ${MY_TREE}/mfs_tree ]; then
 +    if [ -d ${MY_TREE}/mfs_tree -a ${MERGE_TYPE_SPECIFIC_MFS} = "no" ]; then
  	log "---> Copy site-specific MFS tree..."
  	MFS_TREE=${MY_TREE}/mfs_tree
      else
 @@ -516,6 +545,15 @@
      (cd ${MFS_TREE} ; tar -cf - --exclude CVS . ) | \
  	    (cd ${MFS_MOUNTPOINT} ; tar x${TAR_VERBOSE}f - )
 
 +    # Now merge in type specific MFS if requested
 +    if [ -d ${MY_TREE}/mfs_tree -a ${MERGE_TYPE_SPECIFIC_MFS} = "yes" ]; then
 +	log "---> Merging  type-specific MFS tree..."
 +	MFS_TREE=${MY_TREE}/mfs_tree
 +
 +        (cd ${MFS_TREE} ; tar -cf - --exclude CVS . ) | \
 +	    (cd ${MFS_MOUNTPOINT} ; tar x${TAR_VERBOSE}f - )
 +    fi
 +
      if [ "${INCLUDE_FLOPPY_IN_MFS}" = "yes" ]; then
  	log "---> Copy generic floppy_tree into MFS..."
  	cp -Rp ${BUILDDIR}/floppy.tree/* ${MFS_MOUNTPOINT}/fd
 @@ -702,7 +740,15 @@
  	shift
  	;;
      -n)
 +	# If -n i specified two times also set install_interactive to no
 +	if [ "${interactive}" = "NO" ]; then
 +	    install_interactive="NO"
 +	fi
  	interactive="NO"
 +	;;
 +    -nn)
 +	interactive="NO"
 +	install_interactive="NO"
  	;;
      -c*) # clean
  	clean="YES"
 

From: "Simon L. Nielsen" <simon@nitro.dk>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: misc/28938: PicoBSD - An update to the build script to add new features
Date: Wed, 6 Nov 2002 10:19:27 +0100

 Hello
 
 This PR can be closed since the important parts if this PR has already
 been included in PicoBSD, and the other parts doesn't really matter that
 much.
 
 -- 
 Simon L. Nielsen
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Sun Jan 19 10:49:08 PST 2003 
State-Changed-Why:  
Submitters request 

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