diff options
Diffstat (limited to 'contrib/aix/buildbff.sh')
-rwxr-xr-x | contrib/aix/buildbff.sh | 62 |
1 files changed, 52 insertions, 10 deletions
diff --git a/contrib/aix/buildbff.sh b/contrib/aix/buildbff.sh index 5c09c6b75..3b3699660 100755 --- a/contrib/aix/buildbff.sh +++ b/contrib/aix/buildbff.sh | |||
@@ -11,10 +11,12 @@ | |||
11 | 11 | ||
12 | # | 12 | # |
13 | # Tunable configuration settings | 13 | # Tunable configuration settings |
14 | # create a "config.local" in your build directory to override these. | 14 | # create a "config.local" in your build directory or set |
15 | # environment variables to override these. | ||
15 | # | 16 | # |
16 | PERMIT_ROOT_LOGIN=no | 17 | [ -z "$PERMIT_ROOT_LOGIN" ] || PERMIT_ROOT_LOGIN=no |
17 | X11_FORWARDING=no | 18 | [ -z "$X11_FORWARDING" ] || X11_FORWARDING=no |
19 | [ -z "$AIX_SRC" ] || AIX_SRC=no | ||
18 | 20 | ||
19 | umask 022 | 21 | umask 022 |
20 | 22 | ||
@@ -167,6 +169,18 @@ For the full text of the license, see /usr/lpp/openssh/LICENCE | |||
167 | EOD | 169 | EOD |
168 | 170 | ||
169 | # | 171 | # |
172 | # openssh.size file allows filesystem expansion as required | ||
173 | # generate list of directories containing files | ||
174 | # then calculate disk usage for each directory and store in openssh.size | ||
175 | # | ||
176 | files=`find . -type f -print` | ||
177 | dirs=`for file in $files; do dirname $file; done | sort -u` | ||
178 | for dir in $dirs | ||
179 | do | ||
180 | du $dir | ||
181 | done > ../openssh.size | ||
182 | |||
183 | # | ||
170 | # Create postinstall script | 184 | # Create postinstall script |
171 | # | 185 | # |
172 | cat <<EOF >>../openssh.post_i | 186 | cat <<EOF >>../openssh.post_i |
@@ -245,14 +259,42 @@ else | |||
245 | fi | 259 | fi |
246 | echo | 260 | echo |
247 | 261 | ||
248 | # Add to system startup if required | 262 | # Set startup command depending on SRC support |
249 | if grep $sbindir/sshd /etc/rc.tcpip >/dev/null | 263 | if [ "$AIX_SRC" = "yes" ] |
264 | then | ||
265 | echo Creating SRC sshd subsystem. | ||
266 | rmssys -s sshd 2>&1 >/dev/null | ||
267 | mkssys -s sshd -p "$sbindir/sshd" -a '-D' -u 0 -S -n 15 -f 9 -R -G tcpip | ||
268 | startupcmd="start $sbindir/sshd \\\"\\\$src_running\\\"" | ||
269 | oldstartcmd="$sbindir/sshd" | ||
270 | else | ||
271 | startupcmd="$sbindir/sshd" | ||
272 | oldstartcmd="start $sbindir/sshd \\\"$src_running\\\"" | ||
273 | fi | ||
274 | |||
275 | # If migrating to or from SRC, change previous startup command | ||
276 | # otherwise add to rc.tcpip | ||
277 | if egrep "^\$oldstartcmd" /etc/rc.tcpip >/dev/null | ||
250 | then | 278 | then |
251 | echo "sshd found in rc.tcpip, not adding." | 279 | if sed "s|^\$oldstartcmd|\$startupcmd|g" /etc/rc.tcpip >/etc/rc.tcpip.new |
280 | then | ||
281 | chmod 0755 /etc/rc.tcpip.new | ||
282 | mv /etc/rc.tcpip /etc/rc.tcpip.old && \ | ||
283 | mv /etc/rc.tcpip.new /etc/rc.tcpip | ||
284 | else | ||
285 | echo "Updating /etc/rc.tcpip failed, please check." | ||
286 | fi | ||
252 | else | 287 | else |
253 | echo >>/etc/rc.tcpip | 288 | # Add to system startup if required |
254 | echo "echo Starting sshd" >>/etc/rc.tcpip | 289 | if grep "^\$startupcmd" /etc/rc.tcpip >/dev/null |
255 | echo "$sbindir/sshd" >>/etc/rc.tcpip | 290 | then |
291 | echo "sshd found in rc.tcpip, not adding." | ||
292 | else | ||
293 | echo "Adding sshd to rc.tcpip" | ||
294 | echo >>/etc/rc.tcpip | ||
295 | echo "# Start sshd" >>/etc/rc.tcpip | ||
296 | echo "\$startupcmd" >>/etc/rc.tcpip | ||
297 | fi | ||
256 | fi | 298 | fi |
257 | EOF | 299 | EOF |
258 | 300 | ||
@@ -262,7 +304,7 @@ EOF | |||
262 | echo Creating liblpp.a | 304 | echo Creating liblpp.a |
263 | ( | 305 | ( |
264 | cd .. | 306 | cd .. |
265 | for i in openssh.al openssh.copyright openssh.inventory openssh.post_i LICENCE README* | 307 | for i in openssh.al openssh.copyright openssh.inventory openssh.post_i openssh.size LICENCE README* |
266 | do | 308 | do |
267 | ar -r liblpp.a $i | 309 | ar -r liblpp.a $i |
268 | rm $i | 310 | rm $i |