summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-27 11:07:57 +0200
committerThomas Haller <thaller@redhat.com>2018-03-27 11:13:41 +0200
commita1875852221a99fa34e0a5e534e218a9f9291570 (patch)
tree470eeed0b04fdd745bbd23498ea974862abeee74
parentb2edcdc939bbc0197dbbed8da044d1ecd76aae0b (diff)
downloadNetworkManager-a1875852221a99fa34e0a5e534e218a9f9291570.tar.gz
contrib/nm-live-vm: remove nm-live-vm scripts
They were not (notably) touched in more than 3 years. I doubt anybody is using them. Also, nowadays we have contrib/rpm to build NetworkManager packages for Fedora/RPM. We have copr, we have automated CI in CentOS CI and beaker. Also, nowadays it should be easy to spawn a a fedora image in a container or tools like vagrant. I think there are better alternatives. Drop the scripts.
-rw-r--r--contrib/fedora/nm-live-vm/.gitignore4
-rw-r--r--contrib/fedora/nm-live-vm/README20
-rwxr-xr-xcontrib/fedora/nm-live-vm/build.sh154
-rwxr-xr-xcontrib/fedora/nm-live-vm/nm-make-script.sh79
-rwxr-xr-xcontrib/fedora/nm-live-vm/run.sh43
-rw-r--r--contrib/fedora/nm-live-vm/self-extract.sh17
6 files changed, 0 insertions, 317 deletions
diff --git a/contrib/fedora/nm-live-vm/.gitignore b/contrib/fedora/nm-live-vm/.gitignore
deleted file mode 100644
index 0f63e25c18..0000000000
--- a/contrib/fedora/nm-live-vm/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-.build.log
-nm-live-vm/
-nm-live-vm.tar.gz
-nm-live-vm-bundle.sh
diff --git a/contrib/fedora/nm-live-vm/README b/contrib/fedora/nm-live-vm/README
deleted file mode 100644
index 75cff68a07..0000000000
--- a/contrib/fedora/nm-live-vm/README
+++ /dev/null
@@ -1,20 +0,0 @@
-NetworkManager live VM scripts
-------------------------------
-
-This set of scripts can be used to build a live initramfs image suitable for
-testing NetworkManager in a virtual environment. The scripts themselves are
-intended to be used by a power user who can adapt them to their needs. The
-result, on the contrary, is intended to be used by anyone who wants to play
-with NetworkManager on the command line.
-
-Building the initramfs image:
-
-sudo ./build.sh [-n name] [-b branch/commit]
-
-You may have to update ./build.sh to suit your distribution. The included
-version is prepared for Fedora 20 and the image is also build using Fedora 20
-repositories.
-
-Then you can distribute the self-extracting archive and run it on other machines:
-
-./nm-live-vm-bundle.sh
diff --git a/contrib/fedora/nm-live-vm/build.sh b/contrib/fedora/nm-live-vm/build.sh
deleted file mode 100755
index 6333861705..0000000000
--- a/contrib/fedora/nm-live-vm/build.sh
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/bin/bash
-
-
-set -vx
-
-die() {
- echo "$@" >&2
- exit 1
-}
-
-BASEDIR="$(readlink -f "$(dirname "$0")")"
-cd "$BASEDIR" || die "Could not switch directory."
-
-# copy output also to logfile
-exec > >(tee ./.build.log)
-exec 2>&1
-
-if git rev-parse --git-dir 2> /dev/null; then
- INSIDE_GIT=1
-else
- INSIDE_GIT=
-fi
-
-NAME="nm-live-vm"
-if [[ $INSIDE_GIT ]]; then
- NM_BRANCH="HEAD"
-else
- NM_BRANCH=master
-fi
-
-BUILD_PACKAGES="qemu febootstrap mock rpmdevtools"
-ARCH=i386
-ROOT="${ROOT:-"fedora-20-$ARCH"}"
-TREE="/var/lib/mock/$ROOT/root"
-PACKAGES="kernel passwd git autoconf automake libtool intltool gtk-doc
- dbus-glib-devel libuuid-devel nss-devel ppp-devel newt-devel libndp-devel
- readline-devel
- gobject-introspection-devel
- pygobject3
- dhclient dnsmasq
- bash-completion man-db man-pages vim-minimal
- firewalld
- vim
- wget
- gdb valgrind lsof strace nmap-ncat tcpdump
- net-tools bridge-utils vconfig
- openssh-server
- teamd libteam"
-KERNEL_URL=http://kojipkgs.fedoraproject.org/packages/kernel/3.12.9/301.fc20/i686/kernel-3.12.9-301.fc20.i686.rpm
-KERNEL=`basename "${KERNEL_URL%.rpm}"`
-#RELEASE="http://kojipkgs.fedoraproject.org/packages/fedora-release/20/1/noarch/fedora-release-20-1.noarch.rpm"
-#PACKAGES="systemd bash"
-
-check_root() {
- test "$EUID" -eq 0
-}
-
-do_prepare() {
- echo "Installing build packages..."
- check_root || die "$0 must be run as root"
- rpm -q $BUILD_PACKAGES || yum install $BUILD_PACKAGES || exit 1
- echo
-}
-
-do_chroot() {
- echo "Building the chroot..."
- mock -r "$ROOT" --init || exit 1
- mock -r "$ROOT" --install $PACKAGES || exit 1
- #mock -r "$ROOT" --installdeps NetworkManager || exit 1
- mock -r "$ROOT" --chroot cp /sbin/init /init || exit 1
- echo
-}
-
-do_build() {
- echo "Building NetworkManager..."
-
- if [[ $INSIDE_GIT ]]; then
- # make first a local, bare clone of our git repository and copy it into the chroot.
- # nm-make-script.sh will try to fetch from it first, to save bandwidth
- GIT1="`git rev-parse --show-toplevel`"
- GIT2="`mktemp --tmpdir -d nm.git-XXXXXXXXX`"
- git clone --bare "$GIT1" "$GIT2" || die "Could not make local clone of git dir"
- mock -r "$ROOT" --chroot 'rm -rf /NetworkManager-local.git'
- mock -r "$ROOT" --copyin "$GIT2" "/NetworkManager-local.git" || die "Could not copy local repositoy"
- rm -rf "$GIT2"
- fi
-
- # run the make script in chroot.
- mock -r "$ROOT" --copyin nm-make-script.sh "/usr/local/sbin/" || exit 1
- mock -r "$ROOT" --chroot "/usr/local/sbin/nm-make-script.sh \"$NM_BRANCH\"" || exit 1
- test -f "$TREE/usr/sbin/NetworkManager" || die "NetworkManager binary not found"
- echo
-}
-
-do_live_vm() {
- echo "Preparing kernel and initrd..." || exit 1
- mkdir -p $NAME || exit 1
- cp $TREE/boot/vmlinuz* $NAME/vmlinuz || exit 1
- mock -r "$ROOT" --chroot "{ ( cd / ; \
- echo '/dev/sda1 /mnt/sda1 vfat defaults 0 0' >> /etc/fstab ; \
- find -not \( \
- -path ./tmp/initramfs.img -o \
- -path './var/cache/yum/*' -o \
- -path './boot' \
- \) -xdev -print0 | \
- cpio -o0c ) || exit 1; } | gzip > /tmp/initramfs.img || exit 1" || die "error creating initramfs"
- cp "$TREE/tmp/initramfs.img" "$NAME/" || exit 1
- cp run.sh $NAME/run.sh
-}
-
-do_archive() {
- echo "Creating the archive..."
- tar -czvf $NAME.tar.gz $NAME || exit 1
- EXTRACT_SCRIPT=$(sed -e "s/__NAME_PLACEHOLDER__/$NAME/g" < self-extract.sh)
- echo "$EXTRACT_SCRIPT" | cat - ${NAME}.tar.gz > ${NAME}-bundle.sh || exit 1
- chmod +x ${NAME}-bundle.sh || exit 1
- echo "Successfully completed"
- echo
- echo "Now you can run and/or distribute: ${NAME}-bundle.sh"
-}
-
-
-if [ "$1" = "-n" ]; then
- test -n "$2" || { echo "Name for initramfs is expected"; exit 1; }
- NAME=$2
- shift 2
-fi
-
-if [ "$1" = "-b" ]; then
- test -n "$2" || { echo "NM branch (commit) is expected"; exit 1; }
- NM_BRANCH=$2
- shift 2
-fi
-
-if [[ $INSIDE_GIT ]]; then
- NM_BRANCH="$(git rev-parse -q --verify "$NM_BRANCH")" || die "Could not resolve branch $NM_BRANCH"
-fi
-
-if [ $# -eq 0 ]; then
- check_root && do_prepare
- do_chroot
- do_build
- do_live_vm
- do_archive
- exit 0
-fi
-
-while [ $# -gt 0 ]; do
- do_$1; shift
- exit 0
-done
-
-echo "Wrong number of arguments."
-exit 1
diff --git a/contrib/fedora/nm-live-vm/nm-make-script.sh b/contrib/fedora/nm-live-vm/nm-make-script.sh
deleted file mode 100755
index f987842eff..0000000000
--- a/contrib/fedora/nm-live-vm/nm-make-script.sh
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-
-set -vx
-
-die() {
- echo "$@" >&2
- exit 1
-}
-
-COMMIT=${1:-origin/master}
-
-URL="${2:-"git://anongit.freedesktop.org/NetworkManager/NetworkManager"}"
-
-passwd -d root
-test -d /NetworkManager || (
- git init /NetworkManager
- cd /NetworkManager
-
- # check if there is a local git repository and fetch from it first (should be faster)
- test -d "/NetworkManager-local.git" && (
- git remote add local "/NetworkManager-local.git"
- git fetch local
- git remote remove local
- rm -rf "/NetworkManager-local.git"
- )
- git remote add origin "$URL"
-)
-cd /NetworkManager/ || exit 1
-git fetch origin || die "Could not fetch $URL"
-git checkout -f "$COMMIT" || exit 1
-git clean -fdx
-export CFLAGS='-g -Og'
-export CXXFLAGS='-g -Og'
-./autogen.sh --prefix=/usr \
- --exec-prefix=/usr \
- --libdir=/usr/lib \
- --sysconfdir=/etc \
- --localstatedir=/var \
- --with-nmtui=yes \
- --enable-gtk-doc || exit 1
-make || exit 1
-#make check || exit 1
-make install || exit 1
-cat <<EOF > /etc/NetworkManager/NetworkManager.conf
-[main]
-plugins=ifcfg-rh
-debug=RLIMIT_CORE
-[logging]
-level=DEBUG
-domains=ALL
-EOF
-/bin/systemctl enable NetworkManager.service || exit 1
-/bin/systemctl enable sshd.service || exit 1
-
-git config --global user.name "NetworkManager Test VM"
-git config --global user.email "networkmanager-maint@gnome.bugs"
-
-cat <<EOF > /root/.vimrc
-EOF
-
-cat <<EOF > /root/.bashrc
-LS_OPTIONS='--color=auto -Q'
-alias l='ls \$LS_OPTIONS -la'
-alias ll='ls \$LS_OPTIONS -l'
-EOF
-
-# allow login for root via SSH, without password!!
-sed -e 's/^#\?\(PermitRootLogin *\).*/\1yes/' \
- -e 's/^#\?\(PermitEmptyPasswords *\).*/\1yes/' \
- -i /etc/ssh/sshd_config
-
-# disable rate limiting of the journal
-sed -e 's/^#\?\(RateLimitInterval *= *\).*/\10/' \
- -e 's/^#\?\(RateLimitBurst *= *\).*/\10/' \
- -i /etc/systemd/journald.conf
-
-mkdir /mnt/sda1
-
-git gc
diff --git a/contrib/fedora/nm-live-vm/run.sh b/contrib/fedora/nm-live-vm/run.sh
deleted file mode 100755
index cd9f7c238a..0000000000
--- a/contrib/fedora/nm-live-vm/run.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# Three network interfaces
-NET_OPTIONS="-net nic -net user,hostfwd=tcp:127.0.0.1:10022-:22 -net nic -net user -net nic -net user"
-
-OS="Linux"
-if [ -f /etc/redhat-release ]; then
- OS=`cat /etc/redhat-release | cut -d" " -f1,2,3,4`
-fi
-
-DIR="$(dirname "$(readlink -f "$0")")"
-SDIR="$DIR/share"
-MEMORY=$((3*1024))
-
-mkdir "$SDIR"
-
-cd "$DIR"
-
-if [ "$OS" == "Red Hat Enterprise Linux" ]; then
- # qemu-kvm is installed in /usr/libexec on RHEL6
- # and redirects its output to VNC server
-
- rpm -q qemu-kvm tigervnc >&2 || exit 1
-
- PATH=$PATH:/usr/libexec
-
- qemu-kvm -vnc :0 -m $MEMORY $NET_OPTIONS -kernel vmlinuz -append "video=1024x768 rootfstype=ramfs" -initrd initramfs.img &
-
- sleep 1
- vncviewer localhost
-
-else
- # all other distros
-
- QEMU="qemu-kvm"
- which $QEMU &>2 || {
- ARCH=`uname -m`
- which qemu-system-$ARCH &>2 || { echo "Neither '$QEMU' nor 'qemu-system-$ARCH' available"; exit 1; }
- QEMU="qemu-system-$ARCH -enable-kvm"
- }
-
- $QEMU -m $MEMORY -net nic $NET_OPTIONS -drive "file=fat:rw:$SDIR,cache=none" -kernel vmlinuz -append "video=1024x768 rootfstype=ramfs" -initrd initramfs.img
-fi
diff --git a/contrib/fedora/nm-live-vm/self-extract.sh b/contrib/fedora/nm-live-vm/self-extract.sh
deleted file mode 100644
index 754e98337d..0000000000
--- a/contrib/fedora/nm-live-vm/self-extract.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-NAME=__NAME_PLACEHOLDER__
-BUNDLE=`readlink -f "$0"` || exit 1
-TEMP=`mktemp -d "$PWD/$NAME.XXXXXXXXXX"` || exit 1
-
-echo "Extracting to: $TEMP"
-cd "$TEMP" || exit 1
-sed '1,/^__MARK__$/d' "$BUNDLE" > $NAME.tar.gz || exit 1
-tar -xvf $NAME.tar.gz || exit 1
-cd $NAME || exit 1
-
-./run.sh || exit 1
-
-#rm -rf "$TEMP"
-exit 0
-__MARK__