aboutsummaryrefslogtreecommitdiff
path: root/editbootinstall_rpilegacy.sh
blob: dfa178fba4bb59cd4da6cdc6c038ab88bec96439 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
set -euxo pipefail

diskname=$1
devname="$2"
loopname="${devname%*p?}"
loopdev=/dev/${loopname#/dev/*}

#==========================================
# Force the ESP to use legacy MBR identifier
#------------------------------------------
#
# Raspberry Pi 3 and older systems don't handle
# the 0xef partition type for the ESP, so switch
# to the legacy one.
#
sfdisk --change-id ${loopdev} 1 6