Last active
December 11, 2024 17:48
-
-
Save papamoose/e0b18d002f8686aaf767 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# iPXE build depends | |
apt-get install -y liblzma-dev git build-essential | |
# clone iPXE | |
[ ! -d ./ipxe ] && git clone http://git.ipxe.org/ipxe.git | |
cd ipxe/src | |
make clean | |
sed -i 's/#undef\tDOWNLOAD_PROTO_HTTPS/#define\tDOWNLOAD_PROTO_HTTPS/' config/general.h | |
for m in 10ec8139 8086100e virtio-net; do | |
make -j bin/${m}.rom | |
make -j bin-x86_64-efi/${m}.efirom | |
done | |
# Backup old roms first | |
[ -f /usr/share/kvm/pxe-e1000.rom.bak ] || cp -v /usr/share/kvm/pxe-e1000.rom /usr/share/kvm/pxe-e1000.rom.bak | |
[ -f /usr/share/kvm/pxe-virtio.rom.bak ] || cp -v /usr/share/kvm/pxe-virtio.rom /usr/share/kvm/pxe-virtio.rom.bak | |
[ -f /usr/share/kvm/pxe-rtl8139.rom.bak ] || cp -v /usr/share/kvm/pxe-rtl8139.rom /usr/share/kvm/pxe-rtl8139.rom.bak | |
[ -f /usr/share/kvm/efi-e1000e.rom.bak ] || cp -v /usr/share/kvm/efi-e1000e.rom /usr/share/kvm/efi-e1000e.rom.bak | |
[ -f /usr/share/kvm/efi-virtio.rom.bak ] || cp -v /usr/share/kvm/efi-virtio.rom /usr/share/kvm/efi-virtio.rom.bak | |
[ -f /usr/share/kvm/efi-10ec8139.rom ] || cp -v /usr/share/kvm/efi-10ec8139.rom /usr/share/kvm/efi-10ec8139.rom.bak | |
# e1000e | |
cp -v bin/8086100e.rom /usr/share/kvm/pxe-e1000.rom | |
cp -v bin-x86_64-efi/8086100e.efirom /usr/share/kvm/efi-e1000e.rom | |
# virtio | |
cp -v bin/virtio-net.rom /usr/share/kvm/pxe-virtio.rom | |
cp -v bin-x86_64-efi/virtio-net.efirom /usr/share/kvm/efi-virtio.rom | |
# rtl8139 | |
cp -v bin/10ec8139.rom /usr/share/kvm/pxe-rtl8139.rom | |
cp -v bin-x86_64-efi/10ec8139.efirom /usr/share/kvm/efi-10ec8139.rom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm afraid this doesn't backup anything!
Use
||
instead of&&
. Or! [ -f ... ]