Commit Graph

47 Commits

Author SHA1 Message Date
dsl 3650a70127 Allow the user to change the partition type from FFSv1 to FFSv2
Should fix install/29693
2005-03-14 21:37:43 +00:00
dsl 9146a4af0b Default to using 2k fragments (16k blocks) on filesystems that are >1GB.
Matches the defaults advertised in the newfs(8).
Perry keeps on asking me to do this :-)
2005-01-20 21:59:35 +00:00
dsl 81c71a86b4 Make compile with WARNS=3 2004-10-16 13:20:10 +00:00
dsl 29306cabe7 Default to input in MB for all architectures (MB are cylinder aligned).
Move info about cylinders to the 'ask for units' menu.
  (translations need checking, done by cutting sentences)
Stop i386 always asking for units.
Use BIOS cylinders for MBR and disk cylinders for the disklabel.
  (code intended to do this, but got it wrong...)
Mark some menus as 'sub menu' or MC_SUBMENU so that the screen underneath
  is saved.
Add GENERIC.MPACPI to i386 menu.
2004-08-14 16:06:36 +00:00
dsl ad184b340b Kill emptylabel() is doesn't DTRT since it doesn't know the size of the array.
Fixes breakage caused by copying oldlabel to bsdlabel for update.
Don't look for 'last mounted' in first alternate superblock.
2004-03-26 19:55:13 +00:00
dsl 31d8f670de - Change enum for partition numbers from [A..Z] to PART_[A..P] (16 is enough)
- Rename run_prog() to run_program() and remove the 'errmsg' argument (almost
  never used).
- Be consistent about #define<space> in defs.h
- Allow BSDFFS partitions to be FFSv1 or FFSv2 (fixes PR install/23547)
- i386: install correct bootblocks for root filesystem type.
- Do 'fsck -p' before all mounts (but never a full fsck), rename fsck_xxx()
  to mount_xxx() and remove some wrapper functions.
- Allow root to be an APPLEUFS partition - and allow them to be newfsed,
  should fix PR install/23198
- Redo fstab processing for upgrade to avoid large static data items and
  memory leaks.  Change walk() to abort on user defined error.
  (the fstab stuff really needs more work though...)
- i386: 'Warp' cursor to alternate option when selecting console/bootblocks,
  should fix PR port-i386/23546.
- Allow MENU_ok and MENU_yesno to take user defined title.
- Ensure that mountpoint not defined for swap (and similar issues) when
  editing netbsd label.
- Tweaks to error handling in run_program(), allow user to say that errors
  are expected or that the display shouldn't be cleared before returning.
- Remove some old code that has been festering under #if 0
2003-11-30 14:36:43 +00:00
dsl 7ef7a3f227 Checkpoint a load of changes - seems to work ok still.
- rework run_prog() so that the program name (etc) is usually displayed if
  the program generates any output, or terminates with an error.
  Allow arguments to included in single quotes.
  Try to collect console output so it doesn't interfere with curses.
- Add a '*' to the cylinder count if non-integral number of cylinders
  (on disklabel editor)
- Only show partition type for unused partitions.
- Show size including unused space on '+' partition, remove a..z since
  the don't relate to partition IDs (netbsd partition sizes)
- Fix deleting of 'user' partitions - killed size of next ptn.
- Don't default a swap partition is the disk already has one.
- Fix deleting of extended MBR partitions - changed size of ptn 2.
- Show error message if user tries something illegal in mbr editor.
- Default to old diskname (actually disk type - dunno why!)
- Use MI enable_rc_conf() to set RC_CONFIGURED=YES, use a single sed
  command instead of a raft of code playing with files etc.
- Float some menus to just below header text, saves counting and lets
  language variants have different height headers (use y=-1)
- Track whether anything is mounted on /mnt2 better.
- Put more texts into message file.
- Change english prose texts to be more correct.
- Stop french and polish versions core dumping if ptn start/size changed.
- Fix processing logic for saving /etc (action is still borked)
- Do tail-end setup if any sets (eg X) can't be found (but not if you give
  in (yet)).
2003-10-19 20:17:31 +00:00
dsl b2fa78b58e Let noexec, nodev and nosuid be written to /ets fstab entries
Always use 1023 cylinders in mbr for large disks
2003-08-10 14:51:48 +00:00
dsl fe536754c3 Allow user to shoot themselves in the foot by specifing a non-standard
'average bytes per inode' for each partition.
Fixes PR install/8509
2003-08-09 21:36:26 +00:00
dsl 117888d14f When writing /etc/fstab:
add support for setting mount options of async, noatime, nodevmtine and softdep.
add noauto if 'mount' was not requested.
add entry for /proc (with noauto)
Display fragment size and block size on the correct line.
Ask for numeric fragment size (not # fragments/block).
Show one unused partition when editing disklabel.
Zap all fields when a partition is made FS_UNSED.
Tweak some menu texts (a space at the end of a line causes a line break!).
Simplify code that displays output from commands - curses is requied to not DTRT
with CR/LF sequences, I need to revert libcurses :-(
2003-08-05 13:35:26 +00:00
dsl 96ace5d58c Remove 'menu_ent' parameter from action routines.
Add menu for all disklabel partition types.
Default 'partition type' and 'sizechoice' menus to current value.
Change 'standard/use existing' to 'set sizes/use existing'.
2003-07-27 07:45:08 +00:00
dsl 7f5beafa6b Sprinkle a load of consts, and change a few variable names.
Now compiles with WARNS=3.
2003-07-25 08:26:21 +00:00
dsl 6da321c1aa Sort out (and remember) the disk partition we will install into.
This should stop the i386 code splatting all over the start of the disk
during upgrade.
Upgrade will still use partition 'a' (unless you loop through the install
far enough first!)
2003-07-08 17:38:54 +00:00
dsl 0e919832bd Another pass of the rototiller. Mainly:
1) New MBR editor
2) Hierarchic timezone menu
2003-07-07 12:30:19 +00:00
dsl 5363c7e2ee Pull texts from MI menus into language dependant text files.
Minor change to name of some strings (eg: MSG_yes -> MSG_Yes == "Yes")
2003-06-27 13:36:04 +00:00
dsl 24a3da65f0 Fix some typos 2003-06-16 20:11:40 +00:00
dsl 08fc1c1957 A load of KNF changes, plus a couple of strnxxx => strlxxx my fingers did
on the way through.
2003-06-16 19:42:13 +00:00
dsl 608254d0b8 rototil of the set selection menu
I've also made the set selection happen first.  This lets me test it!
also measn the selected sets could be used in the disk partition code.
Removed the 'with X' disk layout question (now too late to change the sets).
2003-06-11 21:35:35 +00:00
dsl 3316b2a3d8 Use dynamic menu for final editing of partition stable 2003-06-10 17:47:15 +00:00
dsl 44fa8ce69d Use dynamic menu to select partition to edit 2003-06-09 19:06:48 +00:00
dsl 19b2fb2fb0 Add NULL to all process_menu() calls - value is passed through to the
action routine.
Make the french and polish versions compile.
NB needs a new version of menuc - so need 'build.sh tools'
2003-06-03 11:54:48 +00:00
dsl 6fb33c4537 Reduce the number of global variables slightly, use the ones that are
left consistently.
Make the i386 install let you partition a disk beyond the CHS limit if the
system bios doesn't support LBA reads (the checks aren't ideal yet).
Make the bsddislabel.c code usable onan i386 system - but don't use it yet.
2003-05-21 10:05:20 +00:00
christos 774782c3bc Make everything compile again. All platforms compile on i386 now. 2003-01-11 19:44:04 +00:00
christos 2d7e213ded pass lint[pass1] 2003-01-10 20:00:27 +00:00
jdolecek b42b75087b make the description text for special label offset a bit more explicit
adresses install/13026 by John P. Refling
2002-12-23 10:29:57 +00:00
fvdl 171b46b525 FILE *log -> FILE *logfp, to avoid warnings about gcc-current's
builtin log() function.
2002-12-05 01:17:15 +00:00
grant 39427aa237 whitespace and comment cleanup. 2002-07-29 01:30:25 +00:00
wiz 5db23d2c5d enouth -> enough. 2002-07-26 01:00:39 +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 8a696e8ea8 Improve labelling a bit, by allowing some shortcuts to start partitions
where another one ends, and ending partitions where another one start,
or at the start of the disk / until the end of the disk.
2000-10-17 19:44:28 +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 3fd1dc7ed3 Create the disktab file directly, no need to waste precious inodes/space
in ramdisks with disktab.preinstall.
2000-10-11 22:58:17 +00:00
jdc de76a33270 Support ports which don't have 8 partitions/disk. 1999-08-21 19:19:23 +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 a640bc7014 copyright notice typo fixups, as noticed in PR#7248. This software
was developed, not develooped.
1999-06-20 06:08:13 +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
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
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
jonathan 9f856c8207 Fix sneezo during commit. 1998-11-08 02:56:27 +00:00
jonathan 8b4f18eb50 Pull up change from arm32 version: only copy disktab.preinstall if not DEBUG.
Pull up rev 1.3 from arch/sparc/md.c version:
    add a "ta=4.2BSD" to disktab. fixing choosing X sets to install.
1998-11-08 02:06:27 +00:00
mrg d1b0d1b602 KNF. 1998-06-20 13:05:48 +00:00
fvdl 65295d9fb4 Fix typo that made label overlap check unreliable. 1997-12-18 11:54:11 +00:00
simonb c483af0a08 Fix typo in partition overlap checking - the inner loop check for
boringpart used the outer loop variable.
1997-12-05 14:46:01 +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