summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2006-10-11 21:39:19 +0000
committerjulian <julian@FreeBSD.org>2006-10-11 21:39:19 +0000
commit4104af01257f14234767300a8f2bab46677ec662 (patch)
tree00860d7532fef1eab6640aa1852c587350b87469
parent18f94ee2427155badb9bf512a7da68a0795e4629 (diff)
downloadFreeBSD-src-4104af01257f14234767300a8f2bab46677ec662.zip
FreeBSD-src-4104af01257f14234767300a8f2bab46677ec662.tar.gz
let the user know what configurations are available when asking for it.
-rwxr-xr-xtools/tools/tinybsd/tinybsd35
1 files changed, 22 insertions, 13 deletions
diff --git a/tools/tools/tinybsd/tinybsd b/tools/tools/tinybsd/tinybsd
index 351dc73..933ff24 100755
--- a/tools/tools/tinybsd/tinybsd
+++ b/tools/tools/tinybsd/tinybsd
@@ -6,6 +6,10 @@
# $FreeBSD$
#set -xv
CURRENTDIR=/usr/src/tools/tools/tinybsd
+if [ ! -d $CURRENTDIR ]
+then
+ CURRENTDIR=`pwd`
+fi
WORKDIR=/usr/obj/tinybsdbuild
KERNCONF=TINYBSD
DEFINSTARGS="-o 0 -g 0 -m 555"
@@ -103,7 +107,6 @@ loadvars () {
IFS="$OIFS"
case "$PART1" in
\#*)
- echo "comment"
;;
"")
;;
@@ -132,10 +135,9 @@ confirm_action(){
MESSAGE=$2
if [ "$NO_PROMPTS" != "YES" ]
then
- echo -n "$MESSAGE [$ANSWER] use 'none' to clear ? " > /dev/tty
+ echo -n "$MESSAGE [$ANSWER] " > /dev/tty
read result
[ "$result" != "" ] && ANSWER=$result
- [ "$result" = "none" ] && ANSWER=""
fi
ANSWER=`eval "echo $ANSWER"`
@@ -180,8 +182,23 @@ loadconfig () {
SECTUNIT=`confirm_action "$SECTUNIT" "512 byte sectors per unit?"`
TRACKCYL=`confirm_action "$TRACKCYL" "Tracks per cylinder?"`
SECTRACK=`confirm_action "$SECTRACK" "Sectors per track?"`
- CONF=`confirm_action "$CONF" "Configuration name?"`
- MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT?"`
+ while :
+ do
+ echo "The following configurations exist:"
+ ls -l conf|awk '/^d/{print " ",$9}'|grep -v CVS
+ CONF=`confirm_action "$CONF" "Configuration name?"`
+ if [ ! -d "${CURRENTDIR}/conf/$CONF" ]
+ then
+ echo "${TS} Error: Could not find config (${CONF})"
+ if [ "$NO_PROMPTS" = "YES" ]
+ then
+ exit 1
+ fi
+ else
+ break
+ fi
+ done
+ MFSROOT=`confirm_action "$MFSROOT" "Use an MFSROOT? (YES/NO)"`
IMG=`confirm_action "$IMG" "Image file to generate?"`
# example of formatted value (NNN in this case)
@@ -213,13 +230,6 @@ saveconfig () {
) >${FULLFILENAME}
}
-check_conf() {
- if [ ${CONF} = 'default' ]
- then
- echo "${TS} Alternative conf name not set; defaulting to 'default'"
- fi
-}
-
check_alt_imgname() {
if [ ${IMG} = 'tinybsd.bin' ]
then
@@ -440,7 +450,6 @@ saveconfig
(
# Do the build
prework
- check_conf
check_alt_imgname
create_tree
copy_binaries
OpenPOWER on IntegriCloud