summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2005-07-23 18:47:18 +0000
committerdougb <dougb@FreeBSD.org>2005-07-23 18:47:18 +0000
commit3c6d812560d8665f46eff09d8279fec68f45e144 (patch)
tree3ea98ffe351e39808bc202959774200de83bd655
parentebe5e23d162b47e9cff4ec9dbfc71a49e6802447 (diff)
downloadFreeBSD-src-3c6d812560d8665f46eff09d8279fec68f45e144.zip
FreeBSD-src-3c6d812560d8665f46eff09d8279fec68f45e144.tar.gz
(More thoroughly) fix the problem with the EGREP lines that was reported
on -current by Ben Kaduk <minimarmot@gmail.com>. Add a hack of my own to allow the user to supply the paths to the INF and SYS files on the command line.
-rw-r--r--usr.sbin/ndiscvt/ndisgen.88
-rw-r--r--usr.sbin/ndiscvt/ndisgen.sh63
2 files changed, 45 insertions, 26 deletions
diff --git a/usr.sbin/ndiscvt/ndisgen.8 b/usr.sbin/ndiscvt/ndisgen.8
index c9b185a..c293b67 100644
--- a/usr.sbin/ndiscvt/ndisgen.8
+++ b/usr.sbin/ndiscvt/ndisgen.8
@@ -40,6 +40,7 @@
NDIS driver distribution
.Sh SYNOPSIS
.Nm
+.Op Ar /path/to/INF /path/to/SYS
.Sh DESCRIPTION
The
.Nm
@@ -57,13 +58,16 @@ compatibility module.
The
.Nm
script is interactive and contains its own help section.
-The script will prompt the user for the
+Unless the paths to both files are supplied on the command line,
+the script will prompt the user for the
.Pa .INF
and
.Pa .SYS
-files (and any firmware or other external files) needed to generate the
+files needed to generate the
.Fx
driver module.
+The script will also prompt for
+any firmware or other external files needed.
.Sh SEE ALSO
.Xr ld 1 ,
.Xr objcopy 1 ,
diff --git a/usr.sbin/ndiscvt/ndisgen.sh b/usr.sbin/ndiscvt/ndisgen.sh
index c8682a6..6de8fe6 100644
--- a/usr.sbin/ndiscvt/ndisgen.sh
+++ b/usr.sbin/ndiscvt/ndisgen.sh
@@ -187,16 +187,20 @@ return
infconv () {
header
echo " INF file validation"
-echo ""
-echo ""
-echo " A .INF file is most often provided as an ASCII file, however"
-echo " files with multilanguage support are provided in Unicode format."
-echo " Please type in the path to your .INF file now."
-echo ""
-echo -n " > "
-read INFPATH
+
+if [ -z "$INFPATH" ]; then
+ echo ""
+ echo ""
+ echo " A .INF file is most often provided as an ASCII file, however"
+ echo " files with multilanguage support are provided in Unicode format."
+ echo " Please type in the path to your .INF file now."
+ echo ""
+ echo -n " > "
+ read INFPATH
+fi
+
if [ ${INFPATH} ] && [ -e ${INFPATH} ]; then
- INFTYPE=`${EGREP} -i -c "^Signature|^.S.i.g.n.a.t.u.r.e" ${INFPATH}`
+ INFTYPE=`${EGREP} -i -c "Signature|.S.i.g.n.a.t.u.r.e" ${INFPATH}`
if [ ${INFTYPE} -le 0 ]; then
echo ""
echo " I don't recognize this file format. It may not be a valid .INF file."
@@ -207,7 +211,7 @@ if [ ${INFPATH} ] && [ -e ${INFPATH} ]; then
return
fi
- INFTYPE=`${EGREP} -i -c "^Class.*=.*Net" ${INFPATH}`
+ INFTYPE=`${EGREP} -i -c "Class.*=.*Net" ${INFPATH}`
if [ ${INFTYPE} -gt 0 ]; then
echo ""
echo " This .INF file appears to be ASCII."
@@ -217,7 +221,7 @@ if [ ${INFPATH} ] && [ -e ${INFPATH} ]; then
return
fi
- INFTYPE=`${EGREP} -i -c "^.C.l.a.s.s.*=.*N.e.t" ${INFPATH}`
+ INFTYPE=`${EGREP} -i -c ".C.l.a.s.s.*=.*N.e.t" ${INFPATH}`
if [ ${INFTYPE} -gt 0 ]; then
echo ""
echo " This .INF file appears to be Unicode."
@@ -259,19 +263,23 @@ return
sysconv() {
header
echo " Driver file validation"
-echo ""
-echo ""
-echo " Now you need to specify the name of the Windows(r) driver .SYS"
-echo " file for your device. Note that if you are running FreeBSD/amd64,"
-echo " then you must provide a driver that has been compiled for the"
-echo " 64-bit Windows(r) platform. If a 64-bit driver is not available"
-echo " for your device, you must install FreeBSD/i386 and use the"
-echo " 32-bit driver instead."
-echo ""
-echo " Please type in the path to the Windows(r) driver .SYS file now."
-echo ""
-echo -n " > "
-read SYSPATH
+
+if [ ! -r "$SYSPATH" ]; then
+ echo ""
+ echo ""
+ echo " Now you need to specify the name of the Windows(r) driver .SYS"
+ echo " file for your device. Note that if you are running FreeBSD/amd64,"
+ echo " then you must provide a driver that has been compiled for the"
+ echo " 64-bit Windows(r) platform. If a 64-bit driver is not available"
+ echo " for your device, you must install FreeBSD/i386 and use the"
+ echo " 32-bit driver instead."
+ echo ""
+ echo " Please type in the path to the Windows(r) driver .SYS file now."
+ echo ""
+ echo -n " > "
+ read SYSPATH
+fi
+
if [ ${SYSPATH} ] && [ -e ${SYSPATH} ]; then
SYSTYPE=`${FILE} ${SYSPATH}`
@@ -510,6 +518,13 @@ SYSPATH=""
SYSBASE=""
FRMBASE=""
+if [ -r "$1" -a -r "$2" ]; then
+ # Looks like the user supplied .INF and .SYS files on the command line
+ INFPATH=$1
+ SYSPATH=$2
+ convert_driver && exit 0
+fi
+
while : ; do
mainmenu
case ${KEYPRESS} in
OpenPOWER on IntegriCloud