Patch: modules-1.3.69h (the minimum, imho)

Peter Berger (pberger@linux01.gwdg.de)
Sat, 11 May 1996 11:04:16 +0200 (MET DST)


Hi,

well, this is the minimum I'd apply to modules-1.3.69h.

diff -uNr modules-1.3.69h.orig/Makefile modules-1.3.69h/Makefile
--- modules-1.3.69h.orig/Makefile Mon Apr 15 08:08:58 1996
+++ modules-1.3.69h/Makefile Sat May 11 10:53:12 1996
@@ -1,4 +1,4 @@
-REL=1.3.69g
+REL=1.3.69h

SUBDIRS=insmod genksyms depmod kerneld

diff -uNr modules-1.3.69h.orig/depmod/Makefile modules-1.3.69h/depmod/Makefile
--- modules-1.3.69h.orig/depmod/Makefile Mon May 6 01:48:47 1996
+++ modules-1.3.69h/depmod/Makefile Sat May 11 10:52:13 1996
@@ -1,8 +1,8 @@
-SBIN=/sbin
+SBINDIR=$(prefix)/sbin
OBJS = error.o module.o symbol.o alloctxt.o str.o \
config.o fgets.o load_obj.o
MAINS = main.o depmod.o modprobe.o
-MAN1DIR=/usr/man/man1
+MAN1DIR=$(prefix)/usr/man/man1
MANS1=depmod.1

.SUFFIXES: .o .obt
@@ -26,17 +26,17 @@

.c.o:
@echo $<
- @g++ -O -I. $(DEFINES) -Wall -c $< -o $@
+ g++ -O -I. $(DEFINES) -Wall -c $< -o $@

# To compile small tests at the end of source files
.c.obt:
@echo $< '->' $@
- @g++ -DTEST -g -I. $(DEFINES) -Wall -c $< -o $@
+ g++ -DTEST -g -I. $(DEFINES) -Wall -c $< -o $@

all: modprobe depmod

modprobe: $(MAINS) $(OBJS)
- cc -s -o modprobe $(MAINS) $(OBJS) $(LIBS)
+ $(CC) -s -o modprobe $(MAINS) $(OBJS) $(LIBS)

depmod: modprobe
ln -fs modprobe depmod
@@ -52,12 +52,14 @@
rm -f depmod modprobe

install-binaries: all
- install --strip -m 755 -o bin -g bin modprobe $(SBIN)/modprobe
- ln -fs $(SBIN)/modprobe $(SBIN)/depmod
+ install -d -o root -g root -m 0755 $(SBINDIR)
+ install --strip -m 755 -o bin -g bin modprobe $(SBINDIR)/modprobe
+ ln -fs $(SBINDIR)/modprobe $(SBINDIR)/depmod

install-docs:
+ @set -x ;install -d -o root -g root -m 0755 $(MAN1DIR)
@set -x ;for i in $(MANS1) ; do install -c $$i $(MAN1DIR) ; done
- ln -f $(MAN1DIR)/depmod.1 $(MAN1DIR)/modprobe.1
+ ln -sf depmod.1 $(MAN1DIR)/modprobe.1

install: install-binaries install-docs

@@ -66,5 +68,5 @@

# Tests
config: config.obt
- gcc -g -o x config.obt lib.a
+ $(CC) -g -o x config.obt lib.a

diff -uNr modules-1.3.69h.orig/genksyms/Makefile modules-1.3.69h/genksyms/Makefile
--- modules-1.3.69h.orig/genksyms/Makefile Mon Mar 11 07:41:13 1996
+++ modules-1.3.69h/genksyms/Makefile Sat May 11 10:51:46 1996
@@ -6,7 +6,8 @@
# You might want to enable this define depending on your flex. See parsesym.c
#YYTEXT_PTR= -DYYTEXT_PTR

-BINDIR = /sbin
+BINDIR = $(prefix)/sbin
+MAN8DIR = $(prefix)/usr/man/man8
KSYMS = /usr/src/linux/kernel/ksyms.c
TESTDEFS = -D__KERNEL__ -D__GENKSYMS__ -DCONFIG_MODVERSIONS -I/usr/src/linux/include

@@ -30,10 +31,12 @@
./makecrc32 > crc32.tab

install-binaries: genksyms
+ @install -d $(BINDIR)
install -c -s genksyms $(BINDIR)

install-docs:
- install -m 644 genksyms.8 /usr/man/man8
+ @install -d $(MAN8DIR)
+ install -m 644 genksyms.8 $(MAN8DIR)

install: install-binaries install-docs

@@ -42,17 +45,17 @@
rm -f makecrc32 genksyms

test: genksyms
- gcc -E $(TESTDEFS) $(KSYMS) | ./genksyms VERSIONHEADERS
+ $(CC) -E $(TESTDEFS) $(KSYMS) | ./genksyms VERSIONHEADERS
@echo "If the test failed, check LFLAGS and/or YYTEXT_PTR in the Makefile"

testall: genksyms
- gcc -E $(TESTDEFS) /usr/src/linux/kernel/*.c | ./genksyms VERSIONHEADERS
+ $(CC) -E $(TESTDEFS) /usr/src/linux/kernel/*.c | ./genksyms VERSIONHEADERS

dump: genksyms
- gcc -E $(TESTDEFS) $(KSYMS) | ./genksyms -D > check_dump
+ $(CC) -E $(TESTDEFS) $(KSYMS) | ./genksyms -D > check_dump

debug: genksyms
- gcc -E $(TESTDEFS) $(KSYMS) | ./genksyms -dd > check_debug
+ $(CC) -E $(TESTDEFS) $(KSYMS) | ./genksyms -dd > check_debug

input:
- gcc -E $(TESTDEFS) $(KSYMS) > check_input
+ $(CC) -E $(TESTDEFS) $(KSYMS) > check_input
diff -uNr modules-1.3.69h.orig/insmod/Makefile modules-1.3.69h/insmod/Makefile
--- modules-1.3.69h.orig/insmod/Makefile Fri May 10 15:04:01 1996
+++ modules-1.3.69h/insmod/Makefile Sat May 11 10:56:11 1996
@@ -9,10 +9,10 @@
ifdef PERSIST
LDFLAGS = -lgdbm
else
-LDFLAGS = -N
+LDFLAGS = -s # -N
endif
CC=gcc
-BINDIR=/sbin
+BINDIR=$(prefix)/sbin
MODCFLAGS := $(CFLAGS) -DMODULE -D__KERNEL__ -DLINUX

# If block device 42 is in use, change the definition below:
@@ -23,8 +23,8 @@

MANS1=insmod.1 ksyms.1 lsmod.1 rmmod.1
MANS2=modules.2
-MAN1DIR=/usr/man/man1
-MAN2DIR=/usr/man/man2
+MAN1DIR=$(prefix)/usr/man/man1
+MAN2DIR=$(prefix)/usr/man/man2

all: $(PROGS) links

@@ -57,11 +57,13 @@
rm -f *.o $(PROGS) $(INSMOD_LINKS) /dev/hw

install-binaries: $(PROGS)
+ @set -x ;install -d -o root -g root -m 0755 $(BINDIR)
@set -x ;for i in $(PROGS) ; do install -s -c $$i $(BINDIR) 2>/dev/null ; done
@set -x ;(cd $(BINDIR);for i in $(INSMOD_LINKS) ; do ln -sf insmod $$i; done)
@echo "Have you read the README? Things might have changed..."

install-docs:
+ @set -x ;install -d -o root -g root -m 0755 $(MAN1DIR) $(MAN2DIR)
@set -x ;for i in $(MANS1) ; do install -m 644 -c $$i $(MAN1DIR) ; done
@set -x ;for i in $(MANS2) ; do install -m 644 -c $$i $(MAN2DIR) ; done

diff -uNr modules-1.3.69h.orig/kerneld/GOODIES/Makefile modules-1.3.69h/kerneld/GOODIES/Makefile
--- modules-1.3.69h.orig/kerneld/GOODIES/Makefile Mon Mar 11 07:45:27 1996
+++ modules-1.3.69h/kerneld/GOODIES/Makefile Sat May 11 10:50:01 1996
@@ -1,7 +1,9 @@
+SBINDIR=$(prefix)/sbin
CFLAGS = -O2 -pipe -fomit-frame-pointer -Wall $(DEBUG) $(XTRA)

first: kdsound

install: kdsound
- install -m 0700 -o root kdsound /sbin/kdsound
- install -m 0700 -o root do_sound /sbin/do_sound
+ install -d -o root -g root -m 0755 $(SBINDIR)
+ install -m 0700 -o root kdsound $(SBINDIR)/kdsound
+ install -m 0700 -o root do_sound $(SBINDIR)/do_sound
diff -uNr modules-1.3.69h.orig/kerneld/GOODIES/Makefile~ modules-1.3.69h/kerneld/GOODIES/Makefile~
--- modules-1.3.69h.orig/kerneld/GOODIES/Makefile~ Thu Jan 1 01:00:00 1970
+++ modules-1.3.69h/kerneld/GOODIES/Makefile~ Mon Mar 11 07:45:27 1996
@@ -0,0 +1,7 @@
+CFLAGS = -O2 -pipe -fomit-frame-pointer -Wall $(DEBUG) $(XTRA)
+
+first: kdsound
+
+install: kdsound
+ install -m 0700 -o root kdsound /sbin/kdsound
+ install -m 0700 -o root do_sound /sbin/do_sound
diff -uNr modules-1.3.69h.orig/kerneld/Makefile modules-1.3.69h/kerneld/Makefile
--- modules-1.3.69h.orig/kerneld/Makefile Thu May 9 16:48:16 1996
+++ modules-1.3.69h/kerneld/Makefile Sat May 11 10:52:15 1996
@@ -13,8 +13,8 @@
# module storage, remove the comment marker ('#') before the line below
#NO_GDBM=-DNO_GDBM

-
-MANDIR=/usr/man/man8
+SBINDIR=$(prefix)/sbin
+MAN8DIR=$(prefix)/usr/man/man8
CFLAGS = -O6 -pipe -fomit-frame-pointer -Wall $(DEBUG) $(XTRA) $(NO_GDBM)
ifdef NO_GDBM
LDFLAGS = -s
@@ -29,14 +29,16 @@
all: $(PROGS)

install-binaries: all
- @set -x; for i in $(PROGS); do install -m 0700 -o root -s -c $$i /sbin; done
+ @set -x; install -d -o root -g root -m 0755 $(SBINDIR)
+ @set -x; for i in $(PROGS); do install -m 0700 -o root -s -c $$i $(SBINDIR); done
@echo "Do 'make install-scripts' in the kerneld directory to get a default /sbin/request-route"

install-scripts:
- install -m 0700 -o root request-route.sh /sbin/request-route
+ install -m 0700 -o root request-route.sh $(SBINDIR)/request-route

install-docs:
- install -c kerneld.8 $(MANDIR)
+ install -d -o root -g root -m 0755 $(MAN8DIR)
+ install -c kerneld.8 $(MAN8DIR)

install: install-binaries install-docs

@@ -49,7 +51,8 @@
utils: all $(UTILS)

install_utils: utils
- @set -x; for i in $(UTILS); do install -m 0700 -o root -s -c $$i /sbin; done
+ @set -x; install -d -o root -g root -m 0755 $(SBINDIR)
+ @set -x; for i in $(UTILS); do install -m 0700 -o root -s -c $$i $(SBINDIR); done

clean:
rm -f $(PROGS) $(TESTPROGS) $(UTILS) *.o .depend
@@ -58,7 +61,7 @@
$(CPP) -M $(SRCS) > .depend

check_persist.o: check_persist.c
- cc -O -Wall -DMODULE -D__KERNEL__ -c check_persist.c
+ $(CC) -O -Wall -DMODULE -D__KERNEL__ -c check_persist.c

# include a dependency file if one exists

bye,
Peter