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.