Commit Graph

69 Commits

Author SHA1 Message Date
ad 6fcf2c1799 Allow the password cipher to be chosen at install time. XXX Not tested for
real yet, and the French files need updating.
2002-04-04 14:26:43 +00:00
skrll a3a8c36b17 Factor out the aout library moving code for use in other platforms. 2002-02-03 22:21:55 +00:00
scottr d4a2f03f78 Add support for FTP through a web proxy (via the ftp_proxy environment
variable).
2001-06-06 23:12:48 +00:00
itojun 4a360e2310 write out IPv6 configuration to /etc/rc.conf and /etc/ifconfig.* 2001-04-15 11:08:51 +00:00
mrg d436dd6641 extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes.  details:

- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap.  a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing.  this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'.  create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.


[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB.  as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 02:38:13 +00:00
mrg 8da46e6897 de-__P()-ify 2000-12-22 10:12:12 +00:00
fvdl 30b8888d4a * Change the interface of run_prog: use a flags argument instead of
seperate booleans. Add flags to run as a plain 'system()' command,
  fullscreen (but on a pty), and chrooted, and implement their
  functionality. Add a bit of TIOCPKT handling code to handle
  programs messing with term settings better.
* Ask to set the root password at the end of an install.
* Remove a few unneeded comments.
* Sprinkle some touchwin() calls here and there to make the output cleaner.
  They shouldn't really be needed, but even normal usage (no syslog
  messages) even left the screen messy sometimes.
* Change some messages around that were apparently swapped by accident and
  thus caused confusion.
2000-10-11 23:47:55 +00:00
fvdl d8be7da3a1 Externalize concat_paths, it is used by arch/i386/md.c now. Add
target_realpath prototype.
2000-10-11 11:06:03 +00:00
fvdl 4ee4b50498 Add a definition for md_init(), an MD function to initialize whatever
needs to be initialized before sysinst starts processing menus.
Call it from main().
2000-10-02 09:26:26 +00:00
fvdl 09aafa8795 Move md_enable_swap to disks.c, rename it set_swap, and handle both
enabling and disabling swap. Enabling swap is currently only
done by the i386 port on systems with <= 8M of physical memory.

If a user re-enters the install procedure through the main menu,
and the target disk has an active swap partition, try to disable it,
warning the user that this might lead to 'out of swap' problems,
making a restart necessary. This should not happen very often.

Partly based on comments by Simon Burge.
2000-09-27 12:42:04 +00:00
fvdl 6bf2c525a2 On the i386, enable swapspace as soon as the disklabel has been written,
to play nice with low-memory systems.

Add a md_pre_update() hook, to do MD things before an upgrade operation.
On the i386, use it to enable swap.
2000-09-26 23:12:44 +00:00
fvdl 40cd491caa Don't call test(1) to determine the existence/type of files, that's
rather over the top. Not doing this also means that test(1) can
be omitted from the ramdisks (for scripts it's not needed, because it
is built in to sh(1)).
2000-09-26 13:26:02 +00:00
hubertf 5fffd5f0c2 * Fix changing of /etc/rc.conf after the main file moved recently.
'rc_configured' is still changed via sed's s///, wscons=yes is appended
   via "echo >>".
 * make target-routines (target_expand(), and whatnot) work if no root
   disk was selected. With this, sysinst can now be used on a "normal"
   system to adjust the system's timezone. Use the entry in the "Utilities"
   menu for that.

Both changes were tested by a full i386 installation.
2000-09-20 19:53:35 +00:00
hubertf 71be3a3b99 When upgrading and /usr/X11R6/bin/X is a symlink, move it aside (X.old)
before extracting sets, and move it back afterwards, to save the information
which X server to use.

Adresses PR 10935 by Dan McMahill <dmcmahill@netbsd.org>
2000-09-08 02:50:42 +00:00
hubertf caa284ac57 * Add timezone-setting menu to sysinst, offering all timezones from
(/mnt)/usr/share/zoneinfo in a listbox, and setting (/mnt)/etc/localtime
   accordingly.
 * Adjust for the needed menuc change un run.c's log_flip() and script_flip()
   functions.

Related PRs:
 5777   sysinst does not offer to tweak /etc/localtime
 8099   changing the default time zone is non-obvious
 9910   sysinst doesn't ask about setting timezone
2000-08-15 01:08:00 +00:00
itojun 738859d74e do not skip IPv6 configuration menu on dhcp configuration.
do not save address/netmask/default router, if we got them from dhcp.
(we shouldn't do that).  if we keep any of dhcp config into /etc, we shoul
update rc.conf to run dhcp again.
2000-07-24 10:52:28 +00:00
cyber cbefbdefce dhclient support added
only invoked if dhclient is present on install image
2000-06-18 23:50:02 +00:00
thorpej 06f397e94e Allow for building with an alternate default FTP server and alternate
default FTP directory, based on mk.conf variables SYSINST_FTP_HOST
and SYSINST_FTP_DIR.
2000-03-24 21:56:04 +00:00
fvdl 97965ecea8 Convert ask_sizemult to take an argument, so that MBR using ports can
actually call it with the right sectors per cylinder size during
MBR partitioning.
2000-03-14 22:42:48 +00:00
mycroft c82f5a6009 In command execution displays, only draw a single line between the status
display and the output window, not a whole box.  This looks better, and it
works much better on terminals.
2000-01-13 18:52:21 +00:00
itojun 1c5b5f62fc enable IPv6 support in sysinst. integration of work by ichiro@ichiro.org.
- IPv6 autoconfiguration
- IPv6 nameserver
TODO: french messages, dhcp

add -DINET6 into x_ifconfig.
2000-01-04 08:33:51 +00:00
abs c15135486d Add generic make_bsd_partitions() in bsddisklabel.c useable by virtually all
orts. Since port specific information is in appropriate arch/.../md.h
bsddisklabel.c is currently #included by arch/.../md.c.
I'm not totally happy about this, but my concience is somewhat salved by the
overall reduction in breakage.
Initially only pmax, sparc, vax and x68k are using bsddisklabel.c.
While I'm here adjust defs.h for more than eight partitions in a generic
fashion.
1999-08-16 08:29:04 +00:00
cgd c624190287 convert run_prog's error message from being a "const char *" to a msg.
XXX Only the callers that actually pass strings were fixed, the rest were
XXX left passing 'NULL'.  Eventually they should be cleaned up to pass
XXX MSG_NONE, but I didn't want to do that yet because somebody else
XXX (jonathan) is hacking on the run_prog callers and I didn't want to
XXX cause him a Lot of conflicts.  at least right now, MSG_NONE and NULL
XXX are as equivalent as they need to be.
1999-07-04 21:39:33 +00:00
cgd 1904092f06 message const poisoning, and conversion from integers to an opaque
message type.
1999-07-04 21:32:48 +00:00
cgd 3528b5e0cf * make selection of 'none' for installation media type return the user
to the toplevel menu, as promised by the media selection menu, without
  first going through an "installation is aborted" menu.
* when something causes the installation to fail (e.g. missing set or failure
  to extract a set's contents), don't go through N menus
  (missing/failed/aborted, sets didn't install/aborted,
  sanity check failed/aborted) before getting back to the top level.  The
  user only needs to be told once that their life sucks.
1999-06-22 06:57:00 +00:00
cgd 72928b1093 nuke ask_ynquestion from orbit. not only was it bogus w.r.t. what is
allowed in C (see PR 6431), but it's also bogus w.r.t. sysinst's message
display style, etc.  XXX the French msg file needs translation.
1999-06-22 02:43:09 +00:00
cgd afa3578c2f provide a way to ignore tty-generated signals (INTR and QUIT) and/or
forward them on to subprocesses.  nice when running a subprocess in
a display window to allow the user to kill the subprocess w/o nuking
sysinst itself.  add handling for QUIT, which gets handled the same
as intr.  add handling for HUP which just cleans up.  More signals
should be handled.
1999-06-22 00:43:57 +00:00
cgd a640bc7014 copyright notice typo fixups, as noticed in PR#7248. This software
was developed, not develooped.
1999-06-20 06:08:13 +00:00
cgd 5e4db63c27 * when encoding an FTP url, if the path starts with a / put a %2F at the
start of the URL so that the request will start from / (rather than
  relative to the login directory; makes things work better for
  non-anonymous FTP).  To make it clearer what's going on, make the
  default path (used to get distribution bits) relative.  (according
  to the 1.4 LAST_MINUTE file, this is OK.)
* Also, %-encode passwords in FTP URLs (doesn't help actual security, but
  makes it slightly harder to figure out a password by reading over
  somebody's shoulder).
1999-06-18 23:26:40 +00:00
bouyer 8d7cb08335 Main change: add a cleanup_dist() function in util.c which will do the needed
cleanups before extracting a set. Should'nt do anything for an install,
as the filesystem shouldn't contain files that need to be removed.
cleanup_dist() is called before extract_file() for each set (the set name
is passed as parameter). It will open a file /dist/<set name>_obsolete
if it exists. This file should contain a list of files (absolutes
pathnames) that needs to be removed. cleanup_dist() will lstat() each file
to determine if it's there and if it's a directory or not.
It will then unlink() entries that are not directories and then rmdir()
directories. If a directory is not empty (it should now if the list of files
is correct) it will be renamed to <directory.old> and the user will be warned.

Other changes:
- move prototype of target_prefix() in defs.h, don't maintain a copy
  of it in each file.
- in install.c, after MSG_disksetupdone, do a wclear(stdscr) (display was
  clobbered after it).
- kill MSG_openmsgbuf, it's not used anywhere
- after MSG_disksetupdone in upgrade, don't call MENU_ok, do it the
  same way as in install.
- add wclear(stdscr);/wrefresh(stdscr); before calling MENU_distset (another
  display problem ...)
- While I'm there, move ask_verbose_dist() before MENU_distmedium. This way,
  if all go well the user can go away one ftp starts and come back once
  sets are extracted.
1999-04-13 20:17:47 +00:00
bouyer be743ed36b - Add 2 functions in label.c, getpartoff()/getpartsize() used to let the user
enter partitions offet and size. The user can chose unit independantly of
  the unit used for display ('M'/'c'/'s'). These functions do the proper
  bound checks and alignement/roudups. Used in the edfspart menu and
  i386 md_make_bsd_partitions() (other ports should do the change as
  well).
- now that getpartsize() does the rigth thing, kill the swapadj hack (which was
  buggy anyway).
- in i386 md_make_bsd_partitions(), don't propose defaults that don't fit on
  the disk. If the disk is too small, fallback to custom instead.
- fix a bug in mbr.c, where the partition flags would not have always been
  reset. sysinst created me a MBR with 2 active partition. The boot code
  doesn't like it :)
- added a message for eventual mount failures.
- killed donewfs and extracting messages, as we run  the commands in a
  subwindow these messages just flashed on the screen.
- Changes a few exit(1) to return(1), to give the user a second chance.
- added msg_clear() or wclear(stdscr) in a place or two, to make
  display a bit nicer.
- in run_cmd(), if the command succeeded, don't wait for the user to
  press enter.
1999-04-11 22:40:19 +00:00
bouyer 04f9354ab3 Some fixes for the do_install() function:
- Make all the functions called from do_install() return an error code,
  so that we can abort install if something went wrong.
- Add a 'errstr' argument to run_prog(), which if not NULL is displayed
  with msg_printf() and followed by process_menu(MENU_ok) if the command fail.
  Used to warn the user that the current action is aborted.
- in a few places use msg_display() or msg_printf() rather than printf.
  It seems that stdout/stderr are not always pointing to the active curses
  window.
- garbage-collecd unused messages, add a few new one (error handling).
XXX only tested on i386. Other md parts should be tested as well.
1999-04-09 10:24:38 +00:00
simonb e8f5904d9e Move prototype for disp_cur_part() from defs.h to mbr.h. 1999-04-05 06:59:36 +00:00
fvdl a5d73e00eb Rework the MBR code, and some of the labelling code.
* Use structures, not 2-dimensional arrays..
	* Use the DIOCGDEFLABEL ioctl to get the disk information,
	  to avoid confusion with (older) labels.
	* Don't ever call fdisk for partitioning. This was the
	  source of much confusion.
	* For the i386, use the BIOS geometry information passed by
	  the bootblocks.

Lots of things left to do, but it's a start.
1999-03-31 00:44:48 +00:00
fvdl a4ca20e23e Start cleaning up geometry code by storing the disk geometry in a structure
with proper names, not an integer array with is numerically indexed.
1999-03-14 14:19:05 +00:00
he ff15f486fc Move extern declaration of do_system() from run.c to defs.h, used by i386/md.c 1999-02-01 14:08:35 +00:00
garbled 865c31ac7b This change includes the following:
Scripting and logging functionality for sysinst.
Child programs are run in a "display window" so you can actually see what
	they did before the screen flashes back and you loose it all.
Lots of curses fixups.  Removed nasty endwins that mangled the tty upon
	rentry.
Change the yes/no box to accept Y or N, and not require cursor motion to
	decide one or the other.
Perform curses redraws when doing things that could cause the kernel to
	spew printfs onto your screen.
1999-01-21 08:02:17 +00:00
phil be6397e767 Implement a config file (-f file) option that overrides compiled in
defaults for things like rel (release number), ftp host, ftp prefix,
cdrom device, cdrom directory and others.
1998-10-25 19:15:04 +00:00
mark 0402c9b7d8 Add T_FILECORE to the DTYPE enum.
Add filecore to the fstype array.
1998-10-06 01:37:17 +00:00
mrg 58e5e70a16 remove bogus unnecessary "NetBSD-X.Y" directory from cdrom path; it will not exist for future cdroms 1998-06-22 12:18:52 +00:00
fvdl f998547470 Add MD cleanup function to do some thingd once the install is done.
Only implemented for the i386; behaviour for other ports is
unchanged. For the i386, make this function remove some extraneous
files in /, and frob rc.conf to have rc_configured=YES. The defaults
are reasonable, and it saves the user having to set TERM and mount
filesystems by hand in order to be able to edit /etc/rc.conf

(XXX not very clean, but it's a workaround to be more user-friendly
 for 1.3.2)

Also adapt a few messages slightly so they apply to both situations.
1998-05-15 15:12:29 +00:00
jonathan 98b0f2b8ad * Prune default CD path from "/Release/NetBSD/NetBSD-" back to "/NetBSD-".
* Add cp_to_target() to  copy a file from current root, to an absolute
  path relative to target root.

* Clean up alpha, arm32, i386, pmax MD code: use cp_to_target()
  NB: Alpha uses target_expand() when calling installboot.
* Add tests for target == current root. Intended to support
  `upgrade/reinstall' to current root, either for testing or easier
  minor-release upgrades. Only tested on pmax.
1998-02-20 02:33:51 +00:00
fvdl 9630119c6d * mount NFS directory to get the sets from read-only,
same for floppies (from Christoph Badura)
* allow user to run 'Configure network' multiple times, to correct errors
  for example.
* deal with network interfaces that need explicit media type selection
  (i.e. ask for it when it is needed, also store it in the generated
  /etc/ifconfig.blah file on the destination disk)
1997-12-26 01:58:44 +00:00
phil ead95231ed pc532 partitions and md stuff. 1997-12-10 04:36:19 +00:00
jonathan d7afdff3d0 * Add main menu option to reinstall sets or install additional sets.
(like upgrade but without trying to save etc.

* Add option to setls0urce menu to look in an already-mounted (local)
  directory.  Change `local fs' option to say umounted local fs.

* Change extract_file() to check that a tarball actually exists
  and give an explicit non-curses warning if it doesn't. (see above.)

* GNU tar returns a successful status if its gunzip child dies.
  Add short sleep() after tar commands in case of undetected errors.

* Change set-source selection code (except FTP, floppy) to check
  that the mandatory set files (base.tgz, etc.tgz) exist
  in the selected directory.  If they don't, warn the user and
  prompt the user to  change the selected directory.
  Give the user the option to explicitly continue even if
  base.tgz or etc.tgz not found, just in case.

* Change extract_file() to keep count of set unpacks that succeeded
  or failed. (Unreliable, given the broken return status of gnu tar.)
  Warn the user if there are errors and abort the installation/upgrade
  if we find any.  Does at least catch Ctrl-C interrupts of unpacking.

* Make unwind_mounts() signal-safe.

* Sense of target_verify_* is broken. Replace with predicates that
  return 1 iff the file or directory exists.

* Fix upgrade tests for existing etc.old (see above) before saving
  target /etc as /etc.old.

* Other detail fixes.
1997-12-05 14:00:59 +00:00
jonathan 7bd6655894 Add check for overlapping partitions:
* Add `partinfo' type, for description of a single partition,
   so we can pass labels by reference..
 * Add label.c with label initialization, naive overlap-check code,
   and a UI entrypoint edit_and_check_label() which iterates through
   checking a label for overlaps, and if any, giving the user the choice of
   fixing them or punting back to the main menu.
 * Change return type of md_make_bsd_partitions from void to int.
   Return 0 if the partition has problems (or the user gave up on it)
   and 1 if the partition is completed and looks OK.
 * Change install() to check return value of md_make_bsd_partitions().
   If it returns zero,  print an `abort' message and return to main menu.
 * Add label.c to all ports' Makefile.

MD code tested on pmax and cut-and-pasted to other ports.
1997-12-04 11:27:56 +00:00
jonathan fc3fa7cd7f Implement TODO item to unwind target mounts on completion:
* Add mount_with_unwind() that adds mountpoint to a LIFO queue
    of  mountpoints to undo on error.   Use in target_mount().
  * Add unwind_mounts() which traverses the LIFO queue and unmounts
    filesystems, silently ignoring errors.
  * create toplevel() function which displays banner message and
    calls unwind_mounts().
  * change toplevel menu to call toplevel() instead of inline banner.

Where to do unwinds needs more thought.  Perhaps we should only unwind
if an upgrade or install appears unsuccessful, so after a successful
install, the target is mounted (e.g., for upgrading /etc/rc.conf).
1997-12-04 09:05:35 +00:00
thorpej 75dd009b1d Update for the lay-of-the-land as described in release(7). As such, move
all pathname-on-server related definitions to MI code, since they are now
defined to be consistent across all platforms.  Also, nuke the "rels" global,
since release numbers are now always specified in "long form", i.e. 1.3A
vs. 13A.
1997-11-25 06:53:07 +00:00
phil 4ec8d82726 Clear up confusion of extract_dist() extract directory source. New var
ext_dir that is absolute directory name of where files are located to
extract.  All setup routines must set that directory name correctly.
Make target.c compile if DEBUG is set.
1997-11-11 00:43:31 +00:00
jonathan b3da2a1b88 Fix target prefixing to handle both root-in-swap (traditional miniroot)
and current-root-is-target-root (pmax diskimage.

 * Add code to check disk names (e.g., "sd0") against the current
   kern.root_device  sysctl (whic  does *not* include a partition).

 * Add new function must_mount_root():
   check to see if it's the same device as the root.  If not,
   the current and target root partitions cannot overlap.
   If they do, do statfs() on "/", and return 1 iff we get back
   "root_device" as the mounted-on filesystem, otherwise zero.

* Call must_mount_root() right after the user specifies a disk as
  install/upgrade target, and  if it returns 1, print a message asking
  them to mount root, and abort.

*  Use statfs("/")  mounted_from string to check if a disk partition
    (e.g., "sd0a") matches the current root.
1997-11-09 12:47:06 +00:00