File tree Expand file tree Collapse file tree 3 files changed +17
-8
lines changed
Expand file tree Collapse file tree 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)
3030{
3131 function done ( error )
3232 {
33- // Remove the modules from initramfs to free memory
34- // rimraf('/lib/node_modules')
35- rimraf ( '/lib/node_modules/jocker' )
36-
3733 // Make '/usr' a opaque folder (OverlayFS feature)
34+ // TODO Is this needed to be done here? Can it be done in a cleaner place?
3835 rimraf ( '/usr' )
3936
4037 callback ( error )
Original file line number Diff line number Diff line change 3131 "rimraf" : " ^2.5.4"
3232 },
3333 "devDependencies" : {
34- "jocker" : " ^0.0.0 " ,
34+ "jocker" : " ^0.0.1 " ,
3535 "prompt" : " ^1.0.0"
36- },
37- "peerDependencies" : {
38- "jocker" : " ^0.0.1"
3936 }
4037}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const readFile = require('fs').readFile
55const basicEnvironment = require ( 'nodeos-boot-singleUser' )
66const linuxCmdline = require ( 'linux-cmdline' )
77const mountUsersFS = require ( 'nodeos-boot-singleUserMount' )
8+ const rimraf = require ( 'rimraf' ) . sync
89const startRepl = require ( 'nodeos-mount-utils' ) . startRepl
910
1011const prepareSessions = require ( '.' )
@@ -45,6 +46,20 @@ basicEnvironment(function(error)
4546 {
4647 if ( error ) return onerror ( error )
4748
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+
4863 // KTHXBYE >^.^<
4964 } )
5065 } )
You can’t perform that action at this time.
0 commit comments