diff options
author | Doug Barton <dougb@FreeBSD.org> | 2005-07-23 18:47:18 +0000 |
---|---|---|
committer | Doug Barton <dougb@FreeBSD.org> | 2005-07-23 18:47:18 +0000 |
commit | a2412a091eca44870bfbcc1a907fa911ef25f22e (patch) | |
tree | 3ea98ffe351e39808bc202959774200de83bd655 /usr.sbin/ndiscvt | |
parent | f92c1adc15fab7522a6300a9fb73254b8694e58e (diff) | |
download | src-a2412a091eca44870bfbcc1a907fa911ef25f22e.tar.gz src-a2412a091eca44870bfbcc1a907fa911ef25f22e.zip |
(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.
Notes
Notes:
svn path=/head/; revision=148350
Diffstat (limited to 'usr.sbin/ndiscvt')
-rw-r--r-- | usr.sbin/ndiscvt/ndisgen.8 | 8 | ||||
-rw-r--r-- | usr.sbin/ndiscvt/ndisgen.sh | 63 |
2 files changed, 45 insertions, 26 deletions
diff --git a/usr.sbin/ndiscvt/ndisgen.8 b/usr.sbin/ndiscvt/ndisgen.8 index c9b185a20d1e..c293b6723d62 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 c8682a6c8d48..6de8fe6af9a2 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 |