I will commit this, but also add an option to select the firmware dir on 
runtime.
(and I have some code for more advanced cmdline arg parsing, too)

On Wednesday 30 November 2005 17:54, Kristian Benoit wrote:
> Index: fwcutter.c
> ===================================================================
> --- fwcutter.c  (revision 754)
> +++ fwcutter.c  (working copy)
> @@ -323,7 +323,7 @@
>         printf("\nUsage: %s [OPTION] [driver.sys]\n", argv[0]);
>         printf("  -l             List supported driver versions\n");
>         printf("  -i DRIVER.SYS  Identify a driver file (don't extract)\n");
> -       printf("  -w DRIVER.SYS  Extract and write firmware to 
> /lib/firmware\n");
> +       printf("  -w DRIVER.SYS  Extract and write firmware to " FIRMWARE_DIR 
> "\n");
>         printf("  -p \".FOO\"      Postfix for firmware filenames 
> (.FOO.fw)\n");
>         printf("  -v             Print fwcutter version\n");
>         printf("  -h|--help      Print this help\n");
> @@ -399,7 +399,7 @@
>                                 printf("-w needs a parameter\n");
>                                 return -1;
>                         }
> -                       target_dir = "/lib/firmware";
> +                       target_dir = FIRMWARE_DIR;
>                         cmdargs.infile = next_arg;
>                 } else if (cmp_arg(arg, "-p", &param) == 0) {
>                         if (param)
> Index: Makefile
> ===================================================================
> --- Makefile    (revision 754)
> +++ Makefile    (working copy)
> @@ -5,10 +5,11 @@
>  CFLAGS = -std=c99 -O2 -fomit-frame-pointer -Wall -pedantic -D_BSD_SOURCE
>  LDFLAGS =
> 
> +FIRMWARE_DIR ?= /lib/firmware
> 
>  OBJECTS = fwcutter.o md5.o
> 
> -CFLAGS += -DFWCUTTER_VERSION_=$(VERSION)
> +CFLAGS += -DFWCUTTER_VERSION_=$(VERSION) -DFIRMWARE_DIR=\"$(FIRMWARE_DIR)\"
> 
>  all: fwcutter
> 
> @@ -22,8 +23,8 @@
>         -rm -f *~ *.o *.orig *.rej *.fw fwcutter
> 
>  installfw:
> -       -if ! [ -d /lib/firmware ]; then mkdir /lib/firmware; fi
> -       -install -o 0 -g 0 -m 600 bcm430x_*.fw /lib/firmware/
> +       -if ! [ -d $(FIRMWARE_DIR) ]; then mkdir $(FIRMWARE_DIR); fi
> +       -install -o 0 -g 0 -m 600 bcm430x_*.fw $(FIRMWARE_DIR)
> 
>  # dependencies
>  fwcutter.o: md5.h fwcutter_list.h
> 
> _______________________________________________
> Bcm43xx-dev mailing list
> [email protected]
> http://lists.berlios.de/mailman/listinfo/bcm43xx-dev
> 
> 

-- 
Greetings Michael.

Attachment: pgpH6tmYRLtv8.pgp
Description: PGP signature

Reply via email to