echo 'kernel-built.txt does not exist'
echo 'So we build it'
-make --directory="$LINUX_PATH" "-j$NPROC" bzImage
+make --directory="$LINUX_PATH" "-j$NPROC" bzImage modules
+make --directory="$LINUX_PATH" INSTALL_MOD_PATH="$MODULES_INSTALL_FOLDER" modules_install
cp "$LINUX_PATH"/arch/x86/boot/bzImage "$DEPLOYDIR"/"$KERNEL_COMMIT_ID".bzImage
cp "$LINUX_PATH"/.config "$DEPLOYDIR"/"$KERNEL_COMMIT_ID".config
+tar -czf "$DEPLOYDIR/$KERNEL_COMMIT_ID.linux.modules.tar.gz" -C "$MODULES_INSTALL_FOLDER/" lib/
+
$SCP_COMMAND "$DEPLOYDIR/$KERNEL_COMMIT_ID.bzImage" "$STORAGE_USER@$STORAGE_HOST:$STORAGE_KERNEL_IMAGE"
$SCP_COMMAND "$DEPLOYDIR/$KERNEL_COMMIT_ID.config" "$STORAGE_USER@$STORAGE_HOST:$STORAGE_KERNEL_CONFIG"
+$SCP_COMMAND "$DEPLOYDIR/$KERNEL_COMMIT_ID.linux.modules.tar.gz" "$STORAGE_USER@$STORAGE_HOST:$STORAGE_LINUX_MODULES"
$SCP_COMMAND "$LINUX_PATH/Module.symvers" "$STORAGE_USER@$STORAGE_HOST:$STORAGE_KERNEL_MODULE_SYMVERS"
$S3_COMMAND put "$DEPLOYDIR/$KERNEL_COMMIT_ID.bzImage" s3://"$S3_STORAGE_KERNEL_IMAGE"
$S3_COMMAND put "$DEPLOYDIR/$KERNEL_COMMIT_ID.config" s3://"$S3_STORAGE_KERNEL_CONFIG"
+$S3_COMMAND put "$DEPLOYDIR/$KERNEL_COMMIT_ID.linux.modules.tar.gz" s3://"$S3_STORAGE_LINUX_MODULES"
$S3_COMMAND put "$LINUX_PATH/Module.symvers" s3://"$S3_STORAGE_KERNEL_MODULE_SYMVERS"