Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ A longer list of features and limitations is on the [wiki feature list](https://

### Install libraries

**NOTE:** The script will install packages and create a network bridge, and thus will ask for sudo access.

```
$ git clone https://github.com/hioa-cs/IncludeOS
$ cd IncludeOS
$ sudo ./install.sh
$ ./install.sh
```

**The script will:**
Expand All @@ -57,8 +59,6 @@ A longer list of features and limitations is on the [wiki feature list](https://
* Build the vmbuilder, which turns your service into a bootable image.
* Copy `vmbuild` and `qemu-ifup` from the repo, over to `$INCLUDEOS_HOME`.

**NOTE:** The script will install packages, and thus will require sudo access.

Detailed installation instructions for [Vagrant](https://github.com/hioa-cs/IncludeOS/wiki/Vagrant), [OS X](https://github.com/hioa-cs/IncludeOS/wiki/OS-X) and [Ubuntu](https://github.com/hioa-cs/IncludeOS/wiki/Ubuntu) are available in the Wiki, as well as instructions for [building everything from source](https://github.com/hioa-cs/IncludeOS/wiki/Ubuntu#b-completely-build-everything-from-source-slow).

### Testing the installation
Expand Down
11 changes: 8 additions & 3 deletions etc/create_bridge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ GATEWAY=10.0.0.1
NETWORK=10.0.0.0
DHCPRANGE=10.0.0.2,10.0.0.254

brctl addbr $BRIDGE
ifconfig $BRIDGE $GATEWAY netmask $NETMASK up
# Check if bridge already is created
if brctl show $BRIDGE 2>&1 | grep --silent "No such device"; then
sudo brctl addbr $BRIDGE || exit 1
fi

sudo ifconfig $BRIDGE $GATEWAY netmask $NETMASK up || exit 1

# Håreks cool hack:
# - First two bytes is fixed to "c001" because it's cool
# - Last four is the gateway IP, 10.0.0.1
ifconfig include0 hw ether c0:01:0a:00:00:01
sudo ifconfig include0 hw ether c0:01:0a:00:00:01 || exit 1

exit 0
10 changes: 5 additions & 5 deletions etc/install_build_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ case $SYSTEM in
case $RELEASE in
"Ubuntu")
UBUNTU_VERSION=`lsb_release -rs`
if [ $(awk 'BEGIN{ print "'$UBUNTU_VERSION'"<"'16.04'" }') -eq 1 ]; then
if [ $(awk 'BEGIN{ print "'$UBUNTU_VERSION'"<"'16.04'" }') -eq 1 ]; then
clang_version="3.6"
DEPENDENCIES="gcc-5 g++-5"
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test || exit 1
else
clang_version="3.8"
fi

DEPENDENCIES="curl make clang-$clang_version nasm bridge-utils qemu jq $DEPENDENCIES"
echo ">>> Installing dependencies (requires sudo):"
echo " Packages: $DEPENDENCIES"
sudo apt-get update
sudo apt-get install -y $DEPENDENCIES
sudo apt-get update || exit 1
sudo apt-get install -y $DEPENDENCIES || exit 1
exit 0;
;;
"Fedora")
DEPENDENCIES="curl make clang nasm bridge-utils qemu jq"
echo ">>> Installing dependencies (requires sudo):"
echo " Packages: $DEPENDENCIES"
sudo dnf install $DEPENDENCIES
sudo dnf install $DEPENDENCIES || exit 1
exit 0;
;;
esac
Expand Down
32 changes: 26 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ check_os_support() {
return 1;
}

# check if sudo is available
if ! command -v sudo > /dev/null 2>&1; then
echo -e ">>> Sorry <<< \n\
The command sudo was not found. \n"
exit 1
fi

# check if system is supported at all
if ! check_os_support $SYSTEM $RELEASE; then
echo -e ">>> Sorry <<< \n\
Expand All @@ -43,22 +50,35 @@ fi

# now install build requirements (compiler, etc). This was moved into
# a function of its own as it can easen the setup.
./etc/install_build_requirements.sh $SYSTEM $RELEASE
if ! ./etc/install_build_requirements.sh $SYSTEM $RELEASE; then
echo -e ">>> Sorry <<< \n\
Could not install build requirements. \n"
exit 1
fi

# if the --all-source parameter was given, build it the hard way
if [ "$1" = "--all-source" ]; then
echo ">>> Installing everything from source"
./etc/install_all_source.sh

elif [ "Darwin" = "$SYSTEM" ]; then
# TODO: move build dependencies to the install build requirements step
./etc/install_osx.sh
elif [ "Linux" = "$SYSTEM" ]; then
# TODO: move build dependencies to the install build requirements step
./etc/install_osx.sh

elif [ "Linux" = "$SYSTEM" ]; then
echo -e "\n\n>>> Calling install_from_bundle.sh script"
./etc/install_from_bundle.sh
if ! ./etc/install_from_bundle.sh; then
echo -e ">>> Sorry <<< \n\
Could not install from bundle. \n"
exit 1
fi

echo -e "\n\n>>> Creating a virtual network, i.e. a bridge. (Requires sudo)"
sudo ./etc/create_bridge.sh
if ! ./etc/create_bridge.sh; then
echo -e ">>> Sorry <<< \n\
Could not create or configure bridge. \n"
exit 1
fi

echo -e "\n\n>>> Done! Test your installation with ./test.sh"
fi
Expand Down