lang: core: embedded: provisioner: Don't provision to USB disks
This should hopefully skip over any USB drives. Of course if we actually want to provision to a USB drive, then we'll have to add a feature flag for that.
This commit is contained in:
@@ -73,6 +73,21 @@ firewall --enabled --service=mdns
|
||||
# partitioning
|
||||
#
|
||||
# TODO: add more magic partitioning schemes
|
||||
|
||||
%pre --interpreter=/bin/bash
|
||||
# detect all USB disks using udevadm (we want to ignore ipxe disks for example)
|
||||
usb_disks=$(for dev in /sys/block/sd*; do
|
||||
devname=$(basename "$dev")
|
||||
if udevadm info --query=property --name=/dev/$devname | grep -q '^ID_BUS=usb'; then
|
||||
echo -n "$devname"
|
||||
fi
|
||||
done | paste -sd, -)
|
||||
|
||||
# Output the ignoredisk directive to a temporary file.
|
||||
echo "ignoredisk --drives=${usb_disks}" > /tmp/ignoredisk.ks
|
||||
%end
|
||||
%include /tmp/ignoredisk.ks
|
||||
|
||||
zerombr
|
||||
clearpart --all --initlabel --disklabel={{ if .bios }}msdos{{ else }}gpt{{ end }}
|
||||
{{ if eq .part "btrfs" -}}
|
||||
|
||||
Reference in New Issue
Block a user