apt-get -y install profitbricks-andbd-modules-storage profitbricks-linux-image-storage || true
mkdir -p $TARGET_DIR
export KERNEL_VERSION=###(ls /boot/vmlinu* | cut -d "-" -f2-)
+export GENTOO_KERNEL_VERSION="###(ls /boot/vmlinu* | cut -d "-" -f2).$BUILD_NUMBER"
cp -v /boot/vmlinu* $TARGET_DIR/
cp -v /boot/config* $TARGET_DIR/
cd /lib/modules/*storage/
echo >> $TARGET_DIR/sources.txt
apt-cache show profitbricks-linux-image-storage >> $TARGET_DIR/sources.txt
apt-cache show profitbricks-andbd-modules-storage >> $TARGET_DIR/sources.txt
+/bin/tar -cJvf $TARGET_BASE/$TARGET_NAME/linux-storage_###{GENTOO_KERNEL_VERSION}.tar.xz -C $TARGET_DIR .
EOF
chmod +x $BUILD_SCRIPT
# turn the shell call back into a shell call
sed -i -s "s|###|$|g" $BUILD_SCRIPT
#
-# build liveboot
+# run $BUILD_SCRIPT in chroot environment
#
sudo pbuilder --execute --bindmounts $TARGET_BASE -- $BUILD_SCRIPT
rm $BUILD_SCRIPT