diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-07-08 16:19:15 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-07-08 16:19:15 +0200 |
commit | 677dd90b029cc7e11020af220bbcdd2f6028db45 (patch) | |
tree | 796e44bb8c458f8b2dc32bbce2b5c33e257f2098 /sys/src/cmd | |
parent | 49cd794fbdd661e8035eee41d053fedc30a5e165 (diff) |
disk/prep: if no 9fat, reserve space for plan9 partition table in autopart (thanks Shamar)
usually, the plan9 partition table is contained in
the first 9fat partition after the pbs/fat header,
but when no 9fat partition is requested, we have
to make sure partitions wont overlap the partition
table (start at sector offset >= 2).
Diffstat (limited to 'sys/src/cmd')
-rw-r--r-- | sys/src/cmd/disk/prep/prep.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/src/cmd/disk/prep/prep.c b/sys/src/cmd/disk/prep/prep.c index 8bd60c021..deab64f34 100644 --- a/sys/src/cmd/disk/prep/prep.c +++ b/sys/src/cmd/disk/prep/prep.c @@ -432,6 +432,11 @@ autoxpart(Edit *edit) } s = 0; + if(autox[0].alloc == 0){ + /* if no 9fat, reserve space for plan9 partition table */ + s = 2; + if((s + pa) % stride) s += stride - (s + pa) % stride; + } secs = edit->disk->secs; for(i=0; i<nelem(autox); i++){ if(autox[i].alloc == 0) |