use stdscr's maxx and maxy to set up the message window rather than hard
coding 78 and 22, respectively. The latter, combined with large messages
and a relatively small screen (and perhaps badly-placed menus), would seem
to cause the SEGVs reported in PR#7806. (For certain window sizes, the
menu system would reject the menus as too small, but for others sysinst
would just crash.)
password, offer defaults. When displaying the current values, note
that a password has been set and is hidden, rather than displaying
the number of characters entered for the password. (Thanks to wrstuden
for the translation of "hidden"...)
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).
be called. it'd cleanup() then exit(). however, cleanup() is scheduled
to run at exit via atexit(). This means that it gets run twice, and
this causes confusion for things like endwin(). The end result is
that rather than actually exiting and printing the "sysinst terminated"
message, after one control-c it looks like it's still sitting at the
last screen you were viewing even though it's actually at a shell prompt.
squelch the cleanup() in the SIGINTR handler to avoid this problem.
* while here, nuke the annoying space before the "sysinst terminated."
message. it looks bad, and serves no purpose.
read/write that much. Previously, too much was written back to
disk (although it didn't do any harm because of the sequence
of execution).
Also, upgrade the MBR type from 386bsd -> NetBSD if needed during
an upgrade operation.
Check if there's no active partition after MBR editing.
Ask for own MBR to be installed if we're booting from out of CHS range.
Ask for bootselector to be installed if > 1 OS, and configure it.
tables being written on disk:
- when counting non-BSD partitions, use part[i], not part[0]
- when using full disk for NetBSD, initialise all the fileds of the
mbr entries (especially flags)
- When converting to on-disk format, if start and size = 0, initialise
c/h/s to 0 for both start and end. convert_mbr_chs() would make an entry
0/0/0, 0/0/1 which is not bogus, but not what we really want either.
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.
- in run_prog(), do an explicit wclear(stdscr); wrefresh(stdscr);
before launching subwindows. This seems to solve all the display
problems associated with run_prog().
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.
- 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.
* 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.
encoded. This means certain passwords, usernames, etc., will not work
with "ftp ftp://...."
This code, submitted by Alan Barrett <apb@iafrica.com>, fixes this by
hex encoding unsafe strings in a clean fashion. This should close a
couple of outstanding PRs. Thanks Alan!
commandlines for all tar operations. (work supplied by Matt Green)
2) Update arch/*/md.c to deal with new sysinst/run.c. Special case
anything that needs to do a redirect or a pipe.
3) #if 0 some unused code in target.c. This code will need to be updated,
or special cased with do_system.
Big thank you to Matt for all his work on this.
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.
non-soft-settable media. Treat that as if there was no media output.
Use a supplied media-string of "<null>" or "<default>" or synonyms to
avoid passing explicit media flags onto ifconfig.
just what the hell sysinst is asking for. (Why do we include the
`dangerously dedicated at all?)
Fix dangerous UI botch: make `normal' install the default, not `whole disk'.
i386) so that the partition menu items match the selector letters).
XXX: All the .fr files need checking - look for the comment
/* XXX: ENGLISH -> FRENCH */
Replace with MAX_DISKS (size of the array of disk info).
Fixes a problem where sysinst cannot install onto disks rz5 or greater
on pmaxes (which use old SCSI with wired-down scsi devices, even for
GENERIC kernels).
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
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.
hack to enable this to work when included from a different directory.
Idea: if the crunchgen(1) child were to cd to the target directory
just prior to executing its manufactured Makefile, then problems
like this might not occur.
* Split bios geometry and MBR partition editing code formerly in
arch/i386/{md,fdisk}.c to mbr.c in mi directory.
* Leave /sbin/fdisk parsing/handling code in separate file,
we may want to change it later. move to mi directory.
* Create mbr.h with declarations for MBR/BIOS-geomotry code.
#include "mbr.h" in i386 md.h.
* Use symbolic names for 386bsd and new NetBSD partition IDs.
Handle MBRs with both 386bsd and NetBSD partitions less stupidly.
in menus.md.{eng,fr}, lifted verbatim from Alpha and pmax.
Give last split-floppy for each X11 set, for 1.3.
FIXME: if the number of floppies in any split set changes for 1.3.1,
syinst is hosed for 1.3.1. Same is true for any release: we can't
install from split sets if the count of floppies doesn't match
the precompiled version.
The number of floppies in a split set should be computed dynamically
from a directory listing, or read from a config file in the split
directory.
* 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.