Call for testing for 3.6: AIX package builder update

Darren Tucker dtucker at zip.com.au
Fri Mar 7 17:38:40 EST 2003


Hi All.

Ben Lindstrom wrote:
> So if you have any patches you need to ensure your platform works speak
> up.  We are looking at a lock on the 17th.

The attached patch updates the AIX package builder in contrib/aix.  The
patch has been on my page (minus the typo fixes) for a while and I've
been using it here so it's relatively well tested.

The changes relative to 3.5p1 are:

* Adds optional SRC support, based on examples provided by Sandor Sklar
and Maarten Kreuger.
* Creates size lpp control file: installp should now expand filesystems
if required. 
* Writes ssh entry in /etc/rc.tcpip to match system-provided services.
* Ensure correct permissions on new /etc/rc.tcpip 
* Update readme & fix typos 

Please review and apply if OK.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG Fingerprint D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
-------------- next part --------------
? config.local
Index: contrib/aix/README
===================================================================
RCS file: /cvs/openssh/contrib/aix/README,v
retrieving revision 1.2
diff -u -r1.2 README
--- contrib/aix/README	25 Jun 2002 23:38:48 -0000	1.2
+++ contrib/aix/README	7 Mar 2003 06:14:00 -0000
@@ -6,9 +6,15 @@
 
 Directions:
 
+(optional) create config.local in your build dir
 ./configure [options]
-cd contrib/aix; ./buildbff.sh
+contrib/aix/buildbff.sh
 
+The file config.local or the environment is read to set the following options
+(default first):
+PERMIT_ROOT_LOGIN=[no|yes]
+X11_FORWARDING=[no|yes]
+AIX_SRC=[no|yes]
 
 Acknowledgements:
 
@@ -19,6 +25,8 @@
 and for comparison with the output from this script, however no code
 from lppbuild is included and it is not required for operation.
 
+SRC support based on examples provided by Sandor Sklar and Maarten Kreuger.
+
 
 Other notes:
 
@@ -26,8 +34,7 @@
 appropriate).  It seems to work, though......
 
 If there are any patches to this that have not yet been integrated they
-may be found at http://www.zip.com.au/~dtucker/openssh/ or
-http://home.usf.advantra.com.au/~dtucker/openssh/.
+may be found at http://www.zip.com.au/~dtucker/openssh/.
 
 
 Disclaimer:
Index: contrib/aix/buildbff.sh
===================================================================
RCS file: /cvs/openssh/contrib/aix/buildbff.sh,v
retrieving revision 1.4
diff -u -r1.4 buildbff.sh
--- contrib/aix/buildbff.sh	18 Jul 2002 01:04:51 -0000	1.4
+++ contrib/aix/buildbff.sh	7 Mar 2003 06:14:00 -0000
@@ -11,10 +11,12 @@
 
 #
 # Tunable configuration settings
-# 	create a "config.local" in your build directory to override these.
+# 	create a "config.local" in your build directory or set
+#	environment variables to override these.
 #
-PERMIT_ROOT_LOGIN=no
-X11_FORWARDING=no
+[ -z "$PERMIT_ROOT_LOGIN" ] || PERMIT_ROOT_LOGIN=no
+[ -z "$X11_FORWARDING" ] || X11_FORWARDING=no
+[ -z "$AIX_SRC" ] || AIX_SRC=no
 
 umask 022
 
@@ -167,6 +169,18 @@
 EOD
 
 #
+# openssh.size file allows filesystem expansion as required
+# generate list of directories containing files
+# then calculate disk usage for each directory and store in openssh.size
+#
+files=`find . -type f -print`
+dirs=`for file in $files; do dirname $file; done | sort -u`
+for dir in $dirs
+do
+	du $dir
+done > ../openssh.size
+
+#
 # Create postinstall script
 #
 cat <<EOF >>../openssh.post_i
@@ -245,14 +259,42 @@
 fi
 echo
 
-# Add to system startup if required
-if grep $sbindir/sshd /etc/rc.tcpip >/dev/null
+# Set startup command depending on SRC support
+if [ "$AIX_SRC" = "yes" ]
 then
-        echo "sshd found in rc.tcpip, not adding."
+	echo Creating SRC sshd subsystem.
+	rmssys -s sshd 2>&1 >/dev/null
+	mkssys -s sshd -p "$sbindir/sshd" -a '-D' -u 0 -S -n 15 -f 9 -R -G tcpip
+	startupcmd="start $sbindir/sshd \\\"\\\$src_running\\\""
+	oldstartcmd="$sbindir/sshd"
 else
-        echo >>/etc/rc.tcpip
-        echo "echo Starting sshd" >>/etc/rc.tcpip
-        echo "$sbindir/sshd" >>/etc/rc.tcpip
+	startupcmd="$sbindir/sshd"
+	oldstartcmd="start $sbindir/sshd \\\"$src_running\\\""
+fi
+
+# If migrating to or from SRC, change previous startup command
+# otherwise add to rc.tcpip
+if egrep "^\$oldstartcmd" /etc/rc.tcpip >/dev/null
+then
+	if sed "s|^\$oldstartcmd|\$startupcmd|g" /etc/rc.tcpip >/etc/rc.tcpip.new
+	then
+		chmod 0755 /etc/rc.tcpip.new
+		mv /etc/rc.tcpip /etc/rc.tcpip.old && \
+		mv /etc/rc.tcpip.new /etc/rc.tcpip
+	else
+		echo "Updating /etc/rc.tcpip failed, please check."
+	fi
+else
+	# Add to system startup if required
+	if grep "^\$startupcmd" /etc/rc.tcpip >/dev/null
+	then
+		echo "sshd found in rc.tcpip, not adding."
+	else
+		echo "Adding sshd to rc.tcpip"
+		echo >>/etc/rc.tcpip
+		echo "# Start sshd" >>/etc/rc.tcpip
+		echo "\$startupcmd" >>/etc/rc.tcpip
+	fi
 fi
 EOF
 
@@ -262,7 +304,7 @@
 echo Creating liblpp.a
 (
 	cd ..
-	for i in openssh.al openssh.copyright openssh.inventory openssh.post_i LICENCE README*
+	for i in openssh.al openssh.copyright openssh.inventory openssh.post_i openssh.size LICENCE README*
 	do
 		ar -r liblpp.a $i
 		rm $i
Index: contrib/aix/inventory.sh
===================================================================
RCS file: /cvs/openssh/contrib/aix/inventory.sh,v
retrieving revision 1.2
diff -u -r1.2 inventory.sh
--- contrib/aix/inventory.sh	17 Mar 2002 22:05:25 -0000	1.2
+++ contrib/aix/inventory.sh	7 Mar 2003 06:14:00 -0000
@@ -2,9 +2,9 @@
 #
 # inventory.sh
 #
-# Originall written by Ben Lindstrom, modified by Darren Tucker to use perl
+# Originally written by Ben Lindstrom, modified by Darren Tucker to use perl
 #
-# This will produced and AIX package inventory file, which looks like:
+# This will produce an AIX package inventory file, which looks like:
 #
 # /usr/local/bin:
 #          class=apply,inventory,openssh


More information about the openssh-unix-dev mailing list