Last active
October 9, 2023 07:50
-
-
Save lool/acfa4d74aa5f8dc8cda721536f230b6f to your computer and use it in GitHub Desktop.
Build ONIE VM image
This file contains hidden or 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/sh | |
set -e | |
PACKAGES="git qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager git realpath autoconf bison flex texinfo libtool libtool-bin libncurses5-dev gawk gperf stgit build-essential fakeroot libexpat1-dev python-dev xorriso mtools dosfstools" | |
ONIE_URL="https://github.com/opencomputeproject/onie.git" | |
# needed to locate mkdosfs | |
export PATH=$PATH:/sbin:/usr/sbin | |
sudo apt-get -y install --no-install-recommends $PACKAGES | |
if [ -z "`git config --global user.email`" ]; then | |
git config --global user.email "[email protected]" | |
fi | |
if [ -z "`git config --global user.name`" ]; then | |
git config --global user.name "John Doe" | |
fi | |
onie_dir="`basename $ONIE_URL .git`" | |
if ! [ -d "$onie_dir" ]; then | |
git clone "$ONIE_URL" | |
fi | |
cd "$onie_dir" | |
cd build-config | |
sed -i 's/\<libtool-bin\>//' Makefile | |
sed -i 's/\<apt-get install \$\>/apt-get install -y $/' Makefile | |
#sed -i 's/apt-get install \$/apt-get install -y $/' Makefile | |
make debian-prepare-build-host | |
make distclean | |
make clean | |
# makes onie | |
make -j $(grep -c "^processor" /proc/cpuinfo) MACHINE=kvm_x86_64 all recovery-iso | |
make demo | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment