fixed hashboot of zippakcages

This commit is contained in:
Leon van Kammen 2025-02-21 15:59:29 +01:00
parent 04275e3f2f
commit 2a4218120d
4 changed files with 45 additions and 32 deletions

View File

@ -12,14 +12,15 @@
* > depends on [AFRAME.utils.require](com/require.js)
*
* | property | type | default | info |
* |------------------|-----------|------------------------|------|
* |-------------------|-----------|------------------------|------|
* | `iso` | `string` | https`//forgejo.isvery.ninja/assets/xrsh-buildroot/main/xrsh.iso" | |
* | `overlayfs` | `string` | '' | zip URL/file to autoextract on top of filesystem |
* | `width` | `number` | 800 ||
* | `height` | `number` | 600 ||
* | `depth` | `number` | 0.03 ||
* | `lineHeight` | `number` | 18 ||
* | `bootmenu` | `boolean` | true | give user choice [or boot straight into ISO ] |
* | `bootMenu` | `string` | "" | character to auto-enter in bootMenu |
* | `bootMenuURL` | `string` | "" | character to auto-enter in bootmeun when URL has fragment (#foo.zip e.g.) |
* | `padding` | `number`` | 18 | |
* | `maximized` | `boolean` | false | |
* | `minimized` | `boolean` | false | |
@ -75,7 +76,9 @@ if( typeof AFRAME != 'undefined '){
height: { type: 'number',"default": 600 },
depth: { type: 'number',"default": 0.03 },
lineHeight: { type: 'number',"default": 18 },
bootmenu: { type: 'string', "default": 'show' }, // show bootmenu or autosend key to bootmenu (key '1' e.g.)
bootOnFragment: { type: 'string',"default": "nothing" },
bootMenu: { type: 'string', "default": '' }, // show bootMenu if empty, or autosend key to bootMenu (key '1' e.g.)
bootMenuURL: { type: 'string', "default": '' }, // show bootMenu if empty, or autosend key to bootMenu (key '1' e.g.)
padding: { type: 'number',"default": 18 },
maximized: { type: 'boolean',"default":false},
minimized: { type: 'boolean',"default":false},

View File

@ -268,9 +268,7 @@ ISOTerminal.prototype.startVM = function(opts){
this.emit('status',msglib.loadmsg)
this.emit('serial-output-string', msg)
if( this.opts.bootmenu == 'show'){
this.emit('bootmenu',{})
}
this.emit('bootMenu',{bootMenu: this.opts.bootMenu, bootMenuURL: this.opts.bootMenuURL })
}
ISOTerminal.prototype.bootISO = function(){

View File

@ -4,15 +4,27 @@ ISOTerminal.addEventListener('ready', function(e){
ISOTerminal.prototype.bootMenu = function(e){
this.boot.menu.selected = false // reset
const autobootURL = e.detail.bootMenuURL && document.location.hash.length > 1
const autoboot = e.detail.bootMenu || autobootURL
if( !autoboot ){
alert("ja")
let msg = '\n\r'
this.boot.menu.map( (m) => {
msg += `\r${m.key}) ${m.title(this.opts)}\n`
})
msg += `\n\renter choice> `
this.send(msg)
}else{ // autoboot
if( this.term ){
this.term.handler( e.detail.bootMenu || e.detail.bootMenuURL )
this.term.handler("\n")
}
}
}
ISOTerminal.addEventListener('bootmenu', function(e){ this.bootMenu() })
ISOTerminal.addEventListener('bootMenu', function(e){ this.bootMenu(e) } )
ISOTerminal.prototype.boot = async function(e){
// set environment

View File

@ -47,8 +47,8 @@ AFRAME.registerComponent('selfcontainer', {
cb(res)
}else{
// never cache requests to filesystem
if( request.url.match(/(^\/mnt\/)/) ) return cb(response)
// never cache requests to filesystem or zip/sh packages
if( request.url.match(/(^\/mnt\/|\.zip$|\.sh$)/) ) return cb(response)
console.log("selfcontainer.js: caching "+request.url)
if( response.text ){