aboutsummaryrefslogtreecommitdiffstats
path: root/build.sh
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2018-03-09 14:30:09 -0600
committerBrijesh Singh <brijesh.singh@amd.com>2018-03-09 14:30:09 -0600
commiteea132e85b50a51f42d91a0a064bda5d42556a54 (patch)
tree1dd6ba87be93a5881b03b5267f885d06b0c62765 /build.sh
parentc261cb4d081294e0c73c648a9f293eb96f6f2be1 (diff)
downloadcachepc-amdsev-eea132e85b50a51f42d91a0a064bda5d42556a54.tar.gz
cachepc-amdsev-eea132e85b50a51f42d91a0a064bda5d42556a54.zip
update script and stable-commits to latest code base
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh46
1 files changed, 27 insertions, 19 deletions
diff --git a/build.sh b/build.sh
index bfc8479..8099fc1 100755
--- a/build.sh
+++ b/build.sh
@@ -19,18 +19,6 @@ run_cmd()
fetch_kernel()
{
- echo "Fetching $1"
- if [ "$1" = "kvm" ]; then
- KERNEL_COMMIT=${KVM_KERNEL_COMMIT}
- KERNEL_GIT_URL=${KVM_GIT_URL}
- elif [ "$1" = "tip" ]; then
- KERNEL_COMMIT=${TIP_KERNEL_COMMIT}
- KERNEL_GIT_URL=${TIP_GIT_URL}
- else
- echo "** ERROR **"
- exit 1
- fi
-
run_cmd "mkdir -p ${BUILD_DIR}/$1"
run_cmd "git clone --single-branch -b ${KERNEL_COMMIT} ${KERNEL_GIT_URL} ${BUILD_DIR}/$1"
}
@@ -40,18 +28,31 @@ build_kernel()
if [ ! -d $BUILD_DIR/$1 ]; then
fetch_kernel "$1"
fi
- cd $BUILD_DIR/$1
- cp /boot/config-$(uname -r) .config
+ run_cmd "cd $BUILD_DIR/$1"
+ run_cmd "cp /boot/config-$(uname -r) .config"
sed -ie s/CONFIG_LOCALVERSION.*/CONFIG_LOCALVERSION=\"\"/g .config
./scripts/config --enable CONFIG_AMD_MEM_ENCRYPT
- ./scripts/config --enable CONFIG_AMD_KVM_SEV
+ ./scripts/config --enable AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
+ ./scripts/config --enable CONFIG_KVM_AMD_SEV
./scripts/config --disable CONFIG_DEBUG_INFO
+ ./scripts/config --enable CRYPTO_DEV_SP_PSP
./scripts/config --module CRYPTO_DEV_CCP_DD
+ ./scripts/config --enable CONFIG_CRYPTO_DEV_CCP
./scripts/config --disable CONFIG_LOCALVERSION_AUTO
yes "" | make olddefconfig
- run_cmd "make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-$1"
+
+ if [ "$2" = "rpm" ]; then
+ echo "%_topdir `pwd`/rpmbuild" > $HOME/.rpmmacros
+ fi
+ run_cmd "make -j `getconf _NPROCESSORS_ONLN` $2-pkg LOCALVERSION=-sev"
run_cmd "mkdir -p $OUTPUT_DIR/$1"
- run_cmd "mv ../linux-*${1}*.deb $OUTPUT_DIR/$1"
+ if [ "$2" = "rpm" ]; then
+ run_cmd "mv `pwd`/rpmbuild/RPMS/* $OUTPUT_DIR/$1"
+ run_cmd "rm -rf `pwd`/rpmbuild"
+ run_cmd "rm -rf $HOME/.rpmmacros"
+ else
+ run_cmd "mv ../linux-*sev*.deb $OUTPUT_DIR/$1"
+ fi
}
fetch_ovmf()
@@ -107,7 +108,14 @@ dep_install ()
run_cmd "sudo apt-get -y install git build-essential zlib1g-dev libglib2.0-dev libpixman-1-dev uuid-dev nasm bison acpica-tools libncurses5-dev libssl-dev fakeroot dpkg-dev bc libelf-dev"
}
-dep_install
-build_kernel "kvm"
+grep ubuntu /etc/*-release* >/dev/null
+if [ $? -eq 0 ]; then
+ dep_install
+ pkg="deb"
+else
+ pkg="rpm"
+fi
+
+build_kernel "linux" "$pkg"
build_qemu
build_ovmf