disk-create.sh: hack fdisk calls for compatibility

The fdisk version in Ubuntu trusty (provided by travis-ci) is different enough
from the one shipped with Debian Jessie to require few careful changes.

With this commit disk-create.sh should work on both version in the same way.
This commit is contained in:
Giacomo Tesio 2017-02-16 00:07:56 +01:00
parent 4c045a3f64
commit c577fffb34

@ -26,9 +26,9 @@ if [ "$TRAVIS_BUILD_DIR" != "" ]; then
syslinux --help syslinux --help
ls $SYSLINUXBIOS ls $SYSLINUXBIOS
ls $SYSLINUXMBR ls $SYSLINUXMBR
echo "Fdisk's version, supported options" echo "Fdisk's version, supported options, help"
/sbin/fdisk --version /sbin/fdisk -v
/sbin/fdisk --help /sbin/fdisk -h
fi fi
@ -60,7 +60,6 @@ if [ ! -f $DISK ]; then
+40M #reserve 40 megabytes +40M #reserve 40 megabytes
t #change type t #change type
c #W95 FAT32 (LBA) c #W95 FAT32 (LBA)
a #make it bootable
n #new partition n #new partition
p #primary partition p #primary partition
2 #partition 2 2 #partition 2
@ -69,6 +68,8 @@ if [ ! -f $DISK ]; then
t #change type t #change type
2 #partition 2 2 #partition 2
39 #Plan 9 39 #Plan 9
a #set bootable partition
1 #partition 1
p #print partition table p #print partition table
w #write partition table w #write partition table
q #quit q #quit
@ -143,7 +144,7 @@ sleep 60
echo halt >> /srv/hjfs.cmd echo halt >> /srv/hjfs.cmd
sleep 20 sleep 20
EOF EOF
OFFSETSECTOR=`echo p |/sbin/fdisk $DISK|grep 40M|awk '{print $3}'` OFFSETSECTOR=`echo p |/sbin/fdisk $DISK|grep img1|awk '{print $3}'`
syslinux --offset $(($OFFSETSECTOR*512)) $DISK syslinux --offset $(($OFFSETSECTOR*512)) $DISK
dd bs=440 count=1 conv=notrunc if=$SYSLINUXMBR of=$DISK dd bs=440 count=1 conv=notrunc if=$SYSLINUXMBR of=$DISK
else else