https://github.com/nodeos/nodeos-initramfs
https://github.com/nodeos/nodeos-initramfs
nodeos
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nodeos/nodeos-initramfs
- Owner: NodeOS
- Created: 2015-04-10T19:11:48.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2023-06-21T18:13:04.000Z (over 2 years ago)
- Last Synced: 2025-04-13T22:13:41.554Z (10 months ago)
- Topics: nodeos
- Language: Shell
- Size: 109 KB
- Stars: 5
- Watchers: 3
- Forks: 11
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://semaphoreci.com/nodeos/nodeos-initramfs)
# NodeOS initramfs
This package generate a initramfs image that will try to mount the users
filesystem, set on the `root=` flag on Linux command line. If it fails to do so,
it boots to a Node.js [REPL](http://nodejs.org/api/repl.html) prompt using an
on-memory root filesystem.
## Note about *env.js*
Since `/usr/bin/env` is also a Node.js script, to use less memory and boot
faster it's checking that the script to be run is already a Node.js script and
if so, it `require()`s it and exec it directly to re-use the current Node.js
instance. This has the drawback that Python-inspired tricks like
`!module.parent` or `require.main === module` will not work anymore. A better
alternative and currently more widely used when a package can be used both as a
library and as an executable is to define the executable at an independent
script file and use the `package.json` *main* and *bin* entries.