Commit Graph

87 Commits

Author SHA1 Message Date
dsl 81c71a86b4 Make compile with WARNS=3 2004-10-16 13:20:10 +00:00
cube 0d27523fe4 dd->dd_no_mbr has to always be initialized. It doesn't default to 0 since
it is allocated on the stack.  Thus, allow editing the MBR partition table
on disks that actually have a MBR.
2004-05-18 14:07:06 +00:00
dsl 568270beb4 Parse a disk name of "raid:no_mbr" to mean "raid" but without any mbr
setup (on i386).  Allows sysinst to install to an existing RAID1 volume.
2004-05-15 21:53:29 +00:00
dsl ead1276789 'ptn' may be ' ' so sprintf(..., "/dev/r%s%c", disk, ptn) won't work!
Convert ' ' to 0 to ensure a valid device name is genarated.
(This will be a problem in 'upgrade' when filesystems are mounted
using the targets extisting /etc/fstab.)
2004-04-28 20:59:32 +00:00
dbj ebf6621efd fix typo when specifying raw partition for fixsb upgrade 2004-04-25 18:50:44 +00:00
dbj af071a423f fix bug with fixsb taking ptn+'a'
use union to align struct fs
don't check error return from fsck upgrade/downgrade runs
use RUN_DISPLAY | RUN_PROGRESS when running upgrade runs
don't use opendisk
2004-04-25 18:40:37 +00:00
dsl 24cedfbba2 Merge in code from my version of Darrin's fixsb routine (we both wrote
much the same function).
Mainly some extra comments, also moved a 'static' so we use 512bytes of
stack and not static data.  Killed call to access() as it is pointless
and doesn't do what you want (access is for suid programs to check whether
the real user could do the operation).
2004-04-25 17:15:27 +00:00
dbj b082781025 fix parenthesis in fixsb. oops 2004-04-24 20:54:26 +00:00
dbj c8025f6a1e ensure that sblk is 64bit aligned, fix suggested by dsl 2004-04-24 20:51:30 +00:00
dbj 4b198427c0 fix pread return check in fixsb. caught by dsl 2004-04-24 20:48:57 +00:00
dbj 41c60f0331 fixsb script for sysinst
addresses pr install/25138
2004-04-24 20:42:39 +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 6e14ab5068 Copy 'oldlabel' to 'newlabel' when we read it - should mean that
sysinst 'upgrade' will find the correct filesystem type and install
the correct boot code.
Fixes PR install/24812
2004-03-26 17:28:55 +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 98b66fc660 Use new kern.root_partition sysctl to find out whether we are installing
over the current root (ie the one we are booted from).
Remove all the stuff that tried to find this out by other means.
A few other message changes.
2003-09-27 10:47:17 +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
skrll 0dcbb09c7a Put a quote in the right place. 2003-08-04 09:23:50 +00:00
dsl faefcd3805 Force localfs_dir to be an absolute path - fixes PR install/14130.
Put disklabel info into /tmp/disktab in case / isn't writable,
fixes PR 17347.  Note the /etc/disktab isn't the target /etc anyway...
2003-07-27 08:57:27 +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 e64fcd4452 Use a menu when asking for the install disk (fixes PR install/20121).
Make disk_desc[], disk and numdisks local to get_disks (instead of globals).
Fix a little fallout from the above.
A bit of mbr.c was missing #ifdef BOOTSEL...
2003-07-11 15:28:58 +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 16a2d1e961 Add run-time selection of installation language.
Make 'doingwhat' an argument to find_disks() instead of a global.
2003-06-27 22:20:14 +00:00
dsl 855d662c15 Whitespace fixes 2003-06-16 20:10:02 +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 430c90c3f6 Correct check for active swap on install disk.
Use swapctl() for all swap operations.
Remove md_upgrade_mbrtype() from arc and hpcmips ports.
(I haven't finalised what I'm doing about type 165 partitions, but the
existing code is borked.)
2003-06-16 10:42:47 +00:00
dsl 44fa8ce69d Use dynamic menu to select partition to edit 2003-06-09 19:06:48 +00:00
dsl 99d1eb21d4 Add (back) support for mfs /tmp
Fix menu size so that user defined partitions can be allocated instead of
standard ones (need > MAXPARTITIONS entries in menu).
Make partition size info static - with a view to including it in a longer loop.
2003-06-06 21:37:13 +00:00
dsl 32fda96392 Remove a load of messages that are no longer used.
Make the French and Polish versions compile (seems I didn't fix it last time)
2003-06-06 14:31:22 +00:00
dsl d19795892c A rototil of the partition size requesting code. 2003-06-04 20:05:12 +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 4b8e98ee2a Further collapsing of MD code:
- make_bsd_partitions() correctly handles PART_BOOT
- use bsddisklabel.c for pc532 and sgimips (this does change the default size
  for the root partition, as it no longer includes twice the memory size).
- Change way ports define disk_names[] (in particular this lets me add "vnd"
  for testing), also ensures all ports pick up new drivers.
  I've make most ports use the default "wd", "sd", "ld".
  Abort the search for disk units if we get ENOENT (ie no /dev entry) to
  speed up the case where we are looking for a disk type that isn't
  supprted by the port.
  (it is possible we could just check all possible disks on all ports...)
2003-05-30 11:56:23 +00:00
dsl 1d6ff8632d White-space, buffer-overrun and long-line police,
Correct code that selects one of the available disks.
2003-05-18 20:04:21 +00:00
fvdl a51c2397e0 Don't bother looking at the superblock directly, just run fsck (and
not fsck_lfs or fsck_ffs), it'll figure it out. Also, upgrading from
the old inode format is only needed for 0.9 or older. Noone is going
to do that.
2003-03-18 01:13:23 +00:00
christos cc9b9c6553 hack to have only one copy of fstypenames[] 2003-01-12 21:49:50 +00:00
christos 2d7e213ded pass lint[pass1] 2003-01-10 20:00:27 +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 2df65a0a6e make mbr and disklabel editor consistently use Start, End, Size in
that order.

"offset" -> "start" where applicable.
2002-08-12 02:22:52 +00:00
scottr fc9da5f33b If a valid file system type is found for a particular partition but no
mount point was specified, make sure to add only a commented-out entry for
that partition when building fstab. This prevents sysinst from generating
an otherwise invalid fstab. This problem was originally reported by
Frederick Bruckman and fixed by Bob Nestor.
2002-06-30 04:02:47 +00:00
scottr 23b6b38874 Correct fsck_num() implementation; return the fs_passno value as defined
in fstab(5). Noticed by Frederick Bruckman.
2002-06-30 03:57:46 +00:00
scottr 2a946905e4 Back out last; inadvertantly committed. This will be resurrected
in the future, in all likelihood, but it wasn't ready yet.
2002-06-29 20:16:41 +00:00
scottr 7de06b16d5 If a valid file system type is found for a particular partition but no
mount point was specified, make sure to add only a commented-out entry for
that partition when building fstab. This prevents sysinst from generating
an otherwise invalid fstab. Bob Nestor found this while working on sysinst
for mac68k, and as such there is no corresponding PR.
2002-06-29 20:12:57 +00:00
mrg 1f4e0ae80c fix compile lossage on i386.
move some data & a function from bsddisklabel.c to disks.c.
2001-01-14 23:45:16 +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
mrg 900169f00c minor KNF. 2000-12-06 04:53:37 +00:00