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:
5
.env.example
Normal file
5
.env.example
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
KERNEL_NAME=kernel8.img
|
||||||
|
BUILD_PATH=target/aarch64-unknown-none/release/nova
|
||||||
|
TFTP_PATH=/srv/tftp
|
||||||
|
REMOTE_USER=TFTP_HOST_USER
|
||||||
|
REMOTE_HOST=TFTP_HOST_IP
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
/target
|
/target
|
||||||
kernel8.img
|
kernel8.img
|
||||||
|
.env
|
||||||
|
|||||||
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