--- Makefile.in.orig	Thu Oct  2 12:45:36 2003
+++ Makefile.in	Thu Oct  2 12:50:40 2003
@@ -16,12 +16,12 @@
 LN            = ln -sf
 ROOTDIR       =
 SUPER_OWNER   = root
-BIN_OWNER     = bin
-BIN_GROUP     = bin
+BIN_OWNER     = root
+BIN_GROUP     = root
 DEF_SUID_MODE = 4511
-DEF_BIN_MODE = 555
-DEF_SBIN_MODE = 555
-DEF_MAN_MODE  = 444
+DEF_BIN_MODE = 755
+DEF_SBIN_MODE = 755
+DEF_MAN_MODE  = 644
 DEF_CONF_MODE = 644
 RPCGEN        = rpcgen
 
@@ -99,6 +99,9 @@
 	-$(INSTALL) -m $(DEF_MAN_MODE) *.2 $(ROOTDIR)$(mandir)/man2
 	-$(INSTALL) -m $(DEF_MAN_MODE) *.3 $(ROOTDIR)$(mandir)/man3
 	-$(INSTALL) -m $(DEF_MAN_MODE) *.8 $(ROOTDIR)$(mandir)/man8
+	-$(INSTALL) -m 644  rc.config $(ROOTDIR)/var/adm/fillup-templates/rc.config.quota
+	-$(INSTALL) -m 755 -o $(BIN_OWNER) -g $(BIN_GROUP) rc1 $(ROOTDIR)/etc/init.d/quota
+	-$(INSTALL) -m 755 -o $(BIN_OWNER) -g $(BIN_GROUP) rc2 $(ROOTDIR)/etc/init.d/quotad
 
 quotaon: quotaon.o quotaon_xfs.o $(LIBOBJS)
 
--- quotacheck.c.orig	Thu Oct  2 12:53:22 2003
+++ quotacheck.c	Thu Oct  2 12:53:40 2003
@@ -45,6 +45,10 @@
 typedef ino_t ext2_ino_t;
 #endif
 
+#ifdef __powerpc__
+typedef unsigned short umode_t;
+#endif;
+
 #define LINKSHASHSIZE 16384	/* Size of hashtable for hardlinked inodes */
 #define DQUOTHASHSIZE 32768	/* Size of hashtable for dquots from file */
 
--- README.SuSE
+++ README.SuSE
@@ -0,0 +1,42 @@
+Quota Utilities for SuSE Linux
+
+Quota Support has been added to SuSE Linux via several
+Startup Scripts (/etc/init.d/quota, /etc/init.d/quotad, /etc/init.d/boot).
+
+For using Quota Support:
+
+  1. Use a kernel with Quota support enabled (our standard kernels
+     have quota support enabled by default)
+
+  2. Decide which partitions should have quota support
+     and change /etc/fstab accordingly, i.e. add the usrquota
+     and/or grpquota flags, e.g.
+
+/dev/sda1       /                         ext2            defaults   1   1
+/dev/sda6       /tmp                      ext2            defaults,usrquota   1   2
+/dev/sda3       swap                      swap            defaults   0   0
+/dev/sda7       /usr                      ext2            defaults   1   2
+
+/dev/scd0       /cdrom                    iso9660         ro,noauto,user 0   0
+
+none            /proc                     proc            defaults   0   0
+
+     I have have thus enabled user quotas on /tmp
+
+  3. Initialize Quotas for the first time by invoking
+     quotacheck -avug
+
+  4. set START_QUOTA=yes in /etc/rc.config
+
+  5. quotacheck is only called if an unclean shutdown has
+     taken place (e.g. at times when fsck is run by /sbin/init.d/boot
+
+     So if you think your quota-files are corrupted or you
+     moved changed files with quotas being off you have to rebuild
+     the quota database manually by invoking
+     quotacheck -avug
+  
+  6. if you also start the NFS-Server, rpc.rquotad is started 
+     automatically for you
+
+have fun
--- rc.config
+++ rc.config
@@ -0,0 +1,5 @@
+#
+# Turn on quotas? (yes/no)
+#
+START_QUOTA="no"
+
--- rc1
+++ rc1
@@ -0,0 +1,92 @@
+#! /bin/sh
+# Copyright (c) 1998, 1999 SuSE GmbH Nürnberg, Germany.  All rights reserved.
+#
+# Author:
+# A. Gebhardt <albrecht.gebhardt@uni-klu.ac.at>
+# Tilman Mueller-Gerbes <tmg@suse.de>
+# Thorsten kukuk <kukuk@suse.de>
+# Petr Blaha <pblaha@suse.de>
+# /etc/init.d/quota
+#
+### BEGIN INIT INFO
+# Provides: quota
+# Required-Start: $network $remote_fs portmap
+# Required-Stop: $network
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
+# Description: Turn quota on.
+### END INIT INFO
+
+# Source SuSE config
+. /etc/rc.config
+
+base=${0##*/}
+link=${base#*[SK][0-9][0-9]}
+
+test $link = $base && START_QUOTA=yes
+test "$START_QUOTA" = yes || exit 0
+
+
+QUOTAON_BIN=/usr/sbin/quotaon 
+test -x $QUOTAON_BIN || exit 5
+
+QUOTAOFF_BIN=/usr/sbin/quotaoff
+test -x $QUOTAOFF_BIN || exit 5
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_failed        set local and overall rc status to failed
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0 - success
+# 1 - misc error
+# 2 - invalid or excess args
+# 3 - unimplemented feature (e.g. reload)
+# 4 - insufficient privilege
+# 5 - program not installed
+# 6 - program not configured
+# 7 - program is not running
+# 
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signalling is not supported) are
+# considered a success.
+
+
+case "$1" in
+    start)
+        echo -n  "Turning on quota:"
+        $QUOTAON_BIN -avug 
+	rc_status -v 
+	;;
+    stop)
+        echo "Turning off quota:"
+        $QUOTAOFF_BIN -avug 
+	rc_status -v
+        ;;
+    restart)
+	## Stop the service and regardless of whether it was
+	## running or not, start it again.
+	$0 stop
+	$0 start
+	# Remember status and be quiet
+	rc_status
+        ;;
+    reload)
+        exit 3 
+        ;;
+    *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+esac
+
+rc_exit
--- rc2
+++ rc2
@@ -0,0 +1,100 @@
+#! /bin/sh
+# Copyright (c) 1996, 1999 SuSE GmbH Nuernberg, Germany.  All rights reserved.
+#
+# Author:
+# A. Gebhardt <albrecht.gebhardt@uni-klu.ac.at>
+# Thorsten Kukuk <kukuk@suse.de>
+# Petr Blaha <pblaha@suse.de>
+# /etc/init.d/quota
+#
+### BEGIN INIT INFO
+# Provides: quotad
+# Required-Start: $network $remote_fs portmap quota
+# Required-Stop: $network
+# Default-Start:  3 5
+# Default-Stop: 0 1 2 6
+# Description: Start the quota daemon.
+### END INIT INFO
+
+# Source SuSE config
+. /etc/rc.config
+
+base=${0##*/}
+link=${base#*[SK][0-9][0-9]}
+
+test $link = $base && START_QUOTA=yes
+test "$START_PORTMAP" = yes -a "$NFS_SERVER" = yes \
+     -a "$START_QUOTA" = yes || exit 0
+
+RQUOTAD_BIN=/usr/sbin/rpc.rquotad
+test -x $QUOTAON_BIN || exit 5
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_failed        set local and overall rc status to failed
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0 - success
+# 1 - misc error
+# 2 - invalid or excess args
+# 3 - unimplemented feature (e.g. reload)
+# 4 - insufficient privilege
+# 5 - program not installed
+# 6 - program not configured
+# 7 - program is not running
+# 
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signalling is not supported) are
+# considered a success.
+
+
+
+case "$1" in
+    start)
+        echo -n "Starting rquota daemon"
+        startproc $RQUOTAD_BIN 
+	rc_status -v
+	;;
+    stop)
+        echo -n "Stopping rquota daemon"
+        killproc -TERM   $RQUOTAD_BIN
+	rc_status -v
+	;;
+    restart)
+        ## Stop the service and regardless of whether it was
+        ## running or not, start it again.
+        $0 stop
+        $0 start
+
+        # Remember status and be quiet
+        rc_status
+	;;
+    reload)
+        exit 3
+        ;;
+    status)
+        echo -n "Checking for rquota daemon: "
+	checkproc $RQUOTAD_BIN; rc=$?
+	if test $rc = 0; then echo "OK"
+	else echo "No process" 
+		if test -e /var/run/rpc.rquotad.pid;
+		then exit 1
+		else exit 3
+		fi
+	fi
+        ;;
+    *)
+	echo "Usage: $0 {start|stop|restart|reload|status}"
+	exit 1
+esac
+rc_exit
