Two trivial patches

Joshua Kwan joshk
Thu Feb 6 22:26:05 PST 2003


A lazy Thursday night.. so..

Attached are the following two diffs that work against latest CVS. 
They are mostly quite trivial:

makefile_2.5_target.patch
	Adds a '2.5' target and '2.5_install' target to the Makefile.
	a lot more useful imho than telling the end user the commands to 
	input :)

utils_ignore.patch
	A .cvsignore for utils/. Just being anal.

I think the 2.5 one makes the package considerably more useful for 
people who live on the edge like me :)

Regards,
Josh

-- 
New PGP public key: 0x27AFC3EE
(doesn't expire, yay)
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /cvs/hostap/Makefile,v
retrieving revision 1.33
diff -u -r1.33 Makefile
--- Makefile	19 Jan 2003 02:12:36 -0000	1.33
+++ Makefile	7 Feb 2003 06:21:33 -0000
@@ -30,6 +30,7 @@
 MODPATH_CS := $(MODPATH)/pcmcia
 MODPATH_PLX := $(MODPATH)/net
 MODPATH_PCI := $(MODPATH)/net
+CURRENTKV := $(shell echo `uname -r`)
 
 MSRC=driver/modules
 
@@ -41,10 +42,7 @@
 	@echo "make pci         Prism 2.5 PCI Card"
 	@echo "make crypt       Make hostap_crypt*.o"
 	@echo "make hostap      Make hostap.o"
-	@echo
-	@echo "Linux 2.5.x kbuild:"
-	@echo 'make -C /usr/src/linux SUBDIRS=$$PWD/driver/modules modules'
-	@echo 'make -C /usr/src/linux SUBDIRS=$$PWD/driver/modules modules_install'
+	@echo "make 2.5	 Make all modules for kernel 2.5"
 
 
 include $(KERNEL_PATH)/.config
@@ -113,6 +111,13 @@
 .c.o:
 	$(CC) $(INCLUDES) $(INCLUDES_MODVER) $(CFLAGS) -o $@ $<
 
+2.5:
+	@if [ ! "$(shell echo $(KERNELRELEASE) | grep 2.5 | wc -l)" -eq "1" ]; then \
+		echo "*** Can't build for 2.5 with a 2.4 source!"; \
+		exit 1; \
+	fi
+	make -C $(KERNEL_PATH) SUBDIRS=$(PWD)/driver/modules modules
+	make 2.5_install_info
 
 pccard:	$(MSRC)/$(MODULE_CS) hostap crypt install_info
 plx:	$(MSRC)/$(MODULE_PLX) hostap crypt install_info
@@ -144,23 +149,38 @@
 
 install_info:
 	@echo
-	@echo "Run 'make install_pccard' as a root to install $(MODULE_CS)"
-	@echo "Run 'make install_plx' as a root to install $(MODULE_PLX)"
-	@echo "Run 'make install_pci' as a root to install $(MODULE_PCI)"
+	@echo "Run 'make install_pccard' as root to install $(MODULE_CS)"
+	@echo "Run 'make install_plx' as root to install $(MODULE_PLX)"
+	@echo "Run 'make install_pci' as root to install $(MODULE_PCI)"
 	@echo
 
+2.5_install_info:
+	@echo "*** Become superuser and 'make install_2.5' to install the modules. ***" 
+
+
 install: install_info
 
 install_check:
 	@if [ ! -d "$(MODPATH)" ]; then \
-		echo "Module installation directory not valid: '$(MODPATH)'"; \
-		echo -n "Most probable cause for this is modified kernel "; \
+		echo "Module installation directory not valid: '$(MODPATH)'"; \		echo -n "Most probable cause for this is modified kernel "; \
 		echo "headers."; \
 		echo -n "You will need to install module file "; \
-		echo "($(MSRC)/hostap_*.o) manually."; \
+		echo "($(MSRC)/hostap_*.[k]o) manually."; \
 		exit 1; \
 	fi
 
+install_2.5:
+	make install_check
+	@echo "*** Copying modules to: $(MODPATH)/kernel/drivers/net/wireless"
+	mkdir -p $(MODPATH)/kernel/drivers/net/wireless
+	cp $(MSRC)/*.ko $(MODPATH)/kernel/drivers/net/wireless
+	@if [ -f "/boot/System.map-$(KERNELRELEASE)" ] || [ "$(CURRENTKV)" = "$(KERNELRELEASE)" ]; then \
+		echo "*** Running depmod..."; \
+		/sbin/depmod -ae; \
+	else \
+		echo "*** I won't run depmod because I can't find an appropriate System.map file or you are not running the same kernel as the one you are building against. Please run it manually when the conditions are correct..."; \
+	fi
+
 install_hostap: $(MSRC)/hostap.o
 	@echo "Installing hostap.o to $(MODPATH_PCI)"
 	mkdir -p $(MODPATH_PCI)
@@ -204,3 +224,4 @@
 	rm -f $(MSRC)/{hostap.o,hostap_crypt.o,hostap_crypt_wep.o}
 	rm -f $(MSRC)/*.ko
 	rm -f $(MSRC)/*.ver
+	rm -f $(MSRC)/.hostap*.cmd
-------------- next part --------------
--- /dev/null	2002-12-28 17:06:03.000000000 -0800
+++ utils/.cvsignore	2003-02-06 21:15:09.000000000 -0800
@@ -0,0 +1,4 @@
+.cvsignore
+hostap_crypt_conf
+hostap_diag
+prism2_srec
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.shmoo.com/pipermail/hostap/attachments/20030206/eabf58b5/attachment.pgp 



More information about the Hostap mailing list