summaryrefslogtreecommitdiff
path: root/distrib/miniroot
AgeCommit message (Collapse)Author
2003-01-26Last (?) big cleanup in distrib/miniroot this release cycle.Kenneth R Westerback
Simplify and clarify logic around selecting/installing sets. Rename do_selection_list() to select_sets(), and install_get_files() to install_files(). Eliminate glob_selection() and get_get_files() and the global GET_FILES, folding logic into select_sets() and install_files(). Show the user entire 'url' when no sets are found, rather than trying to hide mount points, etc. Eliminate VERSION_MAJOR and VERSION_MINOR since they were always used together. Instead, simply construct a few variables (SETDIR, FTPDIR, OBSD) holding the strings these were used to construct. Various 'standard' cleanups of quotes, braces, etc. in modified areas. Also shrinks install.sub by 681 bytes.
2003-01-25Eliminate unused global SETSDONE.Kenneth R Westerback
Add (back?) function SETSDONE was probably supposed to be doing (preventing the automatic selection of already installed sets) by manipulating DEFAULTSETS instead. Remove successfully installed sets from DEFAULTSETS, and add 'problem' sets detected in sane_install() back into DEFAULTSETS.
2002-12-14Expunge some trailing whitespace.Kenneth R Westerback
From David Krause.
2002-12-08Fix botch in last commit: prepend comments to hosts after adding FQDN toKenneth R Westerback
hosts entries, so comments are not processed. Last few touchups & shrinkage for this round. Current score: install.sh+install.sub+upgrade.sh = 36,934 (vs 40,062 for 3.2).
2002-12-08Fix & cleanup logic, especially around interrupted installs.Kenneth R Westerback
Use value of 'hostname' to store all HOSTNAME and FQDN information. Elminate those global variables. For install accept user input as is, but if the short form hostname is unchanged, save any domain info by not re-setting hostname. For upgrade just set hostname from /tmp/myname. Unconditionally create default hosts file in install.sh, rather than doing it in separate places depending on whether or not the user configures the network. Always ask if the user wants to edit the hosts file when the network is configured, but without listing it out. Don't put 'search' command in resolv.conf as we now set hostnames to include fully qualified domain names, which will be used to yield local domain name. Loop asking for the default route until the user enters one that 'route' accepts or the user explicitly asks for no default route by entering 'none'. Add FQDN info to hosts file just before saving configuration files to the installed system. Preserve user added lines - those with aliases or with domain information in the hostname. Clean up donetconfig() logic. Delete network config files in install.sh so that if the user restarts an interrupted install previous network configuration does not leak into installed system. Elminiate get_resolv_fqdn(), searching resolv.conf for domain info only when dhcp was used. get_fqdn() is reduced to looking for domain info in current hostname, and supplying 'my.domain' if none found. Add save_comments() and use to preserve useful comments in the installed /etc/hosts and /etc/dhclient.conf files. Previous logic for dhclient.conf could cause repeated appending of configuration info rather than just preserving the comments. Cleanup logic copying files from /tmp to /mnt/etc, eliminating unneeded cfgfiles variable. Use wildcards and subshells to shrink code size.
2002-12-04Code cleanup & shrinkage.Kenneth R Westerback
Redo configure_ifs() to take full advantage of recent code refactoring, and cleanup code while there. Move address or dhcp question to after media option handling so that each question gives immediate feedback. i.e. if the media options given don't work then say so and exit, and if dhcp is requested immediately issue the dhcp request. Also allows some code shrinkage. Eliminate addifconfig() and remount(). The former is folded into configure_ifs() and the latter's three lines simply replace the call in install.sh. Move remount code to before any configuration files are moved to the installed system.
2002-12-03More code consolidation.Kenneth R Westerback
Create dhcp_request() and use in configure_ifs() rather than repeat code. When dhcp is successful, move /etc/dhclient.conf, /etc/resolv.conf.tail to /tmp, and use normal configuration file installation to put them on the installed system. Also apply any user specified media options immediately. If they don't compute then return immediately.
2002-12-01Code consolidation. Create edit_tmp_file(), manual_net_cfg(), inet_info()Kenneth R Westerback
to abstract repeated code blocks. Current score: 3.2 install+upgrade+install.sub = 40,062 bytes -current " " " = 38,051
2002-12-01Create kill_dhclient(). Use before any attempt to run dhclient, toKenneth R Westerback
avoid problems with the single bpf interface available on install media. Move umount'ing of filesystems to the start of any install or upgrade execution. Eliminate now vestigal cleanup_on_exit() and all associated traps. Shrinks scripts, makes more reliable, improves intuitiveness of re-running install or upgrade, eliminates an install/upgrade time message, leaves filesystems available if install/upgrade script interrupted.
2002-11-29Ask for DNS domain name *after* the interfaces are configured, at theKenneth R Westerback
same time as we ask for the default route and name server addresses. This allows users to override any DHCP supplied domain information the same way they could override DHCP supplied default route and name server addresses. As a result, remove the now superfluous warning about not supplying information DHCP is going to overwrite.
2002-11-28Use any existing hostname as the default, as the install could haveKenneth R Westerback
been restarted. Discard any domain information the user supplies.
2002-11-28spacesTheo de Raadt
2002-11-28Make questions out of requests for user input that were demands. UseKenneth R Westerback
a standard format of <question>? (<extra verbiage>) [<default value>] Makes things more consistant, and sometimes more terse.
2002-11-28Save a few bytes;Kenneth R Westerback
1) The one '/sbin/ifconfig' -> 'ifconfig'. 2) Eliminate local variable and thereby unneeded '\n' in welcome().
2002-11-28Fix indent botch.Kenneth R Westerback
2002-11-24use 8 rounds for passwd, like login.conf specifies; rob_ses@web.deTheo de Raadt
2002-11-10Polish wording on fstab verbiage, and swap paragraphs so the paragraphKenneth R Westerback
descibing how the fstab will be used follows immediately after the fstab listing, and the paragraph explaining about editing the fstab comes immediately before the offer to edit the fstab. Eliminate a blank line before the question as it is now tightly related to the paragraph that precedes it.
2002-11-10Fix makedev() so that if the device nodes are *not* created, makedev()Kenneth R Westerback
returns false, and the device is *not* added to DEVSMADE.
2002-11-09Code cleanup, simplification and shrinkage.Kenneth R Westerback
Eliminate the function get_setsdir() by merging it into install_mounted_fs(). Eliminate global SETSDIR as a result. Move the loop logic used to select the directory to use on a mounted filesystem to a 'done' style loop. i.e. loop until valid input (a directory which exists) or 'done'. 'done' implies abandoning effort to find a directory. Eliminate the test for and associated error message about no filesystems being mounted below the mount point passed to install_mounted_fs(). This served little purpose not addressed by the message generated when a non-existant directory is entered. i.e. novices won't understand and experts can '!' out to investigate. Remove the option to list mounted filesystems. Same reasons as for eliminating the test for mounted filesystems. Move repeated tests for an empty GET_FILES into the function invariably called after the tests (install_get_files()).
2002-11-09Fix two problems:Kenneth R Westerback
1) When asked to choose a device, a user could enter two identical words separated by a blank (e.g. 'a a') and thereby confuse the check for selection validity. Quote user response before using it. 2) When asked to choose a sub-timezone, the user could escape to a shell and when returning only see half the sub-timezone prompt redisplayed. Put entire prompt into ask() parameter rather than displaying first half in a separate echo -n. Also change a "(or done)" to "(or 'done')" to be consistant with other similar displays and move the initial comment for mount_a_disk() to before the function to conform to normal usage.
2002-11-07Treat 'bsd' like just another filename in THESETS, no more 'kernel'Kenneth R Westerback
logic. As result, MDSETS gone from everything but mac68k. MDSETS now treated as a list of complete file names to add to THESETS, allowing more MD flexibility, i.e. may or may not be .tgz files. All traces of tar.gz removed. Not used for sets since 2.7 or so. As a result of code simplification from not having to consider tar.gz, the functions get_sets(), make_lastset(), and set_not_done() are eliminated, along with the global SETS. Build THESETS and DEFAULTSETS to contain full file names. Always install sets in the order they appear in THESETS, keeping siteXX last but without needing special logic. More predictable for user if a lot of set additions and removals done before being satisfied, as the sets are now installed in the same order they appear in the selection list. Remove ability to look for non-set .tgz/.tar.gz files. The job of the install scripts is to install the standard sets in a simple and rational way. Not to install general tar balls. The user can do that post-install or simply '!' out to do it during install. On their head be it. If no sets are found in a specified source, list the filenames in THESETS to show what is being looked for.
2002-11-01Cleanup. Don't bother complaining when the user selects some non-existantKenneth R Westerback
set. Just re-display the selection list unchanged. Smaller, cleaner.
2002-11-01Cleanup. install_sets() no longer takes a parameter.Kenneth R Westerback
2002-10-31Introduce some better feedback during attempted ftp installations. InKenneth R Westerback
this pass check the file list returned by ftp_list_file() for two common errors ('Login failed.' and 'No such file or directory.') and display the error messages rather than just complaining that no sets were found. Delete an unused local variable. Do not allow the user to continue with the install/upgrade if the sanity checks fail. Keep asking them to install more sets until the checks succeed. ok millert@.
2002-10-28Rework/reword the install sanity checks and associated logic slightly.Kenneth R Westerback
1) Do all three sanity checks (for bsd, base32, etc32) every time so the user is aware of all three problems asap. Make the error messages stand out, and refer explicitly to the sets that should fix the problem. 2) Use standard 'done' logic to exit the set selection loop rather than ask a separate question. One side effect: a <cr> at the set location prompt now just causes the redisplay of the prompt rather than an error. 3) Remove 'suspect' sets from the SETSDONE list so that if bsd, base32 or etc32 are found to be wanting, they are automatically selected the next time they appear on the list of available sets. 4) But the $MDSETS (and therefore the 'bsd' set) first on the selection list. This puts all three 'required' sets at the top of the list where they seem to belong.
2002-10-27Ensure that 'siteXX.tgz' and 'siteXX.tar.gz' are the *last* setsKenneth R Westerback
installed. This should guarantee that any site-specific files which are intended to replace files installed from 'normal' sets will do so.
2002-10-04krw fucked up; i must re-tag this fileTheo de Raadt
2002-10-03Divorce system hostname handling from network configuration.Kenneth R Westerback
Every system has a name, and thus generated keys with that name, even if there is no currently configured network. So, ask for a system hostname before configuring the network. Eliminate /tmp/myname and just keep hostname set to the lastest name and FQDN. Construct /etc/myname from hostname as configuration data is being saved. Construct /etc/hosts (preserving the informative leading comment from the /etc/hosts file in etcXX.tgx) at the same time. Construct an appropriate /etc/hosts file even if the network is not configured. During upgrade, if the user enables the network using the existing configuration, don't ask about the domain name - just use the configured one. Take care to handle existing /etc/myname files which do not necessarily have a FQDN. Originally problem with hostname handling pointed out by beck@. ok deraadt@
2002-09-30a few new spaces -> tabsTheo de Raadt
2002-09-29Keep track of all devices that makedev() creates and recreateKenneth R Westerback
them in the installed system. ok deraadt@. (which I forgot to mention for the last commit).
2002-09-29Modify makedev so that it does not attempt to create network interfaceKenneth R Westerback
devices, to allow ask_which() to be used for interface configuration. Rework network interface configuration logic to use ask_which() instead of local code. This 1) May fix the problem noted by David Norman, where the prompts are somehow broken, since no such problems have been noted with the ask_which() code. 2) Shrinks the install output by a few lines. 3) Makes the install script smaller and clearer. 4) Makes interface configuration consistant with other 'device' configurations. 5) Makes it impossible for a user to configure an interface more than once. Add the interface name to the 'IP address (or dhcp)' question. This makes it more informative, especially if a '!' or '!foo' shell escape has been used and overwritten the list of interfaces and the display of the name of the one being configured.
2002-09-28Cleanup/fix/improve question asking.Kenneth R Westerback
1) If the user escapes to a shell with '!' or executes a command with '!foo' at a prompt then repeat the prompt when the shell or command returns. 2) If ask_which() is passed an empty list of devices , then set resp to 'done' and return. Replaces a couple of checks before calling ask_which(). Also emit a message about the lack of devices. 3) In ask_which(), delete any trailing blank which rmel() may have appended to the device list. Replaces a check before calling ask_which(). 4) Remove an unneeded blank line before the 'invalid choice' message from ask_which(). 5) Make the first disk device the default answer when asking for which disk contains install sets. A few code/verbiage nits: 1) make _a a local in cutlast(). 2) use normal ': ${_defdev:=done}' idiom instead of an or condition in ask_which. 3) Eliminate an unnecessary blank line/paragraph by putting 3(!) sentences into a single paragraph when describing process of selecting install sets. 4) Eliminate another unnecessary blank line between the list of possible install sources and the question about which one to use. 5) Eliminate another unnecessary blank line before the 'Extract more sets?' question 6) Eliminate a double blank line after the sanity check error messages. ok deraadt@.
2002-09-25Try to minimize places where suid programs and devices can liveKenneth R Westerback
by implementing the rules: Only '/' is neither nodev nor nosuid. i.e. it can obviously *always* contain devices or setuid programs. Every other mounted filesystem is nodev. If the user chooses to mount /dev as a separate filesystem, then on the user's head be it. The only directories that install puts suid binaries into (as of 3.2) are: /sbin /usr/bin /usr/sbin /usr/libexec /usr/libexec/auth /usr/X11R6/bin and ports and users can do who knows what to /usr/local and sub directories thereof. So try to ensure that only filesystems that are mounted at or above these directories can contain suid programs. In the case of /usr/libexec, give blanket permission for subdirectories. Note that if *all* the above are split into separate filesystems the install process will attempt a couple of cross-device links when installing base32.tgz, and fail. ok deraadt@.
2002-09-24Rejig addel()/rmel() to keep items on a single line, with blanksKenneth R Westerback
separating items. This allows a compaction of the displayed lines for device selection. Customize the device selection routine so the actual device type is shown (disk or CD-ROM). Rename ask_fordev to ask_which so the invocations (with device type) read better.
2002-09-22Do not allow install to proceed until root filesystem can be mounted onKenneth R Westerback
$ROOTDEV and ${ROOTDISK}b can be used for swap. Also shortens output generated during (successful) install. Fix problem with upgrade on systems with many disk devices by automatically creating devices encountered during the fsck'ing of fstab filesystems. Problem noted by Dethlef Madsen and Nick Nauwelaerts. Adjust some verbiage in i386 install.md to make it more consistant. Reformat welcome message to make sure all lines are <80 characters wide. Minor cleanups.
2002-09-20Add pflog, vlan and gif to list of interfaces filtered; krw@ OKTodd C. Miller
2002-09-17Fix commit botch that deleted '#' at beginning of '$OpenBSD$' tag line.Kenneth R Westerback
2002-09-17Ruthlessly expunge unnecessary verbiage and whitespace to make sureKenneth R Westerback
the install example will easily fit on the CD insert at some reasonable font size. Reword many messages and questions for same reason. In addition: 1) Add '...done.' to match 'Installing boot block...' 2) During install, after asking which is the root disk, start initializing it immediately rather than asking again which disk to work on. 3) Move munged fstab filesystem mounting to *before* network initialization so that if you bail out during network initialization and restart you do not have to go through disk initialization again. Also puts fsck and mount messages close to each other rather than spitting out the latter just before root password questions. 4) Make 'usr/obj' nosuid,nodev by default, /home nodev by default. 5) For network interfaces only show the complete list of media options if the user indicates they want to change the default. 6) Move the question about the ftp server supporting passive ftp to *after* selecting the ftp server where it is more 'rational' and can easily be made more concise. 7) Don't bother umount'ing filesystems or stopping the dhclient after a successful install/upgrade. The next step is a reboot after all. Some minor code tweaks and comment cleanup while in the area. Tested in recent snapshots. Suggested by & ok deraadt@.
2002-09-13do not stty 9600Theo de Raadt
2002-09-10move to 3.2-betaTheo de Raadt
2002-08-29Add a new verb to list2sh.awk, 'REMOVE'. This allows the easyKenneth R Westerback
disabling of '(U)pgrade' in architectures by adding REMOVE upgrade to the end of the 'list' file for that architecture. Add code to dot.profile to check for the presence of the upgrade script before offering to (U)pgrade. Use the new verb to disable upgrades for sparc. ok deraadt@.
2002-08-27Missed file in last commit.Kenneth R Westerback
2002-08-27Move general partitioning advice from machine dependant per diskKenneth R Westerback
routine to install.sh so it is displayed only once. Strongly advise /, /tmp, /var, /usr and /home have their own disk partitions as requested by deraadt@. Rather than rely on users not re-selecting an already initialized disk, just allow them to choose from un-initialized disks. Move get_root invocation into install.sub as both install.sh and upgrade.sh did it first thing. Remove the 'workaround' to a 'vnode aliasing bug' that came in with the initial import of upgrade.sh from NetBSD. ok millert@. Rework verbiage in a few places. Clean up logic around looping through disk units by handling root disk better.
2002-08-25More fixes to mount point handling.Kenneth R Westerback
1) Correctly sort >10 total partitions. 2) Don't allow user to specify duplicate mount points via disklabel. 3) Fix mount point checking so that empty mount points do not confuse logic. 4) Fix mount point checking so that duplicate mount points from previous disk initialization are correctly detected. 5) Show configured partitions/mount points in partition order (i.e. sorted by disk and then partition) rather than mount point order. This seems easier to read to me and reflects the order of user action. Sort the entries after user approval. 6) Clarify, clean up some verbiage and logic.
2002-08-18Fix various mount point problems:Kenneth R Westerback
1) Fix 'already mounted' checking so a mount point name can be the same as the leading substring of a previously specified mount point. Now you can specify /usr after /usr/obj, and since the mount points are sorted before writing to fstab, it should work. This also fixes the error message generated when a requested mount point matches the leading substring of multiple mount points. e.g. trying to mount '/' again. 2) Fix fstab sorting so that it works across all initialized disks, not just on a disk by disk basis. 3) For additional paranoia during multiple disk installs, unset _partitions, _psizes, and _mount_points before processing a disk. Eliminate individual blanking of _mount_points entries. 4) Shorten/simplify logic by storing ${DISK} in _partitions entries rather than always adding it back in when referencing _partitions. 5) Rework verbiage a bit, eliminating the duplicate display of configured devices before making new filesystems. Some code clean up, eliminating '{}'s, better loops, ifs, etc. Appox. 67 bytes net bloat.
2002-08-15Fix a problem with re-started installs that caused the domainKenneth R Westerback
name to be repeatedly appended to the host name. Simply strip the domain name from the host name read from /tmp/myname. Problem noted by Nick Holland.
2002-08-05If ELF_TOOLCHAIN, pass -E to crunchgen and build elfrdsetroot insteadArtur Grabowski
of rdsetroot.
2002-07-31/tmp/fstab.$DISK is created in install.md, so put back referencesKenneth R Westerback
to it. Fixes mount point prompts during install. 'Improve' an error message. Noted by todd@ and jsyn@.
2002-07-28New feature request by (most recently) drahn@:Kenneth R Westerback
Do not allow the same mountpoint to be specified for >1 disk partition. If a mountpoint that has already been specified is entered again an error message of the form: Invalid response: sd0a is already being mounted at /var is emitted. Partitions on both the disk being initialized and previously initialized disks are checked. Rework a bit of the logic to simplify and shorten in compensation. e.g. eliminate references to /tmp/fstab.<disk> as it is never created.
2002-07-27Fix two problems.Kenneth R Westerback
1) Even if /sbin/mount_nfs is present, do *not* try to automatically mount nfs file systems. Because not all name resolution mechanisms are present during upgrade (e.g. yp) it is not safe to do so. The user must manually mount nfs file systems if they are the source of any sets. Problem noted by miod@, change seconded by deraadt@. 2) Change initial verbiage so that a brief introduction is displayed, along with the information about !foo or !, before the terminal type is requested. After the terminal type is known display the rest of the introductory text using less -XE. This belts and suspender fix makes both the install and upgrade text fit in 'page' size (<24 lines) chunks and ensures that if the text ever grows beyond a page a more informative prompt is displayed. Problem noted by millert@.