Date: Wed, 04 Nov 2009 09:48:56 -0800 From: Julian Elischer <julian@elischer.org> To: "M. Warner Losh" <imp@bsdimp.com> Cc: arch@FreeBSD.org, marcel@FreeBSD.org Subject: Re: fdisk behavior hack Message-ID: <4AF1BE88.2080506@elischer.org> In-Reply-To: <20091104.101207.-1398301090.imp@bsdimp.com> References: <20091104.101207.-1398301090.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
M. Warner Losh wrote: > Greetings, > > Enclosed please find a hack to the behavior of fdisk. On !x86, !ia64 > platforms, you can't do a "fdisk -I da0" because there's not > /boot/mbr. It is perfectly valid to make disks that don't have any > boot code on them (say if you are an ARM or MIPS embedded machine). > > This patch changes things. Currently, for all patforms except ia64 we > open the specified file (defaulting to /boot/mbr). If it doesn't > exist or we can't read it, we die. Then we do a bunch of sanity > checking on the MBR that was read in. On ia64 we just make a fake one > and return (we don't use the -b argument at all!). I'd say that you could make a valid readable disk without teh boot code even on x86.. just give a big warning. "No boot code available. Disk will not be bootable" > > I'd like to propose something simpler. > > I'd like to propose that for !i386 and !amd64 we allow the open and/or > stat to fail. If the user specified the -b flag, the same thing as > the !ia64 case will happen as today: they get an error and the program > refuses to work. If no -b flag was specified, then we'll use the > current ia64-only code to fake up a 'good enough' MBR and proceed. > > This will allow non-x86 platforms that install fdisk to still > initialize a disk in the face of the missing template mbr file. > > Comments? > > Code Review? > > Warner > > > ------------------------------------------------------------------------ > > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4AF1BE88.2080506>