Commit 62dc59e9 authored by Kroese's avatar Kroese
Browse files

Serial emulator

parent 12bf5d75
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
FROM golang:1.16 AS builder

COPY vdsm-serial/ /src/vdsm-serial/
WORKDIR /src/vdsm-serial
COPY serial/ /src/serial/
WORKDIR /src/serial
RUN go get -d -v golang.org/x/net/html  
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/vdsm-serial/main .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /src/serial/main .

FROM debian:bullseye-20230109-slim

@@ -28,7 +28,7 @@ COPY qemu-ifdown /run/
COPY qemu-ifup /run/
COPY run.sh /run/
COPY server.sh /run/
COPY --from=builder /src/vdsm-serial/main /run/serial.bin
COPY --from=builder /src/serial/main /run/serial.bin

RUN ["chmod", "+x", "/run/generate-dhcpd-conf"]
RUN ["chmod", "+x", "/run/qemu-ifdown"]
@@ -48,6 +48,7 @@ VOLUME /images
EXPOSE 5000
EXPOSE 5001

ENV RAM_SIZE 512M
ENV DISK_SIZE 16G
ENV URL https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat

@@ -57,6 +58,3 @@ ENV URL https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM

ENTRYPOINT ["/run/run.sh"]
# Mostly users will probably want to configure memory usage.
CMD ["-m", "512M"]
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ echo "Booting OS..."
# -enable-kvm: Use KVM for this VM (much faster for our case).
# -nographic: disable SDL graphics.
# -serial mon:stdio: use "monitored stdio" as our serial output.
exec qemu-system-x86_64 -name Synology -enable-kvm -nographic -serial mon:stdio \
exec qemu-system-x86_64 -name Synology -m $RAM_SIZE -enable-kvm -nographic -serial mon:stdio \
    "$@" \
    -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 \
    -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,host=127.0.0.1,port=12345,reconnect=10 \
+0 −0

File moved.

+0 −0

File moved.

+0 −0

File moved.

Loading