Skip to content

Instantly share code, notes, and snippets.

@andersonrobot
Forked from lool/build-onie.sh
Created May 29, 2025 09:58
Show Gist options
  • Select an option

  • Save andersonrobot/36f881601db20f78c03e282a1c03ccc5 to your computer and use it in GitHub Desktop.

Select an option

Save andersonrobot/36f881601db20f78c03e282a1c03ccc5 to your computer and use it in GitHub Desktop.

Revisions

  1. @lool lool revised this gist Mar 25, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion build-onie.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,10 @@ 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
  2. @lool lool revised this gist Mar 25, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build-onie.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    set -e

    PACKAGES="git qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager git realpath autoconf bison flex texinfo libtool libncurses5-dev gawk gperf stgit build-essential fakeroot libexpat1-dev python-dev xorriso mtools dosfstools"
    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"

    sudo apt-get -y install --no-install-recommends $PACKAGES
  3. @lool lool created this gist Mar 25, 2017.
    35 changes: 35 additions & 0 deletions build-onie.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    #!/bin/sh

    set -e

    PACKAGES="git qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils virt-manager git realpath autoconf bison flex texinfo libtool libncurses5-dev gawk gperf stgit build-essential fakeroot libexpat1-dev python-dev xorriso mtools dosfstools"
    ONIE_URL="https://github.com/opencomputeproject/onie.git"

    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