summaryrefslogtreecommitdiff
path: root/distrib/miniroot
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-30 20:41:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-30 20:41:00 +0000
commit46fed973a86fb9ce5d506bcab702eb3bfbb729cf (patch)
treef0f12de6024e6ad38180c939d17afc0bddf56ced /distrib/miniroot
parentc38022cf2859d8da5beebdb6635a3be42b7718be (diff)
Defer talking to the ftpinstall cgi until a fair bit later, so that we can
also tell it the timezone. As a result, this will also work for non-url based installs.
Diffstat (limited to 'distrib/miniroot')
-rw-r--r--distrib/miniroot/install.sh21
-rw-r--r--distrib/miniroot/install.sub11
2 files changed, 21 insertions, 11 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh
index 8f429369432..edd5e23304c 100644
--- a/distrib/miniroot/install.sh
+++ b/distrib/miniroot/install.sh
@@ -1,5 +1,5 @@
#!/bin/ksh
-# $OpenBSD: install.sh,v 1.193 2009/05/30 19:34:39 deraadt Exp $
+# $OpenBSD: install.sh,v 1.194 2009/05/30 20:40:59 deraadt Exp $
# $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -189,9 +189,24 @@ set_timezone /var/tzlist
install_sets
-[[ ! -n $TZ ]] &&
- (cd /mnt/usr/share/zoneinfo&&ls -1dF `tar cvf /dev/null [A-Za-y]*`)>/tmp/tzlist && \
+# If we did not succeed at setting TZ yet, we try again
+# using the timezone names extracted from the base set
+if [[ -z $TZ ]]; then
+ ( cd /mnt/usr/share/zoneinfo
+ ls -1dF `tar cvf /dev/null [A-Za-y]*` >/tmp/tzlist )
set_timezone /tmp/tzlist
+fi
+
+# If we managed to talk to the ftplist server before, tell it what
+# location we used... so it can perform magic next time
+if [[ -s $SERVERLIST ]]; then
+ _i=
+ [[ -n $installedfrom ]] && _i="install=$installedfrom"
+ [[ -n $TZ ]] && _i="$_i&TZ=$TZ"
+
+ [[ -n $_i ]] && ftp $FTPOPTS -a -o - \
+ "http://129.128.5.191/cgi-bin/ftpinstall.cgi?$_i" >/dev/null 2>&1 &
+fi
# Ensure an enabled console has the correct speed in /etc/ttys.
sed -e "/^console.*on.*secure.*$/s/std\.[0-9]*/std.$(stty speed)/" \
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index d58b8ae0d79..19a403bac02 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,4 +1,4 @@
-# $OpenBSD: install.sub,v 1.559 2009/05/30 19:32:20 deraadt Exp $
+# $OpenBSD: install.sub,v 1.560 2009/05/30 20:40:59 deraadt Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
@@ -1236,13 +1236,8 @@ install_url() {
install_files "$_url_base" "$_file_list"
- # Tell the FTP server what location we used... so it can perform magic
- if [[ -s $SERVERLIST ]]; then
- eval _url_base=$_url_type://\$_${_url_type}_server_ip/\$_${_url_type}_server_dir
- ftp $FTPOPTS -a -o - \
- "http://129.128.5.191/cgi-bin/ftpinstall.cgi?install=$_url_base" \
- >/dev/null 2>&1 &
- fi
+ # Remember where we installed from
+ eval installedfrom=$_url_type://\$_${_url_type}_server_ip/\$_${_url_type}_server_dir
}
install_mounted_fs() {