From 1315eaad1ddfec26141bd6ae4083515b844edefd Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Sat, 25 Mar 2017 00:24:55 -0300 Subject: [PATCH] fedora support pending: install guide issue #20 --- README.md | 7 +++++++ Vagrantfile | 1 + development-setup.sh | 2 ++ development-setup/Fedora.sh | 26 ++++++++++++++++++++++++++ holodev | 22 +++++++++++++++++++--- 5 files changed, 55 insertions(+), 3 deletions(-) create mode 100755 development-setup/Fedora.sh diff --git a/README.md b/README.md index a923fb5..336c7e9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ Supported GNU/Linux distributions: * Xenial * Archlinux * openSUSE +* Fedora + * Fedora 24 + * Fedora 25 ## sudo @@ -96,6 +99,10 @@ or: if you want the bleeding edge version. +## Installing in Fedora + +(pending) + ## Using The `holodev` script creates Linux Containers using the current directory plus the `git branch` to compose the container name, it covers the scenario where, for each project (directory), there is a Linux Container, so that it is not necessary to install development dependecies to your system. diff --git a/Vagrantfile b/Vagrantfile index b45b3d2..29dc2db 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,6 +7,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| xenial: 'ubuntu/xenial32', archlinux: 'terrywang/archlinux', opensuse: 'opensuse/openSUSE-42.1-x86_64', + fedora: 'fedora/25-cloud-base', }.each do |release, box| config.vm.define release do |machine| machine.vm.box = box diff --git a/development-setup.sh b/development-setup.sh index 5859538..1fd8d44 100755 --- a/development-setup.sh +++ b/development-setup.sh @@ -9,6 +9,8 @@ elif [ -f /etc/arch-release ]; then OS=Arch elif [ -f /etc/SuSE-release ]; then OS=Suse +elif [ -f /etc/fedora-release ]; then + OS=Fedora else OS=$(uname -s) fi diff --git a/development-setup/Fedora.sh b/development-setup/Fedora.sh new file mode 100755 index 0000000..0171f0c --- /dev/null +++ b/development-setup/Fedora.sh @@ -0,0 +1,26 @@ +# avoid routing (DUP!) error when ping some HOST +route add default gw 10.0.2.2 + +dnf --best --allowerasing --assumeyes install \ + bash-completion \ + bridge-utils \ + debootstrap \ + dnsmasq \ + ebtables \ + git \ + libvirt \ + lxc \ + shunit2 \ + sudo \ + which \ + make \ + lxc-templates \ + gnupg \ + xinetd + +echo 'PATH=$PATH:/usr/share/shunit2' > /etc/profile.d/shunit2.sh +echo 'export PATH' >> /etc/profile.d/shunit2.sh +source /etc/profile.d/shunit2.sh + +systemctl start libvirtd +systemctl enable libvirtd diff --git a/holodev b/holodev index eb9fc26..d26ed5b 100755 --- a/holodev +++ b/holodev @@ -27,6 +27,8 @@ elif [ -f /etc/arch-release ]; then OS=Arch elif [ -f /etc/SuSE-release ]; then OS=Suse +elif [ -f /etc/fedora-release ]; then + OS=Fedora else OS=$(uname -s) fi @@ -267,6 +269,14 @@ setup_libvirt_Arch() { setup_libvirt_Debian } +setup_libvirt_Linux() { + setup_libvirt_Debian +} + +setup_libvirt_Fedora() { + setup_libvirt_Debian +} + create_xinetd_config_file() { local FILENAME=/tmp/holodev-$CONTAINER_NAME.xinetd CONTAINER_IP=$(do_info | grep 'IP:' | awk '{print $2}') @@ -395,9 +405,15 @@ up_network() { if [ $SYSTEMD_IS_ACTIVE ]; then info "waiting the system be operational" IS_SYSTEM_RUNNING=$(lxc_attach systemctl is-system-running) - while ! echo $IS_SYSTEM_RUNNING | grep -q -e 'degraded' -e 'running'; do - sleep 1s - IS_SYSTEM_RUNNING=$(lxc_attach systemctl is-system-running) + RETRY=5 + while [ $RETRY -gt 0 ]; do + if ! echo $IS_SYSTEM_RUNNING | grep -q -e 'degraded' -e 'running'; then + sleep 2s + IS_SYSTEM_RUNNING=$(lxc_attach systemctl is-system-running) + RETRY=$(echo "$RETRY - 1" | bc) + else + RETRY=0 + fi done lxc_attach systemctl enable systemd-networkd.service lxc_attach systemctl start systemd-networkd.service