From c577fffb34cd2b53d270bd969fdac41b1aea43f4 Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Thu, 16 Feb 2017 00:07:56 +0100 Subject: [PATCH] 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. --- disk-create.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/disk-create.sh b/disk-create.sh index 53dce92..adace0e 100755 --- a/disk-create.sh +++ b/disk-create.sh @@ -26,9 +26,9 @@ if [ "$TRAVIS_BUILD_DIR" != "" ]; then syslinux --help ls $SYSLINUXBIOS ls $SYSLINUXMBR - echo "Fdisk's version, supported options" - /sbin/fdisk --version - /sbin/fdisk --help + echo "Fdisk's version, supported options, help" + /sbin/fdisk -v + /sbin/fdisk -h fi @@ -60,7 +60,6 @@ if [ ! -f $DISK ]; then +40M #reserve 40 megabytes t #change type c #W95 FAT32 (LBA) - a #make it bootable n #new partition p #primary partition 2 #partition 2 @@ -69,6 +68,8 @@ if [ ! -f $DISK ]; then t #change type 2 #partition 2 39 #Plan 9 + a #set bootable partition + 1 #partition 1 p #print partition table w #write partition table q #quit @@ -143,7 +144,7 @@ sleep 60 echo halt >> /srv/hjfs.cmd sleep 20 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 dd bs=440 count=1 conv=notrunc if=$SYSLINUXMBR of=$DISK else