Age | Commit message (Collapse) | Author |
|
string. i.e. "${a}" -> "$a". Save the {} form for strings where
variables are mixed with text.
Remove superfluous X's. e.g. "X$resp" = "Xdone" -> "$resp" = "done".
Change last few '[ "$v" = "" ]' or equivalents to '[ -z "$v" ]'.
|
|
|
|
|
|
ask() takes 2 parameters. The first one is the question to
ask the user, and the 2nd is the default answer.
Shrinks and makes the code clearer.
From espie@ with some tweaking, ok deraadt@.
|
|
|
|
getting eval to work correctly. Some other logic cleanups in
glob_selection.
Eliminate 'dead' code trying to use dns to resolve
ftp.openbsd.org. Not only was the code dead, $_resolver_enabled
having been eliminated a while ago, but unnecessary as Theo has
promised the IP address will not change.
Spell 'occurrences' correctly.
From espie@ with slight modifications. ok espie@ millert@
|
|
Move more 'if [] then; x; fi' to '[] && x' or
'[] || x' idioms.
Remove code supporting an optional IFS parameter in cutlast(),
as it was never used. Also redo logic a bit in cutlast() to
use eval to better effect.
Improve logic a bit in bsort.
From espie@ with slight modifications. ok espie@ millert@
|
|
calls to grep and file redirections.
Eliminate function firstchar(). Rework of partition gathering
code removes the only use.
Remove the usual extraneous 'X's and {}'s in the code being
worked on.
From espie@ with slight modifications. ok espie@ millert@
|
|
|
|
|
|
|
|
greatly simplify both getresp() and the code around
obtaining passwords. Shrinks, simplifies and
makes the code clearer.
From espie@.
ok deraadt@ and espie@.
|
|
|
|
|
|
|
|
|
|
when people specify, e.g. /usr/local before /usr. deraadt@ OK
|
|
last minute tweaks to it by me, but you can trust me, right?
|
|
use it to make 'em. Now you can install with as many disks as you want.
cleanup by espie, tests by jason
|
|
Eliminate some blank lines.
Only comments and blank lines affected, no code.
Suggested by deraadt@
|
|
a) Make [ -z "$var" ] standard idiom, replacing
many variants on [ X"$var" = X"" ].
b) Factor out three large chunks of repeated code
for finding sets, getting user to select sets
and then installing the sets. This creates
get_sets_list(), get_get_files_list() and
install_get_files_list().
c) Eliminate unneeded dir_has_sets() function.
d) Indent last large functions that were not
properly indented.
e) Replace most if not all 'test' invocations
with [], replacing a few if statements along
the way.
f) Use ${MODE} a lot more to make messages appear
more relevant to process.
g) Fix erroneous display of $local_sets_dir so
the error for a non-existant dir actually displays
the user input, not an empty string.
h) Eliminate the 'list' option in selecting sets. It
was not possible to actually select anything except
what was already displayed, so bring verbiage and
options into line with code.
i) Replace a number of '\"' and "\'" with just plain
's or "s as appropriate.
j) Replace ". " with ". ".
k) Use some more "OpenBSD {$VERSION_MAJOR}.${VERSION_MINOR}"
to make more messages correct and current.
l) Various typos fixed.
Net shrinkage approximately 2K.
ok millert@ deraadt@
|
|
1) If there are no unselected sets then the default
becomes 'done'.
2) A bare '-' or '+' is ignored, since it causes
problems for the functions that call get_selection().
|
|
and upgrade.sh, putting it into install.sub.
Replace groups of echo's with here documents.
Eliminate bare echo's with embedded \n's.
Abstract repeated verbiage into display_* functions, also eliminating
a backslash orgy when showing the ftp/http server location. This
also makes the verbiage consistant across ftp, cd, etc. installs.
Try hard to make file selection screen fit on one screen.
Fix default in 'File name?' prompt so it contains the first
non-selected set.
Some minor wording adjustment, typos, etc.
Net shrinkage of about 1.5K.
|
|
for one or more network interfaces.
Rework timezone logic to shrink it and make it more clear. Don't
bother checking for /usr/share/zoneinfo as it is never there, just
look for /mnt/usr/share/zoneinfo.
Eliminate spurious early call to get_timezone() that
(accidentally?) made GMT the default timezone during
installs. Instead rely on the /etc/localtime that is installed
from etcXX.gz. Currently this means the default timezone is the
historically resonant US/Pacific.
Ideas if not code details ok deraadt@ and millert@
|
|
|
|
case WORD
and
var=WORD
Bourne and related/descendant shells such as our sh do *not* do
field splitting or globbing on WORD. Thus we can eliminate a large
number of unnecessary '"'s in case statements and variable
assignments.
This is a lightly adapted version of naddy's diff, to take account
of changes in the scripts since he generated it.
|
|
1) Move the 'executed' code at the top of install.sub
to the end, so that it can successfully use .md
functions.
2) Get _DKDEVS once only, and get _CDDEVS at the same
time (see (1))
3) Clean up calls to getresp so that
a) no '"'s used on constants
b) '"'s always used for variables
c) never use {} for variables
d) ensure parameter passed matches default shown
in any preceeding []
4) Try to put '"'s around directory names
5) Replace a couple of instances of using []s around
a prompt comment instead of ()s
6) Reduce some code by putting $_DKDEVS inside
here documents, rather than echo'ing it
7) eliminate an unused variable _directory
8) eliminate a couple of while RESP="" loops which
never loop because a non-null default is provided
to getresp
9) move some code into mount_a_disk to make logic
clearer
10) eliminate a couple of extra blanks in prompts
11) eliminate ALLSETS and UPGRSETS by just removing
'etc' from THESETS in upgrade.sh
12) Indent a couple of smaller functions
ok deraadt@
|
|
from scripts put on floppy images.
|
|
|
|
|
|
|
|
standard __EOT as here document delimiter.
Remove unnecessary escaping of __EOT.
Could be/Should be extended to .md scripts and other non-miniroot
architectures.
Concept approved a *long* time ago by deraadt@ and millert@ but
never got out of my tree.
|
|
some unneeded intermediate local variables and just using the
parameters.
Make upgrade fsck output for root partition consistant with later
fsck output for other partitions.
ok deraadt@
|
|
|
|
1) Deleting code for '-s' option, which was never used.
2) Deleting code for >1 parameters after optional '-n'.
Also never used.
@ok millert
|
|
In particular
a) save dhclient.leases so the lease obtained during installation
is retained.
b) create /etc/resolv.conf.tail with 'lookup file bind' so that
the resolv.conf files created by dhclient have the same settings
as the default resolv.conf we install. i.e. use the /etc/hosts
file before trying bind.
ok millert@
|
|
is nfs mounted, i.e. install is running on a diskless machine.
ok millert@
|
|
|
|
This should cut down on the inquires on @misc/@tech about missing
compilers, etc. In the days of 180GB disks we should not run out of
space too often.
Clean up some logic, removing references to -reuse and -minpat
arguments in install_url(), as install_url() is only called with -http
or -ftp.
Simplify selector setup by noting that $_sets is carefully initialized
to hold only file names ending in .tgz or .tar.gz.
@ok millert
|
|
a) Add /var/run to the filesystem created when the installation media
boots. This allows the creation and use of the dhclient.pid file.
Synchronize all mtree.conf files in architectures using miniroot.
b) Rework the traps used in upgrade.sh and install.sh so that HUP,
INT, QUIT, TERM and EXIT all invoke a cleanup function that kills an
active dhclient, unmounts all filesystems and fsck's -p all devices
in /etc/fstab, or just /mnt if /etc/fstab is not present.
c) Make sure the actions of the cleanup function are visible, thus
eliminating the long delay with no feedback at the end of the
upgrade/install script, after the congratulatory message.
d) Reduce manual parsing of fstab files by using umount -a to
unmount all mounted filesystems.
e) Since the new cleanup function tries to unmount all filesystems,
use the presence of /etc/fstab, rather than a difference between
`df /` and `df /mnt`, to determine if an install is being restarted
in a state where disk initialization can be skipped.
f) Change munge_fs, check_fs, mount_fs, remount_fs so that they
all 'know' about /etc/fstab rather than passing the same
parameter in all the time.
g) Use input redirection on munge_fs to read correct file, rather
than passing a file name as a parameter.
h) Indent code for various smaller functions.
i) Eliminate some subshell usage to simplify code further.
j) Display pretty messages during fsck -p to clearly indicate success
or failure of fsck, rather than just dumping fsck output.
k) Always run mount_fs in install.sh, even if disk initialization is
being skipped, because the trap should have unmounted all filesystems
when the last run terminated.
ok weingart@ millert@
|
|
Alas many of these were introduced by yours truly as necessary
just doesn't look right to me for some reason ;-)
|
|
a) Indent encode_for_url() in install.sub with tabs not spaces
b) delete a couple of extra blank lines
c) delete a few unnecessary ';'s at the end of lines
d) delete a few unnecessary '"'s around values assigned to resp (e.g.
'resp="X"' to 'resp=X'
|
|
check_fs() and unmount_fs() by restricting i/o redirection to the
reading of fstab.
Fix a typo ('succes' -> 'success').
Indent lines inside check_fs() and unmount_fs() functions.
Eliminate an unused variable _mps in check_fs().
ok millert@
|
|
/etc/services used during installations.
This way it is not necessary to run the install script before
using commands requiring these files.
Requested by deraadt@.
|
|
that use the miniroot install scripts.
During an install, donetconfig() in miniroot/install.sub now
creates a minimal /etc/protocols and /etc/services.
During an upgrade, enable_network() now copies the existing
protocols and services files into /etc.
Saves approximately 13K on floppy/cd images.
|
|
out. Save about 287 bytes. Based on diff from deraadt@.
Update Copyright (ok deraadt@).
|
|
trailing spaces during install.
Do not make the previously entered first password value the default
value if passwords do not match the first time.
Update Copyright (ok deraadt@).
|
|
When a system is rebooted rather than power cycled it is possible
for duplicate entries for a disk or cd to appear in the dmesg
output. One from the previous boot and one from the current
reboot.
bsort() correctly filtered out the duplicates, but could emit a
trailing space.
This trailing space caused problems when, for instance, the root
disk was being determined. With the trailing space present, the
install or upgrade script would not fill in the default root disk,
even if the system only had one disk.
|
|
default response ($1) are preserved in $resp.
Fix handling of _ftp_server_login, _ftp_server_password and
_url_base so any blanks present are preserved.
Problem with blanks pointed out by drahn@.
|
|
section 3.1. Allows for use of '@', ':' and '/' in usercodes
and passwords without confusion.
ok deraadt@
|