Fix check for root being entirely inside the area that can be read on

systems where the bios doesn't support LBA reads.
Due to faked geometries the last few (over 30000!) sectors may not be reported
as being readable, but we expect them to be in swap.  So we don't force a
root+usr install in that case.
This commit is contained in:
dsl 2005-11-05 09:55:34 +00:00
parent e54d906c60
commit f95e28696d
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bsddisklabel.c,v 1.35 2005/09/11 20:38:26 dsl Exp $ */
/* $NetBSD: bsddisklabel.c,v 1.36 2005/11/05 09:55:34 dsl Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -397,6 +397,8 @@ get_ptn_sizes(int part_start, int sectors, int no_swap)
/* Make size of root include default size of /usr */
pi.ptn_sizes[PI_ROOT].size += pi.ptn_sizes[PI_USR].dflt_size;
sm = MEG / sectorsize;
if (root_limit != 0) {
/* Bah - bios can not read all the disk, limit root */
pi.ptn_sizes[PI_ROOT].limit = root_limit - part_start;
@ -404,7 +406,7 @@ get_ptn_sizes(int part_start, int sectors, int no_swap)
* everything except swap.
*/
if (pi.ptn_sizes[PI_ROOT].limit
+ pi.ptn_sizes[PI_SWAP].size > sectors) {
< sectors - pi.ptn_sizes[PI_SWAP].size * sm) {
/* Root won't be able to access all the space */
/* Claw back space for /usr */
pi.ptn_sizes[PI_USR].size =
@ -418,7 +420,6 @@ get_ptn_sizes(int part_start, int sectors, int no_swap)
}
/* Change preset sizes from MB to sectors */
sm = MEG / sectorsize;
pi.free_space = sectors;
for (p = pi.ptn_sizes; p->mount[0]; p++) {
p->size = NUMSEC(p->size, sm, dlcylsize);