Browse Source

Adds script to flash haiku to the usb disk

main
Abhas Abhinav 2 years ago
parent
commit
0b1bfa2ef1
1 changed files with 74 additions and 0 deletions
  1. +74
    -0
      flash-haiku.sh

+ 74
- 0
flash-haiku.sh View File

@ -0,0 +1,74 @@
#!/bin/bash -v
echo 2>&1
usb=$1
if [ $UID -gt 0 ]
then
echo "Please run as root."
echo "Usage: sudo ./flash-haiku.sh <device>"
exit 1
fi
if [ -z $usb ]
then
echo "Usage: sudo ./flash-haiku.sh <device>"
exit 1
fi
## Paritition disk
### Show existing partition table
gdisk -l /dev/$usb
### Create the new parition for haiku main
echo "
n
3
+1000M
w
Y
" | gdisk /dev/$usb
#### Run partprobe to refresh partition list
partprobe /dev/$usb
gdisk -l /dev/$usb
sleep 2
#### Create parition for haiku efi
echo "
n
w
Y
" | gdisk /dev/$usb
sleep 2
#### Refresh and print partitions
partprobe /dev/$usb
gdisk -l /dev/$usb
echo; echo;
## Copy Haiku Main to the 3rd partition
dd if=MH-USB/haiku-main.img of=/dev/"$usb"3 status=progress bs=1M
## Copy Haiku EFI to the 4th partition
dd if=MH-USB/haiku-boot.img of=/dev/"$usb"4 status=progress bs=1M
echo "Haiku Installed to $usb"

Loading…
Cancel
Save