From 12f67e6a172fe611a014d65b753d3a51a27c7298 Mon Sep 17 00:00:00 2001 From: Jonathan Maw Date: Tue, 26 Mar 2013 12:08:51 +0000 Subject: Add nfsboot configuration extension This configuration-extension removes every network interface but the loopback interface from /etc/network/interfaces and stops /etc/fstab from mounting "/". It will only do this if the environment variable NFSBOOT_CONFIGURE is set on the `morph deploy` command-line. --- nfsboot.configure | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 nfsboot.configure (limited to 'nfsboot.configure') diff --git a/nfsboot.configure b/nfsboot.configure new file mode 100755 index 00000000..8dc6c67c --- /dev/null +++ b/nfsboot.configure @@ -0,0 +1,32 @@ +#!/bin/sh +# Copyright (C) 2013 Codethink Limited +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + +# Remove all networking interfaces and stop fstab from mounting '/' + + +set -e +if [ "$NFSBOOT_CONFIGURE" ]; then + # Remove all networking interfaces but loopback + cat > "$1/etc/network/interfaces" < "$1/etc/fstab" +fi -- cgit v1.2.1 From 5e686455f6cd4ef5870933d60544af78b167a545 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 18 Mar 2014 17:29:13 +0000 Subject: Remove fstab hack from nfsboot.configure There is no longer a default /etc/fstab in the Baserock fhs-dirs chunk, and the nfsboot.write extension does not use the default Btrfs system layout so no entry is added for / to /etc/fstab at deploy-time. We cannot have / in /etc/fstab for nfsboot deployments because it causes systemd to remount / during bootup, which breaks everything. --- nfsboot.configure | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'nfsboot.configure') diff --git a/nfsboot.configure b/nfsboot.configure index 8dc6c67c..d6b254d4 100755 --- a/nfsboot.configure +++ b/nfsboot.configure @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2013 Codethink Limited +# Copyright (C) 2013-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,7 +26,4 @@ auto lo iface lo inet loopback EOF - # Stop fstab from mounting '/' - mv "$1/etc/fstab" "$1/etc/fstab.old" - awk '/^ *#/ || $2 != "/"' "$1/etc/fstab.old" > "$1/etc/fstab" fi -- cgit v1.2.1 From fbf84afbb9c0bc27816ffcf310a681335c4775ee Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 18 Mar 2014 17:40:58 +0000 Subject: Improve comment in nfsboot.configure --- nfsboot.configure | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nfsboot.configure') diff --git a/nfsboot.configure b/nfsboot.configure index d6b254d4..660d9c39 100755 --- a/nfsboot.configure +++ b/nfsboot.configure @@ -15,7 +15,9 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# Remove all networking interfaces and stop fstab from mounting '/' +# Remove all networking interfaces. On nfsboot systems, eth0 is set up +# during kernel init, and the normal ifup@eth0.service systemd unit +# would break the NFS connection and cause the system to hang. set -e -- cgit v1.2.1 From ed741d8d090086e2380f7b9d68ddc3bd122acb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Fri, 13 Mar 2015 18:18:55 +0000 Subject: Use the modern way of the GPL copyright header: URL instead real address Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0 --- nfsboot.configure | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'nfsboot.configure') diff --git a/nfsboot.configure b/nfsboot.configure index 660d9c39..6a68dc48 100755 --- a/nfsboot.configure +++ b/nfsboot.configure @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2013-2014 Codethink Limited +# Copyright (C) 2013-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -11,8 +11,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# with this program. If not, see . # Remove all networking interfaces. On nfsboot systems, eth0 is set up -- cgit v1.2.1