Skip to content

Commit 63d1e87

Browse files
committed
Merge branch 'master' of github.com:NodeOS/NodeOS
2 parents 3057314 + 248cfdd commit 63d1e87

63 files changed

Lines changed: 1510 additions & 72 deletions

Some content is hidden

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

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# NodeOS
2+
#
3+
# Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna'
4+
# and other contributors
5+
#
6+
# MIT License
7+
18
node_modules/
29
npm-debug.log
310
.vagga/

Contributing.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!---
2+
NodeOS
3+
4+
Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna' and
5+
other contributors
6+
7+
MIT License
8+
-->
9+
110
## Overview
211

312
This repository is for:
@@ -7,14 +16,16 @@ This repository is for:
716
3. high-level planning
817

918
You should feel free to shoot from the hip when posting issues.
10-
Having said that, please take a moment to *search* for [open issues](https://github.com/NodeOS/NodeOS/issues "open issues on NodeOs") before posting.
11-
Long threads are okay.
19+
Having said that, please take a moment to *search* for
20+
[open issues](https://github.com/NodeOS/NodeOS/issues "open issues on NodeOs")
21+
before posting. Long threads are okay.
1222

1323
## Contributing FAQ
1424

1525
> Why not a mailing list?
1626
17-
1. it's *yet another* point of contact. This repo should be your single source of truth in exploring node-os.
27+
1. it's *yet another* point of contact. This repo should be your single source
28+
of truth in exploring node-os.
1829
2. github issues can be setup to mail you, and you can reply from email
1930
3. better linking to actual code
2031
4. markdown is good

LICENSE.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
MIT License
22

3-
Copyright (c) 2013-2016 Jacob Groundwater, Jesús Leganés-Combarro 'piranna' and
3+
Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna' and
44
other contributors
55

6-
This software consists of voluntary contributions made by many individuals. For
7-
exact contribution history, see the revision history available at
8-
https://github.com/NodeOS/NodeOS
9-
10-
The following license applies to all parts of this software:
11-
12-
====
13-
146
Permission is hereby granted, free of charge, to any person obtaining a copy
157
of this software and associated documentation files (the "Software"), to deal
168
in the Software without restriction, including without limitation the rights

README.md

Lines changed: 57 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<!---
2+
NodeOS
3+
4+
Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna' and
5+
other contributors
6+
7+
MIT License
8+
-->
9+
110
[![Build Status](https://semaphoreapp.com/api/v1/projects/71d72807-779a-40d3-a8d4-523cd0a52eb3/356164/shields_badge.svg)](https://semaphoreapp.com/nodeos/nodeos)
211
[![Stories in Ready](https://badge.waffle.io/NodeOS/NodeOS.png?label=ready&title=Ready)](https://waffle.io/NodeOS/NodeOS)
312
[![Join the chat at https://gitter.im/NodeOS/NodeOS](https://badges.gitter.im/NodeOS/NodeOS.svg)](https://gitter.im/NodeOS/NodeOS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -6,15 +15,16 @@
615

716
# NodeOS
817

18+
[![Greenkeeper badge](https://badges.greenkeeper.io/NodeOS/NodeOS.svg)](https://greenkeeper.io/)
19+
920
Lightweight operating system using [Node.js](http://nodejs.org) as userspace.
1021

11-
NodeOS is an operating system build entirely in Javascript and managed by
12-
[npm](https://www.npmjs.com). Any package in `npm` is a NodeOS package, which at
13-
last count was 301,660 packages. The goal of NodeOS is to provide just enough to
14-
let `npm` provide the rest. Since anyone can contribute to it, anyone can create
15-
NodeOS packages.
22+
NodeOS is an operating system built entirely in Javascript and managed by
23+
[npm](https://www.npmjs.com). Any package in `npm` is a NodeOS package, that means a selection of more than 400.000 packages. The goal of NodeOS is to provide just
24+
enough to let `npm` provide the rest. Since anyone can contribute to it, anyone
25+
can create NodeOS packages.
1626

17-
This project won the spanish [9th National Free Software Championship](https://www.concursosoftwarelibre.org/1415)
27+
This project won the Spanish [9th National Free Software Championship](https://www.concursosoftwarelibre.org/1415)
1828
on the Systems category and was Honorable Mention of its [10th edition](https://www.concursosoftwarelibre.org/1516).
1929
It was also presented as the degree thesis of [Jesús Leganes Combarro](https://github.com/piranna)
2030
with a qualification of 10/10 with distinction.
@@ -47,50 +57,48 @@ adjust better to each target platform, but the general structure is:
4757

4858
- *barebones* custom Linux kernel with an initramfs that boots to a Node.js REPL
4959
- *initramfs* Initram environment to mount the users partition & boot the system
50-
- *rootfs* Read-only partition image to host Linux kernel and initramfs files
5160
- *usersfs* multi-user environment with the same behaviour of traditional OSes
5261

5362
### Booting process
5463

5564
All the layers are bootable, leading *barebones* to a raw naked Node.js
56-
[REPL](http://nodejs.org/api/repl.html) prompt as PID 1, while *initramfs* (and
57-
by extension *rootfs*) exec actual NodeOS code to mount the *usersfs* partition.
58-
In all the cases, it will be used an initramfs as root filesystem and all the
59-
changes will be lost when powered-off.
65+
[REPL](http://nodejs.org/api/repl.html) prompt as PID 1, while *initramfs* exec
66+
actual NodeOS code to mount the *usersfs* partition. In all the cases, it will
67+
be used an initramfs as root filesystem and all the changes will be lost when
68+
powered off.
6069

6170
If a *usersfs* partition is being set at boot time, it will be mounted and the
62-
system will considerate each one of its folders as the home folder for a valid
71+
system will consider each one of its folders as the home folder for a valid
6372
user on the system, and will execute a `init` file in the root of each of them.
64-
If found, `root` user will be the first to be considerated and will have access
65-
to all the home directories, but by design it will not be possible to elevate
66-
permissions once the system has booted.
73+
If found, the `root` user will be the first to be considered and will have access
74+
to all of the home directories, but by design it will not be possible to elevate
75+
permissions once the system has finished booting.
6776

6877
### Hacking
6978

70-
If you are hacking on NodeOS as a somewhat production server, you are likely
71-
building *usersfs* images since each user is isolated of others, but you can be
72-
able to customize all layers. For example, you could be able to modify
73-
*initramfs* to login the users and mount their home folders from a cloud service
79+
If you are hacking on NodeOS for a somewhat production environment, you are
80+
likely building *usersfs* images since each user is isolated of others, but you
81+
can customize all layers. For example, you can modify
82+
*initramfs* to login users and mount their home folders from a cloud service
7483
or craft a system without global services (no `root` user) or also dedicate a
7584
full NodeOS instance to a single Node.js application.
7685

7786

78-
# Pre-built Images
87+
## Pre-built Images
7988

8089
Ready to use [pre-build images](https://github.com/NodeOS/NodeOS/releases) are
8190
automatically generated after each commit in master branch that sucessfully
8291
[pass the tests](https://semaphoreapp.com/nodeos/nodeos). To exec them, you'll
8392
need to have [QEmu](http://wiki.qemu.org/Main_Page) installed on your system.
8493

85-
The *iso* can be written to a CD-R or flashed to an USB pendrive, but will only
86-
provide the read-only rootfs and the changes will be done in memory loosing them
87-
after reboot, so you'll need to set manually a read-write usersfs partition if
88-
you want to persist them. On the other hand, if you want to flash it to an USB
89-
pendrive, it's recomended to do it by using `bin/installUSB` command so it will
90-
create automatically a read-write usersfs partition to fill the remaining space
91-
so your changes will persist.
94+
The *iso* can be written to a CD-R or flashed to a USB pendrive, but will only
95+
provide the read-only rootfs and the changes will be done in memory losing them
96+
after reboot, so you'll manually need to set a read-write usersfs partition if
97+
you want to persist them. On the other hand, if you want to flash it to a USB
98+
pendrive, I recommended doing it by using `bin/installUSB` command so it will
99+
automatically create a read-write usersfs partition to fill the remaining space and your changes will be persistent.
92100

93-
# Build NodeOS in five steps
101+
## Build NodeOS in five steps
94102

95103
1. Download the project source code:
96104

@@ -99,8 +107,7 @@ so your changes will persist.
99107
cd NodeOS
100108
```
101109

102-
2. Install the required build tools, on a Ubuntu based system you can do it by
103-
executing
110+
2. Install the required build tools. On a Ubuntu based system you can do it by executing:
104111

105112
```bash
106113
sudo bin/install-dependencies
@@ -110,22 +117,20 @@ so your changes will persist.
110117

111118
```bash
112119
npm install
113-
```
120+
```
114121

115-
3. Build NodeOS:
122+
4. Build NodeOS:
116123

117124
```bash
118125
npm run build
119126
```
120127

121128
By default it will generate some files that can be used with QEmu, compiled
122-
for your current machine architecture. You can be able to configure the build
129+
for your current machine architecture. You can configure the build
123130
process by passing some environment variables. For example, to force to build
124131
for 32 bits, use `PLATFORM=qemu_32 npm install` instead.
125132

126-
4. Pick some microwave pop-corn and go to see a movie. No, really, do it.
127-
128-
5. Exec your fresh compiled NodeOS image:
133+
5. Exec your freshly compiled NodeOS image:
129134

130135
```bash
131136
npm start
@@ -134,31 +139,30 @@ so your changes will persist.
134139
It will automatically detect what CPU architecture will need to be used on
135140
QEmu and exec the correct emulation.
136141

137-
...and profit! :-D
142+
...profit! :-D
138143

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

143-
# NodeOS on LXC containers (Docker and vagga)
148+
## NodeOS on LXC containers (Docker and vagga)
149+
150+
NodeOS fully officially supports Docker, but the images published to DockerHub are totally outdated (we're accepting PRs!). If you are interested in helping or testing, you can build them from source code.
144151
145-
Currently LXC containers support is unmaintained due to the inability to mount
146-
filesystems from inside them. There are some NodeOS images on Docker Hub, but
147-
they are totally outdated. If you are interested in help or testing, you can
148-
build them from source code.
152+
Vagga support is fairly experimental, and help here will be greatly appreciated.
149153
150-
## Quick Start
154+
### Quick Start
151155
152156
1. [Install Docker](http://docs.docker.io/en/latest/installation/)
153-
2. One Liner
157+
2. One Liner (outdated images)
154158
155159
```bash
156160
sudo docker run -t -i nodeos/nodeos
157161
```
158162
159163
or learn how to make a [Custom Build](http://node-os.com/blog/get-involved)
160164
161-
## Build from Source
165+
### Build from Source
162166
163167
*Warning*: the build process is hairy, it probably won't work the first time.
164168
I'm working on that.
@@ -168,3 +172,11 @@ git clone https://github.com/NodeOS/NodeOS.git
168172
cd NodeOS
169173
PLATFORM=docker npm install
170174
```
175+
176+
## License
177+
178+
MIT
179+
180+
This software consists of voluntary contributions made by many individuals. For
181+
exact contribution history, see the revision history available at
182+
https://github.com/NodeOS/NodeOS

Vagrantfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# -*- mode: ruby -*-
22
# vi: set ft=ruby :
33

4+
# NodeOS
5+
#
6+
# Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna'
7+
# and other contributors
8+
#
9+
# MIT License
10+
411
Vagrant.configure(2) do |config|
512
config.vm.box = "ubuntu/trusty64"
613

bin/install-dependencies

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#! /usr/bin/env bash
22

3+
# NodeOS
4+
#
5+
# Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna'
6+
# and other contributors
7+
#
8+
# MIT License
9+
310
set -o pipefail
411

512

bin/installUSB

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/usr/bin/env bash
22

3+
# NodeOS
4+
#
5+
# Copyright (c) 2013-2017 Jacob Groundwater, Jesús Leganés-Combarro 'piranna'
6+
# and other contributors
7+
#
8+
# MIT License
39

410
if [ "$#" -ne 3 ]; then
511
echo "Usage: $0 <DEVICE> <ROOTFS> <USERSFS>"

docs/Design.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Here lies our collective conciousness ##
2+
3+
Even as we discuss everything in the issues, additionally here you will find drafts for concepts and ideas for NodeOS. Feel free to contribute to an idea and should a great idea come across your mind, create a new Thread and page and link one to another!
4+
5+
6+
### Current Designs ###
7+
- [[file system|FileSystem]]
8+
- [[npkg]]
9+
- [[services]]
10+
- [[asgard]]
11+
- [[root]]
12+
- [[init]]

docs/FAQ.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# NodeOS Frequently Asked Questions #
2+
(Or solutions to problems you seem to have often).
3+
4+
Not many questions will be actually answered on this page, but rather linked to the respective page thank explains it to you nicely in detail. Hopefully at the start of the page a tl;dr will sum it all up for you if you don't have time.
5+
6+
Fixing NodeOS Build Errors: [[Fixing-NodeOS-Build-Errors]]
7+
8+
How do I add startup services?: [[Service Starter (PalmTree)]]

docs/FileSystem.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## system directories
2+
3+
The base filesystem is laid out as follows.
4+
5+
A few standard linux directories are now considered private,
6+
and only included for compatibility with the current *libc*.
7+
8+
```
9+
/bin <-- contains latest node executable
10+
/lib
11+
/usr
12+
/etc
13+
```
14+
15+
All user-editable content should be in user-directories.
16+
The root user's home is in it's standard `/root` location.
17+
18+
```
19+
/root <-- root user
20+
/home <-- non-root users
21+
```
22+
23+
The [[root]] user is special because it boots the system.
24+
25+
Other standard kernel-provided file systems are mounted in their usual locations.
26+
27+
```
28+
/dev <-- devfs
29+
/proc <-- procfs
30+
/sys <-- sysfs
31+
/tmp <-- tmpfs
32+
```
33+
34+
## user directories
35+
36+
There are no *global* services, modules, or commands.
37+
Directories that were once system-leve, like `etc`, and `var` are now user-local.
38+
39+
```
40+
$HOME/
41+
bin/ <-- executable commands
42+
ls, cp, mv
43+
lib/
44+
node_modules/ <-- modules installed by npkg
45+
log/ <-- logs from init jobs
46+
etc/ <-- configuration files
47+
var/ <-- persistent data
48+
tmp/ <-- ephemeral data
49+
```
50+
51+
In detail:
52+
53+
- `bin` contains executable commands, linked during `npkg install`.
54+
- `lib` contains `node_modules` which holds modules installed by `npkg`.
55+
- `log` contains output from services and jobs.
56+
- `etc` contains local config values for services and jobs
57+
- `var` holds persistent data for services and jobs.
58+
- `tmp` holds ephemeral data for services and jobs.
59+
60+
These directories are used assumed by the `npkg` command.

0 commit comments

Comments
 (0)