Expose the documents directory in the user home

This commit is contained in:
Alessandro Pignotti 2024-11-09 15:10:32 +01:00
parent d0e6d0e9ea
commit ce162c9e8c
4 changed files with 14 additions and 2 deletions

5
documents/Welcome.txt Normal file
View file

@ -0,0 +1,5 @@
Welcome to WebVM: A complete desktop environment running in the browser
WebVM is powered by CheerpX: a x86-to-WebAssembly virtualization engine and Just-in-Time compiler
For more info: https://cheerpx.io

1
documents/index.list Normal file
View file

@ -0,0 +1 @@
Welcome.txt

View file

@ -261,6 +261,7 @@
blockCache = await CheerpX.IDBDevice.create(cacheId);
var overlayDevice = await CheerpX.OverlayDevice.create(blockDevice, blockCache);
var webDevice = await CheerpX.WebDevice.create("");
var documentsDevice = await CheerpX.WebDevice.create("documents");
var dataDevice = await CheerpX.DataDevice.create();
var mountPoints = [
// The root filesystem, as an Ext2 image
@ -271,8 +272,12 @@
{type:"dir", dev:dataDevice, path:"/data"},
// Automatically created device files
{type:"devs", path:"/dev"},
// Pseudo-terminals
{type:"devpts", path:"/dev/pts"},
// The Linux 'proc' filesystem which provides information about running processes
{type:"proc", path:"/proc"}
{type:"proc", path:"/proc"},
// Convenient access to sample documents in the user directory
{type:"dir", dev:documentsDevice, path:"/home/user/documents"}
];
try
{

View file

@ -20,7 +20,8 @@ export default defineConfig({
{ src: 'scrollbar.css', dest: '' },
{ src: 'serviceWorker.js', dest: '' },
{ src: 'login.html', dest: '' },
{ src: 'assets/', dest: '' }
{ src: 'assets/', dest: '' },
{ src: 'documents/', dest: '' }
]
})
]