mirror of
https://github.com/iceHtwoO/novaOS.git
synced 2026-04-16 20:22:26 +00:00
Upload files to TFTP server for network boot
This commit is contained in:
31
tools/deply_to_hw.sh
Executable file
31
tools/deply_to_hw.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
set -a
|
||||
source ../.env
|
||||
set +a
|
||||
|
||||
set -e # Stop on errors
|
||||
|
||||
|
||||
# === RESOLVE VARIABLES ===
|
||||
REMOTE="$REMOTE_USER@$REMOTE_HOST"
|
||||
REMOTE_DIR="$TFTP_PATH"
|
||||
|
||||
# === BUILD ===
|
||||
echo "[*] Building kernel..."
|
||||
eval $BUILD_COMMAND
|
||||
|
||||
# === CONVERT TO IMG ===
|
||||
echo "[*] Convert kernel elf to img..."
|
||||
llvm-objcopy -O binary "../$BUILD_PATH/$BINARY_NAME" ../$BUILD_PATH/kernel8.img
|
||||
|
||||
|
||||
# === COPY TO TFTP ===
|
||||
echo "[*] Copying firmware files to TFTP server..."
|
||||
scp ../firmware_files/* "$REMOTE:$REMOTE_DIR/."
|
||||
echo "[*] Copying kernel to TFTP server..."
|
||||
scp "../$BUILD_PATH/kernel8.img" "$REMOTE:$REMOTE_DIR/$KERNEL_NAME"
|
||||
|
||||
echo "[✓] Deployed to TFTP server as $KERNEL_NAME"
|
||||
Reference in New Issue
Block a user