Hyperv Debian + UEFI
This commit is contained in:
@@ -5,11 +5,11 @@ iso = {
|
||||
checksum = "477f50617d648e46d6e326549aa56ab92115a29a97f2ca364e944cea06970608"
|
||||
}
|
||||
boot_command = [
|
||||
"<tab><wait> net.ifnames=0<wait> <wait>bi<wait>osdevnames=0<enter>",
|
||||
"<wait60>", # Wait for system to come up?
|
||||
"curl <wait>-o <wait>/tmp/install.sh <wait>http://{{ .HTTPIP }}<wait>:{{ .HTTPPort }}/install.sh<enter>",
|
||||
"e<down><down><down><end> net.ifnames=0 biosdevnames=0<f10>",
|
||||
"<wait30>", # Wait for system to come up?
|
||||
"curl -o /tmp/install.sh http://{{ .HTTPIP }}:{{ .HTTPPort }}/install.sh<enter>",
|
||||
"<wait5>",
|
||||
"/usr/bin/bash <wait>/tmp/install.sh <wait>{{ .HTTPPort }} <wait>{{ .HTTPIP }}<enter>"
|
||||
"/usr/bin/bash /tmp/install.sh {{ .HTTPPort }} {{ .HTTPIP }}<enter>"
|
||||
]
|
||||
http_directory = "distros/archlinux/rolling/http/"
|
||||
boot_wait = "10s"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
disk="${1}"
|
||||
#disk="${1}"
|
||||
|
||||
# Set locale info to reasonable defaults
|
||||
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
|
||||
@@ -27,10 +27,10 @@ systemctl enable NetworkManager
|
||||
|
||||
# Configure and install grub
|
||||
sed -i -E -e 's/GRUB_CMDLINE_LINUX="(.*)"/GRUB_CMDLINE_LINUX="\1 net.ifnames=0 biosdevnames=0"/' /etc/default/grub
|
||||
grub-install --target=i386-pc "${disk}"
|
||||
grub-install --target=x86_64-efi --efi-directory /boot
|
||||
grub-install --target=x86_64-efi --efi-directory /boot --removable
|
||||
grub-mkconfig -o /boot/grub/grub.cfg
|
||||
|
||||
|
||||
# Create and configure the vagrant user
|
||||
groupadd vagrant
|
||||
useradd vagrant -g vagrant -G wheel -m
|
||||
@@ -48,4 +48,4 @@ if [ "${virt}" == "microsoft" ]; then
|
||||
systemctl enable hv_fcopy_daemon
|
||||
systemctl enable hv_kvp_daemon
|
||||
systemctl enable hv_vss_daemon
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -17,29 +17,33 @@ fi
|
||||
|
||||
# The sed bit is just to strip out the extra fluff, like comments
|
||||
sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk ${disk}
|
||||
o # create new GPT partition table
|
||||
g # create new GPT partition table
|
||||
n # new
|
||||
p # primary partition
|
||||
1 # part number
|
||||
# default partition number
|
||||
# default start
|
||||
+512M # size
|
||||
t # set type
|
||||
1 # EFI system partition
|
||||
n # second partition
|
||||
# default partition number
|
||||
# start at first free sector
|
||||
# default to full disk
|
||||
p # print, for debugging
|
||||
w # write the partition table and exit
|
||||
EOF
|
||||
|
||||
sleep 10 # Let me at least read it!
|
||||
#t # set partition type
|
||||
#1 # on partition 1
|
||||
#4 # BIOS boot
|
||||
|
||||
# Format and mount partitions
|
||||
mkfs.ext4 "${disk}1"
|
||||
mkfs.vfat "${disk}1"
|
||||
mkfs.ext4 "${disk}2"
|
||||
|
||||
mount "${disk}1" /mnt
|
||||
mount "${disk}2" /mnt
|
||||
mkdir -p /mnt/boot
|
||||
mount "${disk}1" /mnt/boot
|
||||
|
||||
# Bootstrap system
|
||||
pacstrap -K /mnt base linux nano sudo networkmanager openssh grub python3
|
||||
pacstrap -K /mnt base linux nano sudo networkmanager openssh grub python3 efibootmgr
|
||||
genfstab -L /mnt >> /mnt/etc/fstab
|
||||
cat /mnt/etc/fstab
|
||||
|
||||
# Run stuff in the chroot
|
||||
curl -o /mnt/in-chroot.sh "http://${host}:${port}/in-chroot.sh"
|
||||
|
||||
Reference in New Issue
Block a user