final String mountPath = "jnode";
fSS.mount(mountPath, fs, null);
log.info("Mounted " + type.getName() + " on " + mountPath);
FSDirectory root_dir = fs.getRootEntry().getDirectory();
root_dir.addDirectory("home");
root_dir.addDirectory("tmp");
// adding files to /jnode/lib/ required by thecore classes
FSDirectory libDir = (FSDirectory) root_dir.addDirectory("lib");
InputStream is = RAMFSPlugin.class.getResourceAsStream("flavormap.properties");
if (is != null) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int c;
while ((c = is.read(buf)) > -1)
baos.write(buf, 0, c);
is.close();
baos.flush();
baos.close();
ByteBuffer data = ByteBuffer.wrap(baos.toByteArray());
FSFile fmp = (FSFile) libDir.addFile("flavormap.properties");
fmp.write(0, data);
fmp.flush();
}
} catch (DeviceAlreadyRegisteredException ex) {
log.error("RAMFS is allready running.");