Skip to content

Commit ce162c9

Browse files
committed
Expose the documents directory in the user home
1 parent d0e6d0e commit ce162c9

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

documents/Welcome.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Welcome to WebVM: A complete desktop environment running in the browser
2+
3+
WebVM is powered by CheerpX: a x86-to-WebAssembly virtualization engine and Just-in-Time compiler
4+
5+
For more info: https://cheerpx.io

documents/index.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Welcome.txt

src/lib/WebVM.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
blockCache = await CheerpX.IDBDevice.create(cacheId);
262262
var overlayDevice = await CheerpX.OverlayDevice.create(blockDevice, blockCache);
263263
var webDevice = await CheerpX.WebDevice.create("");
264+
var documentsDevice = await CheerpX.WebDevice.create("documents");
264265
var dataDevice = await CheerpX.DataDevice.create();
265266
var mountPoints = [
266267
// The root filesystem, as an Ext2 image
@@ -271,8 +272,12 @@
271272
{type:"dir", dev:dataDevice, path:"/data"},
272273
// Automatically created device files
273274
{type:"devs", path:"/dev"},
275+
// Pseudo-terminals
276+
{type:"devpts", path:"/dev/pts"},
274277
// The Linux 'proc' filesystem which provides information about running processes
275-
{type:"proc", path:"/proc"}
278+
{type:"proc", path:"/proc"},
279+
// Convenient access to sample documents in the user directory
280+
{type:"dir", dev:documentsDevice, path:"/home/user/documents"}
276281
];
277282
try
278283
{

vite.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ export default defineConfig({
2020
{ src: 'scrollbar.css', dest: '' },
2121
{ src: 'serviceWorker.js', dest: '' },
2222
{ src: 'login.html', dest: '' },
23-
{ src: 'assets/', dest: '' }
23+
{ src: 'assets/', dest: '' },
24+
{ src: 'documents/', dest: '' }
2425
]
2526
})
2627
]

0 commit comments

Comments
 (0)