File tree 3 files changed +17
-8
lines changed
3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,8 @@ function usersSessions(usersFolder, callback)
30
30
{
31
31
function done ( error )
32
32
{
33
- // Remove the modules from initramfs to free memory
34
- // rimraf('/lib/node_modules')
35
- rimraf ( '/lib/node_modules/jocker' )
36
-
37
33
// Make '/usr' a opaque folder (OverlayFS feature)
34
+ // TODO Is this needed to be done here? Can it be done in a cleaner place?
38
35
rimraf ( '/usr' )
39
36
40
37
callback ( error )
Original file line number Diff line number Diff line change 31
31
"rimraf" : " ^2.5.4"
32
32
},
33
33
"devDependencies" : {
34
- "jocker" : " ^0.0.0 " ,
34
+ "jocker" : " ^0.0.1 " ,
35
35
"prompt" : " ^1.0.0"
36
- },
37
- "peerDependencies" : {
38
- "jocker" : " ^0.0.1"
39
36
}
40
37
}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const readFile = require('fs').readFile
5
5
const basicEnvironment = require ( 'nodeos-boot-singleUser' )
6
6
const linuxCmdline = require ( 'linux-cmdline' )
7
7
const mountUsersFS = require ( 'nodeos-boot-singleUserMount' )
8
+ const rimraf = require ( 'rimraf' ) . sync
8
9
const startRepl = require ( 'nodeos-mount-utils' ) . startRepl
9
10
10
11
const prepareSessions = require ( '.' )
@@ -45,6 +46,20 @@ basicEnvironment(function(error)
45
46
{
46
47
if ( error ) return onerror ( error )
47
48
49
+ // Remove from initramfs the files only needed on boot to free memory
50
+ try
51
+ {
52
+ rimraf ( '/bin/nodeos-boot-multiuser' )
53
+ rimraf ( '/init' )
54
+ rimraf ( '/lib/node_modules/nodeos-boot-multiuser' )
55
+ rimraf ( '/sbin' )
56
+ }
57
+ catch ( error )
58
+ {
59
+ // If `rootfs` is read-only (like in `vagga`), ignore the error
60
+ if ( error . code !== 'EROFS' ) return callback ( error )
61
+ }
62
+
48
63
// KTHXBYE >^.^<
49
64
} )
50
65
} )
You can’t perform that action at this time.
0 commit comments