mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Serial
This commit is contained in:
parent
fd1a950a58
commit
ccd0a3fab8
@ -12,6 +12,8 @@ done
|
||||
|
||||
if [ "$first_run" = true ]; then
|
||||
|
||||
echo "Installing packages..." > /dev/ttyS0
|
||||
|
||||
for filename in /usr/local/packages/*.spk; do
|
||||
|
||||
/usr/syno/bin/synopkg install "$filename" > /dev/null
|
||||
@ -19,7 +21,7 @@ if [ "$first_run" = true ]; then
|
||||
BASE=$(basename "$filename" .spk)
|
||||
BASE=$(echo "${BASE%%-*}")
|
||||
|
||||
/usr/syno/bin/synopkg start $BASE > /dev/null
|
||||
/usr/syno/bin/synopkg start "$BASE" > /dev/null
|
||||
|
||||
rm "$filename"
|
||||
|
||||
@ -27,7 +29,7 @@ if [ "$first_run" = true ]; then
|
||||
|
||||
else
|
||||
|
||||
sleep 2
|
||||
sleep 3
|
||||
|
||||
fi
|
||||
|
||||
|
@ -4,6 +4,7 @@ set -eu
|
||||
IMG="/storage"
|
||||
BASE=$(basename "$URL" .pat)
|
||||
|
||||
[ ! -d "$IMG" ] && echo "Storage folder (${IMG}) not found!" && exit 69
|
||||
[ ! -f "/run/server.sh" ] && echo "Script must run inside Docker container!" && exit 60
|
||||
|
||||
[ ! -f "$IMG/$BASE.boot.img" ] && rm -f "$IMG"/"$BASE".system.img
|
||||
|
18
serial.sh
18
serial.sh
@ -3,8 +3,22 @@
|
||||
permanent="DSM"
|
||||
serialstart="2000"
|
||||
|
||||
HOST_SERIAL=="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(printf "%06d" $((RANDOM % 30000 + 1)))
|
||||
GUEST_SERIAL=="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(printf "%06d" $((RANDOM % 30000 + 1)))
|
||||
IMG="/storage"
|
||||
[ ! -d "$IMG" ] && echo "Storage folder (${IMG}) not found!" && exit 69
|
||||
|
||||
FILE="${IMG}/host.serial"
|
||||
if [ ! -f "$FILE" ]; then
|
||||
SERIAL="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(printf "%06d" $((RANDOM % 30000 + 1)))
|
||||
echo $SERIAL > "$FILE"
|
||||
fi
|
||||
HOST_SERIAL=$(cat "${FILE}")
|
||||
|
||||
FILE="${IMG}/guest.serial"
|
||||
if [ ! -f "$FILE" ]; then
|
||||
SERIAL="$(echo "$serialstart" | tr ' ' '\n' | sort -R | tail -1)$permanent"$(printf "%06d" $((RANDOM % 30000 + 1)))
|
||||
echo $SERIAL > "$FILE"
|
||||
fi
|
||||
GUEST_SERIAL=$(cat "${FILE}")
|
||||
|
||||
./run/serial.bin -cpu=1 \
|
||||
-buildnumber=42962 \
|
||||
|
Loading…
x
Reference in New Issue
Block a user