From ed0a83ca9daa58a9789b59c612dc3baef94c68c8 Mon Sep 17 00:00:00 2001 From: ProgrammerIn-wonderland <3838shah@gmail.com> Date: Mon, 7 Oct 2024 20:07:10 -0400 Subject: [PATCH] dev: update v86, switch twisp to epoxy-server with twisp feature --- src/emulator/image/Dockerfile | 4 ++-- src/emulator/image/rootfs/etc/epoxyconf.toml | 12 ++++++++++++ src/emulator/image/rootfs/etc/init.d/twisp-service | 10 ++++++---- submodules/epoxy-tls | 2 +- submodules/v86 | 2 +- tools/build_v86.sh | 12 ++++-------- 6 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 src/emulator/image/rootfs/etc/epoxyconf.toml diff --git a/src/emulator/image/Dockerfile b/src/emulator/image/Dockerfile index 0bc9ad85..bab67ce6 100644 --- a/src/emulator/image/Dockerfile +++ b/src/emulator/image/Dockerfile @@ -22,8 +22,8 @@ COPY rootfs/ / COPY basic-boot /etc/init.d/ RUN chmod +x /etc/init.d/basic-boot -COPY assets/twisp /bin/twisp -RUN chmod u+x /bin/twisp +COPY assets/epoxy-server /bin/epoxy-server +RUN chmod u+x /bin/epoxy-server RUN rc-update add twisp-service default RUN rc-update add debug-service default diff --git a/src/emulator/image/rootfs/etc/epoxyconf.toml b/src/emulator/image/rootfs/etc/epoxyconf.toml new file mode 100644 index 00000000..cc4f147c --- /dev/null +++ b/src/emulator/image/rootfs/etc/epoxyconf.toml @@ -0,0 +1,12 @@ +[server] +bind = "/dev/hvc0" +socket = "file" +transport = "lengthdelimitedle" +file_raw_mode = true # maybe? + +[stream] +allow_twisp = true + +[wisp] +wisp_v2 = true +buffer_size = 4294967295 \ No newline at end of file diff --git a/src/emulator/image/rootfs/etc/init.d/twisp-service b/src/emulator/image/rootfs/etc/init.d/twisp-service index 8ca743e4..7f88fdbd 100755 --- a/src/emulator/image/rootfs/etc/init.d/twisp-service +++ b/src/emulator/image/rootfs/etc/init.d/twisp-service @@ -1,11 +1,13 @@ #!/sbin/openrc-run -description="twisp daemon" -command="/bin/twisp" -command_args="--pty /dev/hvc0" -pidfile="/var/run/twisp.pid" +description="Epoxy Daemon" +command="/bin/epoxy-server" +command_args="/etc/epoxyconf.toml" command_background="yes" +pidfile="/var/run/twisp.pid" start_stop_daemon_args="--background --make-pidfile" +output_log="/dev/ttyS0" +error_log="/dev/ttyS0" depend() { need localmount diff --git a/submodules/epoxy-tls b/submodules/epoxy-tls index 7fdacb26..d6f1a8da 160000 --- a/submodules/epoxy-tls +++ b/submodules/epoxy-tls @@ -1 +1 @@ -Subproject commit 7fdacb26237a0a69faacd1c08d746584fbd98f94 +Subproject commit d6f1a8da43c11410595a7710613786d4fc37fa38 diff --git a/submodules/v86 b/submodules/v86 index f3339aa7..1afc297f 160000 --- a/submodules/v86 +++ b/submodules/v86 @@ -1 +1 @@ -Subproject commit f3339aa78eeb9221d24ff86a2ea74b9ee1d2ee90 +Subproject commit 1afc297f8b61704716c6eb9bfb281d57036bd588 diff --git a/tools/build_v86.sh b/tools/build_v86.sh index d4746225..34a5701c 100755 --- a/tools/build_v86.sh +++ b/tools/build_v86.sh @@ -20,19 +20,15 @@ cd - echo -e "\x1B[36;1m<<< Building Twisp >>>\x1B[0m" -cd submodules/twisp +pwd +cd submodules/epoxy-tls/server -RUSTFLAGS="-C target-feature=+crt-static" cargo build \ - --release \ - --target i686-unknown-linux-gnu \ - `# TODO: what are default features?` \ - --no-default-features +RUSTFLAGS="-C target-feature=+crt-static" cargo +nightly b -F twisp -r --target i686-unknown-linux-gnu; echo -e "\x1B[36;1m<<< Preparing to Build Imag >>>\x1B[0m" cd - - -cp submodules/twisp/target/i686-unknown-linux-gnu/release/twisp \ +cp submodules/epoxy-tls/target/i686-unknown-linux-gnu/release/epoxy-server \ src/emulator/image/assets/ echo -e "\x1B[36;1m<<< Building Image >>>\x1B[0m"