installboot: allow installation into disk

Previously, installboot would require that the given target device is
a partition. This is not strictly necessary: MINIX3 can also be
installed (manually) into one or more primary partitions, requiring
that the installboot target be the entire disk. With this patch,
specifying a disk as target is now allowed, as long as the -f (force)
option is given.
This commit is contained in:
David van Moolenbroek
2013-02-16 22:58:53 +01:00
parent c3ae1bdfcd
commit 16440d9b8f
3 changed files with 77 additions and 52 deletions
+2 -2
View File
@@ -245,13 +245,13 @@ main(int argc, char *argv[])
mode = O_RDWR;
}
if (minixfs3_is_minix_partition(params->filesystem)) {
if (minixfs3_is_minix_partition(params)) {
/* Old setups has just 1 sector for bootblock,
* but bootxx_minixfs is ~8Kb, so we require new setups
* to have 32 sectors before the first subpartition.
* This prevents from overwriting FS on old setups.
*/
if (!minixfs3_has_bootblock_space(params->filesystem)) {
if (!minixfs3_has_bootblock_space(params)) {
err(1, "No space for bootxx, you should have 32 sectors"
" before the first subpartition on %s",
params->filesystem);