From f875ac705d4be5a8ae790c9bbafb5e5adf3760fe Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 21 Dec 2015 11:44:40 +0100 Subject: [PATCH] Do not remove the kernel src for packer build These required to build vboxguest kernel module Closes-bug: #1528151 Change-Id: I4229ffe137d770dd18c5225af6872d0243d2116d Signed-off-by: Bogdan Dobrelya --- bootstrap/playbooks/files/minimize.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bootstrap/playbooks/files/minimize.sh b/bootstrap/playbooks/files/minimize.sh index 92460e79..103d428b 100644 --- a/bootstrap/playbooks/files/minimize.sh +++ b/bootstrap/playbooks/files/minimize.sh @@ -22,7 +22,12 @@ apt-get -y clean echo "==> Removing man pages" rm -rf /usr/share/man/* -echo "==> Removing anything in /usr/src" +echo "==> Removing anything in /usr/src but this kernel src" +p2=$(uname -r | cut -d- -f1-2) +mv "/usr/src/linux-headers-${p2}" /tmp +mv /usr/src/linux-headers-$(uname -r) /tmp rm -rf /usr/src/* +mv "/tmp/linux-headers-${p2}" /usr/src/ +mv /tmp/linux-headers-$(uname -r) /usr/src/ echo "==> Removing any docs" rm -rf /usr/share/doc/*