From 83e6fcabb33d680054bcddeaa3fb2af29e19e144 Mon Sep 17 00:00:00 2001 From: James Prevett Date: Tue, 12 Nov 2024 00:08:50 -0600 Subject: [PATCH] `/dev` is now added after other mounts, in case `/` is changed --- src/config.ts | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/config.ts b/src/config.ts index dac96c27..a31b0340 100644 --- a/src/config.ts +++ b/src/config.ts @@ -5,7 +5,8 @@ import { DeviceFS } from './devices.js'; import * as cache from './emulation/cache.js'; import { config } from './emulation/config.js'; import * as fs from './emulation/index.js'; -import type { AbsolutePath } from './emulation/path.js'; +import { parse, type AbsolutePath } from './emulation/path.js'; +import { resolveMount } from './emulation/shared.js'; import { Errno, ErrnoError } from './error.js'; import { FileSystem } from './filesystem.js'; @@ -196,34 +197,32 @@ export async function configure(configuration: Partial mount(point, fs))); } - if (unmountRoot) fs.umount('/'); - - await Promise.all(toMount.map(([point, fs]) => mount(point, fs))); + if (configuration.addDevices) { + const devfs = new DeviceFS(); + devfs.addDefaults(); + await devfs.ready(); + await mount('/dev', devfs); + } }