Skip to content

Commit 497d425

Browse files
committed
Merge branch 'vagga'
Conflicts: README.md
2 parents e63061a + 31b3525 commit 497d425

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+1257
-1267
lines changed

.gitignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
npm-debug.log
22
out/
3-
obj/
4-
deps/
5-
bzImage
6-
initramfs.cpio.gz
7-
rootfs.iso
8-
usersfs.img
3+
.vagga/

Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM usersfs
2+
3+
MAINTAINER Jesús Leganés Combarro 'piranna' <piranna@gmail.com>
4+
5+
ENTRYPOINT ["/init"]

README.md

+44-45
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
Lightweight operating system using [Node.js](http://nodejs.org) as userspace.
66

77
NodeOS is an operating system build entirely in Javascript and managed by
8-
[npm](https://www.npmjs.com/). Any package in npm is a NodeOS package, which at
9-
last count was 201,871 packages. The goal of NodeOS is to provide just enough to
8+
[npm](https://www.npmjs.com). Any package in npm is a NodeOS package, which at
9+
last count was 206,609 packages. The goal of NodeOS is to provide just enough to
1010
let npm provide the rest. Since anyone can contribute to npm, anyone can create
1111
NodeOS packages.
1212

@@ -20,50 +20,52 @@ and the Granada University [2nd Free Projects prize](http://osl.ugr.es/bases-de-
2020

2121
## find us
2222

23-
- Web: please use [github issues](https://github.com/NodeOS/NodeOS/issues) for discussion
23+
- Web: please use [github issues](https://github.com/NodeOS/NodeOS/issues) for
24+
discussion
2425
- IRC: join `#node-os` on Freenode
2526

2627
## introduction
2728

2829
NodeOS is a Node.js based operating system, built-off of the Linux kernel.
2930
The eventual goal of NodeOS is to produce images that can be run on
3031

31-
- **real hardware** like desktop PCs, servers or Raspberry Pi
32+
- **real hardware** like desktop PCs, laptops, servers or Raspberry Pi
3233
- **cloud providers** like Joyent, Amazon or Rackspace
3334
- **virtual machines** like QEmu, VirtualBox, VMWare and KVM
3435
- **PaaS providers** like Heroku or Joyent's Manta
35-
- **container providers** like Docker
36+
- **container providers** like Docker or vagga
3637

3738
Core development is being done in layers. There could be some differences to
3839
adjust better to each target platform, but the general structure is:
3940

4041
- *barebones* custom Linux kernel with an initramfs that boots to a Node.js REPL
41-
- *initramfs* Initram environment to mount the users partition & root filesystem
42+
- *initramfs* Initram environment to mount the users partition & boot the system
4243
- *rootfs* Read-only partition image to host Linux kernel and initramfs files
4344
- *usersfs* multi-user environment with the same behaviour of traditional OSes
4445

4546
### Booting process
4647

47-
All the layers are bootable, leading *barebones* to a Node.js
48-
[REPL](http://nodejs.org/api/repl.html) prompt. *initramfs* (and by extension
49-
*rootfs*) lead to a Node.js REPL by default if not using a custom one. In all
50-
the cases, it will be used an initramfs as root filesystem and all the changes
51-
will be lost when powered-off.
48+
All the layers are bootable, leading *barebones* to a raw naked Node.js
49+
[REPL](http://nodejs.org/api/repl.html) prompt as PID 1. *initramfs* (and by
50+
extension *rootfs*) lead to a Node.js REPL where `/dev` and `/proc` filesystems
51+
are mounted. In all the cases, it will be used an initramfs as root filesystem
52+
and all the changes will be lost when powered-off.
5253

5354
If a users partition is being set at boot time, it will be mounted and the
5455
system will considerate each one of the folders there as the home folder for a
55-
valid user on the system and executing a ```init``` file in the root of each of
56-
them. If found, ```root``` user will be the first to be considerated and will
57-
have access to all the home directories.
56+
valid user on the system and will execute a `init` file in the root of each of
57+
them. If found, `root` user will be the first to be considerated and will have
58+
access to all the home directories, but by design it will not be possible to
59+
elevate permissions once the system has booted.
5860

5961
### Hacking
6062

6163
If you are hacking on NodeOS as a somewhat production server, you are likely
6264
building *usersfs* images since each user is isolated of others, but you can be
6365
able to customize all layers. For example, you could be able to modify
6466
*initramfs* to login the users and mount their home folders from a cloud service
65-
or craft a system without global services (no ```root``` user) or also dedicate
66-
a full NodeOS instance to a single application.
67+
or craft a system without global services (no `root` user) or also dedicate a
68+
full NodeOS instance to a single Node.js application.
6769

6870

6971
# Pre-build images
@@ -77,57 +79,54 @@ The *iso* can be written to a CD-R or flashed to an USB pendrive, but will only
7779
provide the read-only rootfs and the changes will be done in memory loosing them
7880
after reboot, so you'll need to set manually a read-write usersfs partition if
7981
you want to persist them. On the other hand, if you want to flash it to an USB
80-
pendrive, it's recomended to so it by using ```bin/istallUSB``` command so it
81-
will create automatically a read-write usersfs partition to fill the remaining
82-
space so your changes will persist.
82+
pendrive, it's recomended to so it by using `bin/istallUSB` command so it will
83+
create automatically a read-write usersfs partition to fill the remaining space
84+
so your changes will persist.
8385

8486
# Build NodeOS in three steps
8587

8688
NodeOS require to have first installed some build tools, on a Ubuntu based
87-
system you can install them by executing the file ```bin/install-dependencies```
89+
system you can install them by executing the file `bin/install-dependencies`
8890

8991
1. Download the project source code and build NodeOS for QEmu:
90-
91-
```bash
92-
git clone git@github.com:NodeOS/NodeOS.git
93-
cd NodeOS
94-
npm install
95-
```
96-
By default it generate some files that can be used with QEmu, compiled for your
97-
current architecture. You can be able to configure the build process by passing
98-
some environment variables. For example, to force to build for 32 bits, use
99-
```PLATFORM=qemu_32 npm install``` instead.
100-
92+
```bash
93+
git clone git@github.com:NodeOS/NodeOS.git
94+
cd NodeOS
95+
npm install
96+
```
97+
By default it generate some files that can be used with QEmu, compiled for
98+
your current architecture. You can be able to configure the build process by
99+
passing some environment variables. For example, to force to build for 32
100+
bits, use `PLATFORM=qemu_32 npm install` instead.
101101
2. Pick some microwave pop-corn and go to see a movie. No, really, do it.
102102
3. Exec your fresh compiled NodeOS image:
103-
104-
```bash
105-
npm start
106-
```
107-
It will automatically detect what CPU architecture will need to be used on QEmu.
103+
```bash
104+
npm start
105+
```
106+
It will automatically detect what CPU architecture will need to be used on
107+
QEmu.
108108

109109
...and profit! :-D
110110

111111
If you encounter an error when building NodeOS, take a look at
112112
[the wiki](https://github.com/NodeOS/NodeOS/wiki/Fixing-NodeOS-Build-Errors) or
113113
open an [issue](https://github.com/NodeOS/NodeOS/issues).
114114

115-
# NodeOS on Docker
115+
# NodeOS on LXC containers (Docker and vagga)
116116

117-
Currently Docker support is unmaintained. There are some NodeOS images on Docker
118-
Hub, but they are outdated. If you are interested on help or testing, you can
117+
Currently LXC containers support is unmaintained due to imposibility of mount
118+
filesystems from inside them. There are some NodeOS images on Docker Hub, but
119+
they are totally outdated. If you are interested on help or testing, you can
119120
build them from source code.
120121

121122
## Quick Start
122123

123124
1. [Install Docker](http://docs.docker.io/en/latest/installation/)
124125
2. One Liner
125-
126-
```bash
127-
sudo docker run -t -i nodeos/nodeos
128-
```
129-
130-
or learn how to make a [Custom Build](http://node-os.com/blog/get-involved/)
126+
```bash
127+
sudo docker run -t -i nodeos/nodeos
128+
```
129+
or learn how to make a [Custom Build](http://node-os.com/blog/get-involved/)
131130

132131
## Build from Source
133132

bin/install-dependencies

+25-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
1-
#! /usr/bin/env sh
1+
#! /usr/bin/env bash
2+
3+
set -o pipefail
4+
5+
6+
APT='apt-get -qq -y'
7+
28

39
#
410
# Install Ubuntu dependencies
511
# The dependencies of one level would also be needed for the next ones
612
#
713

814
# Update cache
9-
dpkg --add-architecture i386
10-
apt-get update -qq || exit 1
15+
dpkg --add-architecture i386 &&
16+
$APT update || exit 1
17+
18+
19+
# Ubuntu 14.04 LTS has an old version of qemu-user (2.0.0)
20+
# Install the one from the Vivid repository
21+
wget -P deps \
22+
http://security.ubuntu.com/ubuntu/pool/universe/q/qemu/qemu-user_2.2+dfsg-5expubuntu9.5_amd64.deb &&
23+
dpkg -i deps/*.deb || exit 2
1124

1225

1326
# cross-compiler
14-
apt-get install -qq -y gcc texinfo || exit 10
27+
$APT install gcc texinfo || exit 10
1528

1629
# barebones
17-
apt-get install -qq -y bc qemu-system || exit 11
18-
19-
# initramfs
20-
apt-get install -qq -y nodejs-legacy || exit 12
30+
$APT install bc qemu-system qemu-user || exit 11
2131

2232
# rootfs
23-
apt-get install -qq -y genisoimage libuuid1:i386 || exit 13
33+
$APT install genisoimage libuuid1:i386 || exit 12
2434

2535
# usersfs
26-
apt-get install -qq -y autoconf automake || exit 14
36+
$APT install autoconf automake || exit 13
37+
38+
39+
# Update Node.js to v0.12 from the NodeSource repository
40+
curl -sL https://deb.nodesource.com/setup_0.12 | bash &&
41+
$APT install nodejs || exit 20

bin/publishRelease

-36
This file was deleted.

node_modules/.gitignore

+8-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/nodeos-barebones/.gitignore

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/nodeos-barebones/node_modules/.gitignore

-1
This file was deleted.

node_modules/nodeos-barebones/node_modules/nodeos-cross-toolchain/package.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/nodeos-barebones/node_modules/nodeos-cross-toolchain/scripts/adjustEnvVars.sh

+18-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)