summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-05-31 13:06:18 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-05-31 13:06:18 +0200
commit82aa1d5c786dec9d6e57c5a8cf9859ee787c99de (patch)
tree4025f3a950d7e2ee9e6c48601b20cc91ee113139
parent3e124e1f13b945a020d973052069b9d3b673d814 (diff)
downloadplan9front-82aa1d5c786dec9d6e57c5a8cf9859ee787c99de.tar.xz
integrate disk/edisk with diskparts, bootfs and installer (gpt support)
-rwxr-xr-xrc/bin/diskparts3
-rwxr-xr-xrc/bin/inst/partdisk14
-rw-r--r--sys/src/9/boot/bootfs.proto1
3 files changed, 13 insertions, 5 deletions
diff --git a/rc/bin/diskparts b/rc/bin/diskparts
index 9fc5de124..e4baa6494 100755
--- a/rc/bin/diskparts
+++ b/rc/bin/diskparts
@@ -8,7 +8,8 @@ rfork e
# no plan 9 partition table will delete all extant partitions.
fn setup {
if(test -f $1/data && test -f $1/ctl)
- { disk/fdisk -p $1/data |
+ {@{disk/edisk -p $1/data
+ || disk/fdisk -p $1/data} |
grep -v '^delpart ' >$1/ctl } >[2]/dev/null
if(test -f $1/plan9)
parts=($1/plan9*)
diff --git a/rc/bin/inst/partdisk b/rc/bin/inst/partdisk
index 2604965c1..cea2136d8 100755
--- a/rc/bin/inst/partdisk
+++ b/rc/bin/inst/partdisk
@@ -17,7 +17,8 @@ case go
for(i in $disks) {
desc=`{cat /dev/$i/ctl | sed 1q | sed 's/inquiry //'}
echo $i '-' $desc
- echo e | disk/fdisk -r /dev/$i/data >[2]/dev/null | grep -v '^ mbr'
+ @{disk/edisk -r /dev/$i/data
+ ||disk/fdisk -r /dev/$i/data} </dev/null >[2]/dev/null | grep -v '^ mbr'
echo
}
@@ -44,13 +45,18 @@ case go
pickdisk=done
}
}
+
+ diskedit=disk/fdisk
+ if(disk/edisk -p /dev/$disk/data >/dev/null >[2=1])
+ diskedit=disk/edisk
+
echo
- echo 'This is disk/fdisk; use it to create a Plan 9 partition.'
+ echo 'This is '$diskedit'; use it to create a Plan 9 partition.'
echo 'If there is enough room, a Plan 9 partition will be'
echo 'suggested; you can probably just type ''w'' and then ''q''.'
echo
- disk/fdisk -a /dev/$disk/data
- disk/fdisk -p /dev/$disk/data >/dev/$disk/ctl >[2]/dev/null
+ $diskedit -a /dev/$disk/data
+ $diskedit -p /dev/$disk/data >/dev/$disk/ctl >[2]/dev/null
for(i in /dev/sd*/plan9*){
if(test -f $i){
d=`{basename -d $i}
diff --git a/sys/src/9/boot/bootfs.proto b/sys/src/9/boot/bootfs.proto
index 33df1759f..02ca92979 100644
--- a/sys/src/9/boot/bootfs.proto
+++ b/sys/src/9/boot/bootfs.proto
@@ -13,6 +13,7 @@ $objtype
cryptsetup
dd
disk
+ edisk
fdisk
prep
dossrv