Coder Social home page Coder Social logo

erlang's Introduction

erlang

patches for erlang to run on Nanos

Grab Source:

wget http://erlang.org/download/otp_src_23.0.tar.gz

Patch your repo:

patch -p1 -ruN -d ~/otp < 0001-BEAM-embed-erlexec-and-EPMD.patch
patch -p1 -ruN -d ~/otp < 0002-kernel-auth-erl-skip-cookie-file-permission-checks.patch
patch -p1 -ruN -d ~/otp < 0003-erl_child_setup_thread.patch
patch -p1 -ruN -d ~/otp < 0004-erlexec-nodename-from-ifaddr.patch
patch -p1 -ruN -d ~/otp < 0005-erl_child_setup_thread-netstat-for-inet_ext.patch
patch -p1 -ruN -d ~/otp < 0006-disable-mremap.patch

(Note that the patch 0005 is only useful for packages that use the "inet_ext" package for erlang, such as Helium Miner.)

Build:

./configure && make
sudo make install

Build Hello World:

./erl -compile hi
./erl -noshell -s hi start -s init stop

Config:

{
  "Env": {
    "HOME": "/",
    "ROOTDIR": "/usr/local/lib/erlang",
    "BINDIR": "/usr/local/lib/erlang/erts-11.0/bin",
    "EMU": "beam",
    "PROGNAME": "hi"
  },

  "Args": ["/usr/local/lib/erlang/erts-11.0/bin/erlexec", "-noshell", "-s", "hi", "start", "-s", "init", "stop", "+S", "1"],

  "Files": ["hi.beam"],
  "Dirs": ["usr"]
}

More Prep:

mkdir -p usr/local/lib
cp -R /usr/local/lib/erlang usr/local/lib/.
cp /usr/local/lib/erlang/erts-11.0/bin/erlexec .

RUN

ops run -c config.json erlexec

[/usr/local/lib/erlang/erts-11.0/bin/erlexec -noshell -s hi start -s
init stop +S 1]
booting /home/eyberg/.ops/images/erlexec.img ...
assigned: 10.0.2.15
Hello, world!
exit status 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.