diff --git a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh index 91bb7ca..519a173 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh +++ b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.sh @@ -64,12 +64,19 @@ require(){ echo "<a-entity xrf='$1'></a-entity>" >> /root/index.html ;; - sh) + sh|zip) js ' - fetch('$1') - .then( (res) => res.text() ) - .then( (text) => console.log(text) ) - ' + fetch("'$1'") + .then( (res) => res.arrayBuffer() ) + .then( async (buf) => { + // write to filesystem + const term = document.querySelector("[isoterminal]").components.isoterminal.term + await term.worker.create_file("'$(basename "$1")'", new Uint8Array(buf) ) + let cmd = String("'$1'").match(/\.zip$/) ? `/root/bin/ziprun /mnt/"'$(basename $1)'"` : "./'$1'" + term.exec(cmd) + }) + ' > $file + echo "[.] wrote $file" ;; *) diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/hook.d/URI/fragment/exec.sh b/buildroot-v86/board/v86/rootfs_overlay/root/hook.d/URI/fragment/exec.sh index a34b99c..f696b6a 100755 --- a/buildroot-v86/board/v86/rootfs_overlay/root/hook.d/URI/fragment/exec.sh +++ b/buildroot-v86/board/v86/rootfs_overlay/root/hook.d/URI/fragment/exec.sh @@ -9,7 +9,7 @@ fi if [[ "$1" =~ "zip$" ]]; then echo "[.] detected XRSH zip package in URL" echo "[.] fetching $1" - ziprun "$1" + require "$1" fi # otherwise execute diff --git a/dist/v86-linux.iso b/dist/v86-linux.iso index ba64874..0dc6716 100644 Binary files a/dist/v86-linux.iso and b/dist/v86-linux.iso differ