From e23ac25357fbcc90542248f15b8b195328ccfe49 Mon Sep 17 00:00:00 2001 From: ProgrammerIn-wonderland <3838shah@gmail.com> Date: Sun, 27 Oct 2024 16:44:10 -0400 Subject: [PATCH 1/2] only save on postcommit --- src/emulator/image/rootfs/bin/puter-save | 2 +- .../image/rootfs/etc/apk/commit_hooks.d/puter.sh | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/emulator/image/rootfs/bin/puter-save b/src/emulator/image/rootfs/bin/puter-save index cc541e7c2f..19d7adc720 100644 --- a/src/emulator/image/rootfs/bin/puter-save +++ b/src/emulator/image/rootfs/bin/puter-save @@ -11,4 +11,4 @@ fi echo -n $$ > /var/puter-save PUTERUSERNAME=$( cat /proc/cmdline | sed -n 's/.*puterusername=\(.*\)/\1/p' ) lbu package - > /puter/$PUTERUSERNAME/emulatorstate.apkovl.tar.gz -rm /var/puter-save \ No newline at end of file +rm /var/puter-save diff --git a/src/emulator/image/rootfs/etc/apk/commit_hooks.d/puter.sh b/src/emulator/image/rootfs/etc/apk/commit_hooks.d/puter.sh index f3f5d46d48..37ac5662e6 100644 --- a/src/emulator/image/rootfs/etc/apk/commit_hooks.d/puter.sh +++ b/src/emulator/image/rootfs/etc/apk/commit_hooks.d/puter.sh @@ -1,4 +1,9 @@ -#!/bin/bash +#!/bin/sh -echo saving state to puter... -puter-save +if [ "$1" = "pre-commit" ]; then + echo Running with puter integration +elif [ "$1" = "post-commit" ]; then + echo Queuing puter save... + puter-save +fi +exit 0 \ No newline at end of file From d07c6f2635855e784a5e4f1da607963efe679258 Mon Sep 17 00:00:00 2001 From: ProgrammerIn-wonderland <3838shah@gmail.com> Date: Mon, 18 Nov 2024 17:06:38 -0500 Subject: [PATCH 2/2] (WIP) wisp bus starting --- experiments/puter-net/child/child.js | 3 ++ experiments/puter-net/child/index.html | 0 experiments/puter-net/index.html | 0 experiments/puter-net/index.js | 22 +++++++++ experiments/puter-net/parent/index.html | 13 ++++++ experiments/puter-net/parent/parent.js | 62 +++++++++++++++++++++++++ experiments/puter-net/parent/wisplib.js | 51 ++++++++++++++++++++ 7 files changed, 151 insertions(+) create mode 100644 experiments/puter-net/child/child.js create mode 100644 experiments/puter-net/child/index.html create mode 100644 experiments/puter-net/index.html create mode 100644 experiments/puter-net/index.js create mode 100644 experiments/puter-net/parent/index.html create mode 100644 experiments/puter-net/parent/parent.js create mode 100644 experiments/puter-net/parent/wisplib.js diff --git a/experiments/puter-net/child/child.js b/experiments/puter-net/child/child.js new file mode 100644 index 0000000000..db6e11d8a5 --- /dev/null +++ b/experiments/puter-net/child/child.js @@ -0,0 +1,3 @@ +window.parent.postMessage({$: "wisp-reg"}) + +window.parent.postMessage({$: "wisp-tx", new Uint8Array()}) \ No newline at end of file diff --git a/experiments/puter-net/child/index.html b/experiments/puter-net/child/index.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/experiments/puter-net/index.html b/experiments/puter-net/index.html new file mode 100644 index 0000000000..e69de29bb2 diff --git a/experiments/puter-net/index.js b/experiments/puter-net/index.js new file mode 100644 index 0000000000..e99e1c6f69 --- /dev/null +++ b/experiments/puter-net/index.js @@ -0,0 +1,22 @@ +class WispBus extends EventEmitter { + constructor(parameters) { + + } +} + + + +class puterSocket { + + constructor(host, port) { + + } + async write(arg[0]) { + + if (args[3]) { + + } + + + } +} \ No newline at end of file diff --git a/experiments/puter-net/parent/index.html b/experiments/puter-net/parent/index.html new file mode 100644 index 0000000000..dfa6e99e32 --- /dev/null +++ b/experiments/puter-net/parent/index.html @@ -0,0 +1,13 @@ + + +
+ + +