X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fdisk-image-builder%2Fnested%2Fbuild.sh;h=34b96bbf62e1c8f98db8e55cc2903fec9a3144d1;hb=c7eb2002bcd007520309feb3e11a26ff847a4e05;hp=7eddd64052e49da0b43d002aa7312bc8a0ca36a8;hpb=9d378548cc86028c55baf17260d32d0055603b78;p=csit.git diff --git a/resources/tools/disk-image-builder/nested/build.sh b/resources/tools/disk-image-builder/nested/build.sh index 7eddd64052..34b96bbf62 100755 --- a/resources/tools/disk-image-builder/nested/build.sh +++ b/resources/tools/disk-image-builder/nested/build.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e # Copyright (c) 2016 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +26,7 @@ # BUILD_DIR="$(dirname $0)/build" -BUILDROOT_NAME='buildroot-2016.02' +BUILDROOT_NAME='buildroot-2017.05.2' BUILDROOT_DIR="${BUILD_DIR}/${BUILDROOT_NAME}" BUILDROOT_TARBALL="${BUILDROOT_NAME}.tar.gz" BUILDROOT_URL="https://buildroot.org/downloads/${BUILDROOT_TARBALL}" @@ -46,6 +46,8 @@ then exit 1 fi +mkdir -p ${BUILD_DIR} + echo Building version: ${VERSION} echo $VERSION > ${BUILD_DIR}/VERSION echo "NESTED_VERSION=${VERSION}" > ${BUILD_DIR}/VERSION_HIDDEN @@ -65,6 +67,9 @@ set -e wget -P ${BUILD_DIR} -N $BUILDROOT_URL tar -C ${BUILD_DIR} -xzf ${BUILD_DIR}/$BUILDROOT_TARBALL +# Apply DPDK patch to buildroot. Do not fail if this patch has already been applied. +patch -N -d ${BUILDROOT_DIR} -p1 < buildroot-patches/dpdk.patch || /bin/true + cp -p buildroot-config $BUILDROOT_DIR/.config cp -p kernel-defconfig $BUILDROOT_DIR/kernel-defconfig make -C $BUILDROOT_DIR @@ -122,7 +127,7 @@ sudo tar -C ${MOUNT_TMPDIR} -xf ${BUILDROOT_OUTPUT} echo "Applying patches/modifications" mydir=$(pwd) cd ${MOUNT_TMPDIR} -sudo run-parts -v ${mydir}/patches +sudo run-parts -v ${mydir}/image-patches cd ${mydir} # Copy version and changelog @@ -165,7 +170,7 @@ echo "Disk has ${disk_cylinders} cylinders" # Install GRUB bootloader on the disk image ${BUILDROOT_DIR}/output/host/sbin/grub --device-map=/dev/null <<_EOF device (hd0) ${img_name} -geometry (hd0) ${disk_cylinders} ${DISK_HEADS} ${DISK_SECT_PER_TRACK} +geometry (hd0) root (hd0,0) setup (hd0) quit