Fix build script paths to be relative to script location, enabling builds on any machine
This commit is contained in:
@@ -4,9 +4,12 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
BUILD_DIR="/srv/netboot/build"
|
# Get the directory where this script is located (works on any machine)
|
||||||
IMAGE_DIR="/srv/netboot/images"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
HTTP_DIR="/srv/netboot/http"
|
|
||||||
|
BUILD_DIR="$SCRIPT_DIR/build"
|
||||||
|
IMAGE_DIR="$SCRIPT_DIR/images"
|
||||||
|
HTTP_DIR="$SCRIPT_DIR/http"
|
||||||
VERSION=$(date +%Y%m%d-%H%M)
|
VERSION=$(date +%Y%m%d-%H%M)
|
||||||
|
|
||||||
echo "Building netboot image version $VERSION"
|
echo "Building netboot image version $VERSION"
|
||||||
@@ -204,7 +207,7 @@ echo "Building custom netboot initramfs..."
|
|||||||
KERNEL_VERSION=$(ls -1 $BUILD_DIR/rootfs/boot/vmlinuz-* | sed 's|.*/vmlinuz-||' | head -1)
|
KERNEL_VERSION=$(ls -1 $BUILD_DIR/rootfs/boot/vmlinuz-* | sed 's|.*/vmlinuz-||' | head -1)
|
||||||
|
|
||||||
# Use mkinitramfs with custom initramfs directory
|
# Use mkinitramfs with custom initramfs directory
|
||||||
INITRAMFS_CONFIG="/srv/netboot/initramfs"
|
INITRAMFS_CONFIG="$SCRIPT_DIR/initramfs"
|
||||||
if [ -d "$INITRAMFS_CONFIG" ]; then
|
if [ -d "$INITRAMFS_CONFIG" ]; then
|
||||||
mkinitramfs -d "$INITRAMFS_CONFIG" \
|
mkinitramfs -d "$INITRAMFS_CONFIG" \
|
||||||
-k "$KERNEL_VERSION" \
|
-k "$KERNEL_VERSION" \
|
||||||
|
|||||||
Reference in New Issue
Block a user