Move some of the porterbox schroot logic to the schroot module that is shared with...
authorPeter Palfrader <peter@palfrader.org>
Sat, 12 Jul 2014 09:56:32 +0000 (11:56 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 12 Jul 2014 09:56:32 +0000 (11:56 +0200)
15 files changed:
modules/porterbox/files/schroot-dsa/config [deleted file]
modules/porterbox/files/schroot-dsa/fstab [deleted file]
modules/porterbox/files/schroot-dsa/fstab-freebsd [deleted file]
modules/porterbox/files/schroot-setup.d/99porterbox-extra-apt-options [deleted file]
modules/porterbox/files/schroot-setup.d/99porterbox-extra-sources [deleted file]
modules/porterbox/manifests/init.pp
modules/porterbox/templates/default-mirror.erb [deleted file]
modules/schroot/files/schroot-dsa/config [new file with mode: 0644]
modules/schroot/files/schroot-setup.d/99porterbox-extra-apt-options [new file with mode: 0755]
modules/schroot/files/schroot-setup.d/99porterbox-extra-sources [new file with mode: 0755]
modules/schroot/manifests/init.pp
modules/schroot/templates/default-mirror.erb [new file with mode: 0644]
modules/schroot/templates/etc/schroot/mount-defaults.erb [deleted file]
modules/schroot/templates/mount-defaults.erb [new file with mode: 0644]
modules/schroot/templates/schroot-dsa/fstab.erb [new file with mode: 0644]

diff --git a/modules/porterbox/files/schroot-dsa/config b/modules/porterbox/files/schroot-dsa/config
deleted file mode 100644 (file)
index ba94f6f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-# Settings for "dsa" profile.
-
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-FSTAB="/etc/schroot/dsa/fstab"
-[ -e "$FSTAB" ] || FSTAB="/etc/schroot/default/fstab"
-
-COPYFILES="/etc/schroot/dsa/copyfiles"
-[ -e "$COPYFILES" ] || COPYFILES="/etc/schroot/default/copyfiles"
-
-NSSDATABASES="/etc/schroot/dsa/nssdatabases"
-[ -e "$NSSDATABASES" ] || NSSDATABASES="/etc/schroot/default/nssdatabases"
-
-
-# added by weasel:
-if [ "$CHROOT_SESSION_PURGE" = "true" ]; then
-    case $CHROOT_DESCRIPTION in
-        "["*-*_*-dchroot"]"*)
-            chroot_type="$CHROOT_DESCRIPTION"; chroot_type="${chroot_type#\[}"; chroot_type="${chroot_type%%]*}"
-            suitevariant_arch_tuple="${chroot_type%%-dchroot-*}"
-            suitevariant=${suitevariant_arch_tuple%_*}
-            SUITE_BASE=${suitevariant%-*}
-            SUITE_VARIANT=${suitevariant##*-}
-        ;;
-        "["*_*-dchroot"]"*)
-            chroot_type="$CHROOT_DESCRIPTION"; chroot_type="${chroot_type#\[}"; chroot_type="${chroot_type%%]*}"
-            SUITE_BASE="${chroot_type%%_*}"
-        ;;
-        *)
-            if [ "$STAGE" = "setup-start" ]; then
-               echo >&2 "Unable to parse chroot description for what kind of chroot you want."
-               exit 1
-            fi
-        ;;
-    esac
-fi
-
-CHROOT_FILE_UNPACK_DIR=/srv/chroot/schroot-unpack
-
-if [ -e /etc/schroot/dsa/default-mirror ]; then
-    MIRROR=$(cat /etc/schroot/dsa/default-mirror )
-fi
-MIRROR=${MIRROR:-cdn.debian.net}
-
-if [ "$(basename "$0")" = "00check" ] &&
-   [ "$CHROOT_TYPE" = "file" ] &&
-   [ "$STAGE" = "setup-start" ]; then
-        echo "Untarring chroot environment.  This might take a minute or two."
-fi
diff --git a/modules/porterbox/files/schroot-dsa/fstab b/modules/porterbox/files/schroot-dsa/fstab
deleted file mode 100644 (file)
index d199237..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# fstab: static file system information for chroots.
-# Note that the mount point will be prefixed by the chroot path
-# (CHROOT_PATH)
-#
-# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
-/proc          /proc           none    rw,bind        0       0
-/sys           /sys            none    rw,bind        0       0
-/dev            /dev            none    rw,bind         0       0
-/dev/pts       /dev/pts        none    rw,bind         0       0
-/home          /home           none    rw,bind         0       0
-/tmp           /tmp            none    rw,bind         0       0
-tmpfs-shm      /dev/shm        tmpfs   defaults,size=64m       0 0
-
-# It may be desirable to have access to /run, especially if you wish
-# to run additional services in the chroot.  However, note that this
-# may potentially cause undesirable behaviour on upgrades, such as
-# killing services on the host.
-#/run          /run            none    rw,bind         0       0
-#/run/lock     /run/lock       none    rw,bind         0       0
-#/dev/shm      /dev/shm        none    rw,bind         0       0
-#/run/shm      /run/shm        none    rw,bind         0       0
diff --git a/modules/porterbox/files/schroot-dsa/fstab-freebsd b/modules/porterbox/files/schroot-dsa/fstab-freebsd
deleted file mode 100644 (file)
index 61fae34..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# fstab: static file system information for chroots.
-# Note that the mount point will be prefixed by the chroot path
-# (CHROOT_PATH)
-#
-# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
-proc           /proc           linprocfs       defaults        0       0
-dev            /dev            devfs   rw,bind         0       0
-dev            /dev/fd         fdescfs rw,bind         0       0
-/home          /home           nullfs  rw              0       0
-/tmp           /tmp            nullfs  rw              0       0
-
-# It may be desirable to have access to /run, especially if you wish
-# to run additional services in the chroot.  However, note that this
-# may potentially cause undesirable behaviour on upgrades, such as
-# killing services on the host.
-#/run          /run            nullfs  rw              0       0
-#/run/lock     /run/lock       nullfs  rw              0       0
diff --git a/modules/porterbox/files/schroot-setup.d/99porterbox-extra-apt-options b/modules/porterbox/files/schroot-setup.d/99porterbox-extra-apt-options
deleted file mode 100755 (executable)
index db240da..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-# by weasel
-
-set -e
-
-[ "$CHROOT_PROFILE" = "dsa" ] || exit 0
-
-. "$SETUP_DATA_DIR/common-data"
-. "$SETUP_DATA_DIR/common-functions"
-
-if [ -f "${CHROOT_SCRIPT_CONFIG:-}" ]; then
-    . "$CHROOT_SCRIPT_CONFIG"
-fi
-
-
-if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then
-       TGT="${CHROOT_PATH}/etc/apt/apt.conf.d/local-schroot"
-       rm -f "$TGT"
-       cat > "$TGT" << EOF
-APT::Install-Recommends 0;
-Acquire::http::Pipeline-Depth "0";
-Acquire::Languages "none";
-Acquire::PDiffs "false";
-EOF
-#Acquire  {
-#     http { Proxy "http://10.213.12.1:3128/"; };
-#     ftp { Proxy "http://10.213.12.1:3128/"; };
-#}
-fi
diff --git a/modules/porterbox/files/schroot-setup.d/99porterbox-extra-sources b/modules/porterbox/files/schroot-setup.d/99porterbox-extra-sources
deleted file mode 100755 (executable)
index 2bdff1b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-# by weasel
-
-set -e
-
-[ "$CHROOT_PROFILE" = "dsa" ] || exit 0
-
-. "$SETUP_DATA_DIR/common-data"
-. "$SETUP_DATA_DIR/common-functions"
-
-if [ -f "${CHROOT_SCRIPT_CONFIG:-}" ]; then
-    . "$CHROOT_SCRIPT_CONFIG"
-elif [ -f "$CHROOT_PROFILE_DIR/config" ]; then
-    . "$CHROOT_PROFILE_DIR/config"
-else
-    fatal "Cannot find config script"
-fi
-
-
-if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then
-  SRCL="${CHROOT_PATH}/etc/apt/sources.list.d/auto.list"
-  rm -f "$SRCL"
-  mirror=${MIRROR:-http://cdn.debian.net/debian}
-
-  case "${SUITE_BASE:-}" in
-    experimental)
-      echo "deb     $mirror sid main" >> "$SRCL"
-      echo "deb-src $mirror sid main" >> "$SRCL"
-      ;;
-    sid|jessie)
-      ;;
-    *)
-      echo "deb     http://security.debian.org/ ${SUITE_BASE}/updates main" >> "$SRCL"
-      echo "deb-src http://security.debian.org/ ${SUITE_BASE}/updates main" >> "$SRCL"
-      ;;
-  esac
-  echo "deb     $mirror ${SUITE_BASE} main" >> "$SRCL"
-  echo "deb-src $mirror ${SUITE_BASE} main" >> "$SRCL"
-
-  case "${SUITE_VARIANT:-}" in
-    backports)
-      case "${SUITE_BASE:-}" in
-        squeeze)
-          echo "deb     http://backports.debian.org/debian-backports/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
-          echo "deb-src http://backports.debian.org/debian-backports/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
-          ;;
-        *)
-          echo "deb     $mirror ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
-          echo "deb-src $mirror ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
-          ;;
-      esac
-      ;;
-  esac
-  echo "o To install build dependencies run"
-  echo "  dd-schroot-cmd -c ${SESSION_ID} apt-get update"
-  echo "  followed by build-dep/install as appropriate in the host system."
-  echo "o If you started this session with schroot -b, please do not forget to run"
-  echo "  schroot --end-session -c ${SESSION_ID}"
-  echo "  when you no longer need this environment."
-fi
index 5f3383a..8017985 100644 (file)
@@ -1,39 +1,6 @@
 class porterbox {
        include schroot
-       # FIXME: Refactor this to a common class when something else needs it
-       package { 'moreutils':
-               ensure => installed
-       }
 
-       file { '/etc/schroot/dsa':
-               ensure => directory,
-               require => Package['schroot'],
-       }
-       file { '/etc/schroot/dsa/config':
-               source  => 'puppet:///modules/porterbox/schroot-dsa/config',
-       }
-       if ! ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
-               file { '/etc/schroot/dsa/fstab':
-                       source  => 'puppet:///modules/porterbox/schroot-dsa/fstab',
-               }
-       } else {
-               file { '/etc/schroot/dsa/fstab':
-                       source  => 'puppet:///modules/porterbox/schroot-dsa/fstab-freebsd',
-               }
-       }
-       file { '/etc/schroot/dsa/default-mirror':
-               content => template('porterbox/default-mirror.erb'),
-       }
-       file { '/etc/schroot/setup.d/99porterbox-extra-apt-options':
-               mode    => '0555',
-               source  => 'puppet:///modules/porterbox/schroot-setup.d/99porterbox-extra-apt-options',
-               require => Package['schroot'],
-       }
-       file { '/etc/schroot/setup.d/99porterbox-extra-sources':
-               mode    => '0555',
-               source  => 'puppet:///modules/porterbox/schroot-setup.d/99porterbox-extra-sources',
-               require => Package['schroot'],
-       }
        file { '/usr/local/bin/dd-schroot-cmd':
                mode    => '0555',
                source  => 'puppet:///modules/porterbox/dd-schroot-cmd',
diff --git a/modules/porterbox/templates/default-mirror.erb b/modules/porterbox/templates/default-mirror.erb
deleted file mode 100644 (file)
index a5822f9..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<%=
-ninfo = scope.lookupvar('site::nodeinfo')
-if ninfo['hoster'].has_key?('mirror-debian') then
-    ninfo['hoster']['mirror-debian']
-else
-    'http://cdn.debian.net/debian'
-end
-%>
diff --git a/modules/schroot/files/schroot-dsa/config b/modules/schroot/files/schroot-dsa/config
new file mode 100644 (file)
index 0000000..ba94f6f
--- /dev/null
@@ -0,0 +1,52 @@
+# Settings for "dsa" profile.
+
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+FSTAB="/etc/schroot/dsa/fstab"
+[ -e "$FSTAB" ] || FSTAB="/etc/schroot/default/fstab"
+
+COPYFILES="/etc/schroot/dsa/copyfiles"
+[ -e "$COPYFILES" ] || COPYFILES="/etc/schroot/default/copyfiles"
+
+NSSDATABASES="/etc/schroot/dsa/nssdatabases"
+[ -e "$NSSDATABASES" ] || NSSDATABASES="/etc/schroot/default/nssdatabases"
+
+
+# added by weasel:
+if [ "$CHROOT_SESSION_PURGE" = "true" ]; then
+    case $CHROOT_DESCRIPTION in
+        "["*-*_*-dchroot"]"*)
+            chroot_type="$CHROOT_DESCRIPTION"; chroot_type="${chroot_type#\[}"; chroot_type="${chroot_type%%]*}"
+            suitevariant_arch_tuple="${chroot_type%%-dchroot-*}"
+            suitevariant=${suitevariant_arch_tuple%_*}
+            SUITE_BASE=${suitevariant%-*}
+            SUITE_VARIANT=${suitevariant##*-}
+        ;;
+        "["*_*-dchroot"]"*)
+            chroot_type="$CHROOT_DESCRIPTION"; chroot_type="${chroot_type#\[}"; chroot_type="${chroot_type%%]*}"
+            SUITE_BASE="${chroot_type%%_*}"
+        ;;
+        *)
+            if [ "$STAGE" = "setup-start" ]; then
+               echo >&2 "Unable to parse chroot description for what kind of chroot you want."
+               exit 1
+            fi
+        ;;
+    esac
+fi
+
+CHROOT_FILE_UNPACK_DIR=/srv/chroot/schroot-unpack
+
+if [ -e /etc/schroot/dsa/default-mirror ]; then
+    MIRROR=$(cat /etc/schroot/dsa/default-mirror )
+fi
+MIRROR=${MIRROR:-cdn.debian.net}
+
+if [ "$(basename "$0")" = "00check" ] &&
+   [ "$CHROOT_TYPE" = "file" ] &&
+   [ "$STAGE" = "setup-start" ]; then
+        echo "Untarring chroot environment.  This might take a minute or two."
+fi
diff --git a/modules/schroot/files/schroot-setup.d/99porterbox-extra-apt-options b/modules/schroot/files/schroot-setup.d/99porterbox-extra-apt-options
new file mode 100755 (executable)
index 0000000..db240da
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+# by weasel
+
+set -e
+
+[ "$CHROOT_PROFILE" = "dsa" ] || exit 0
+
+. "$SETUP_DATA_DIR/common-data"
+. "$SETUP_DATA_DIR/common-functions"
+
+if [ -f "${CHROOT_SCRIPT_CONFIG:-}" ]; then
+    . "$CHROOT_SCRIPT_CONFIG"
+fi
+
+
+if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then
+       TGT="${CHROOT_PATH}/etc/apt/apt.conf.d/local-schroot"
+       rm -f "$TGT"
+       cat > "$TGT" << EOF
+APT::Install-Recommends 0;
+Acquire::http::Pipeline-Depth "0";
+Acquire::Languages "none";
+Acquire::PDiffs "false";
+EOF
+#Acquire  {
+#     http { Proxy "http://10.213.12.1:3128/"; };
+#     ftp { Proxy "http://10.213.12.1:3128/"; };
+#}
+fi
diff --git a/modules/schroot/files/schroot-setup.d/99porterbox-extra-sources b/modules/schroot/files/schroot-setup.d/99porterbox-extra-sources
new file mode 100755 (executable)
index 0000000..2bdff1b
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+# by weasel
+
+set -e
+
+[ "$CHROOT_PROFILE" = "dsa" ] || exit 0
+
+. "$SETUP_DATA_DIR/common-data"
+. "$SETUP_DATA_DIR/common-functions"
+
+if [ -f "${CHROOT_SCRIPT_CONFIG:-}" ]; then
+    . "$CHROOT_SCRIPT_CONFIG"
+elif [ -f "$CHROOT_PROFILE_DIR/config" ]; then
+    . "$CHROOT_PROFILE_DIR/config"
+else
+    fatal "Cannot find config script"
+fi
+
+
+if [ "$1" = "setup-start" ] || [ "$1" = "setup-recover" ]; then
+  SRCL="${CHROOT_PATH}/etc/apt/sources.list.d/auto.list"
+  rm -f "$SRCL"
+  mirror=${MIRROR:-http://cdn.debian.net/debian}
+
+  case "${SUITE_BASE:-}" in
+    experimental)
+      echo "deb     $mirror sid main" >> "$SRCL"
+      echo "deb-src $mirror sid main" >> "$SRCL"
+      ;;
+    sid|jessie)
+      ;;
+    *)
+      echo "deb     http://security.debian.org/ ${SUITE_BASE}/updates main" >> "$SRCL"
+      echo "deb-src http://security.debian.org/ ${SUITE_BASE}/updates main" >> "$SRCL"
+      ;;
+  esac
+  echo "deb     $mirror ${SUITE_BASE} main" >> "$SRCL"
+  echo "deb-src $mirror ${SUITE_BASE} main" >> "$SRCL"
+
+  case "${SUITE_VARIANT:-}" in
+    backports)
+      case "${SUITE_BASE:-}" in
+        squeeze)
+          echo "deb     http://backports.debian.org/debian-backports/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
+          echo "deb-src http://backports.debian.org/debian-backports/ ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
+          ;;
+        *)
+          echo "deb     $mirror ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
+          echo "deb-src $mirror ${SUITE_BASE}-${SUITE_VARIANT} main" >> "$SRCL"
+          ;;
+      esac
+      ;;
+  esac
+  echo "o To install build dependencies run"
+  echo "  dd-schroot-cmd -c ${SESSION_ID} apt-get update"
+  echo "  followed by build-dep/install as appropriate in the host system."
+  echo "o If you started this session with schroot -b, please do not forget to run"
+  echo "  schroot --end-session -c ${SESSION_ID}"
+  echo "  when you no longer need this environment."
+fi
index e746990..2e22db3 100644 (file)
@@ -6,18 +6,47 @@ class schroot {
        package { 'debootstrap':
                ensure => installed,
        }
-
-       file { '/etc/schroot/mount-defaults':
-               content => template('schroot/etc/schroot/mount-defaults.erb'),
-               require => Package['schroot'],
+       package { 'moreutils':
+               ensure => installed
        }
+
        file { '/etc/default/schroot':
                source  => 'puppet:///modules/schroot/default-schroot',
                require => Package['schroot']
        }
 
+       file { '/etc/schroot/mount-defaults':
+               content => template('schroot/mount-defaults.erb'),
+               require => Package['schroot'],
+       }
        file { '/etc/schroot/default/nssdatabases':
                source  => 'puppet:///modules/schroot/nssdatabases',
                require => Package['schroot']
        }
+
+       file { '/etc/schroot/setup.d/99porterbox-extra-apt-options':
+               mode    => '0555',
+               source  => 'puppet:///modules/schroot/schroot-setup.d/99porterbox-extra-apt-options',
+               require => Package['schroot'],
+       }
+       file { '/etc/schroot/setup.d/99porterbox-extra-sources':
+               mode    => '0555',
+               source  => 'puppet:///modules/schroot/schroot-setup.d/99porterbox-extra-sources',
+               require => Package['schroot'],
+       }
+
+       file { '/etc/schroot/dsa':
+               ensure => directory,
+               require => Package['schroot'],
+       }
+       file { '/etc/schroot/dsa/default-mirror':
+               content => template('schroot/default-mirror.erb'),
+       }
+       file { '/etc/schroot/dsa/config':
+               source  => 'puppet:///modules/schroot/schroot-dsa/config',
+       }
+       file { '/etc/schroot/dsa/fstab':
+               content => template('schroot/schroot-dsa/fstab.erb'),
+               require => Package['schroot'],
+       }
 }
diff --git a/modules/schroot/templates/default-mirror.erb b/modules/schroot/templates/default-mirror.erb
new file mode 100644 (file)
index 0000000..a5822f9
--- /dev/null
@@ -0,0 +1,8 @@
+<%=
+ninfo = scope.lookupvar('site::nodeinfo')
+if ninfo['hoster'].has_key?('mirror-debian') then
+    ninfo['hoster']['mirror-debian']
+else
+    'http://cdn.debian.net/debian'
+end
+%>
diff --git a/modules/schroot/templates/etc/schroot/mount-defaults.erb b/modules/schroot/templates/etc/schroot/mount-defaults.erb
deleted file mode 100644 (file)
index 9dc2d51..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-# mount.defaults: static file system information for chroots.
-# Note that the mount point will be prefixed by the chroot path
-# (CHROOT_PATH)
-#
-# <file system> <mount point>   <type>  <options>       <dump>  <pass>
-<% if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture') and scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0].start_with?('kfreebsd') -%>
-# kFreeBSD version
-proc           /proc           linprocfs       defaults        0       0
-dev            /dev            devfs   rw,bind         0       0
-dev            /dev/fd         fdescfs rw,bind         0       0
-sys            /sys            linsysfs        defaults        0       0
-<% else -%>
-# Linux version
-proc            /proc           proc    defaults        0       0
-/dev/pts        /dev/pts        none    rw,bind         0       0
-tmpfs           /dev/shm        tmpfs   defaults        0       0
-<% end %>
-
diff --git a/modules/schroot/templates/mount-defaults.erb b/modules/schroot/templates/mount-defaults.erb
new file mode 100644 (file)
index 0000000..9dc2d51
--- /dev/null
@@ -0,0 +1,22 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+# mount.defaults: static file system information for chroots.
+# Note that the mount point will be prefixed by the chroot path
+# (CHROOT_PATH)
+#
+# <file system> <mount point>   <type>  <options>       <dump>  <pass>
+<% if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture') and scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0].start_with?('kfreebsd') -%>
+# kFreeBSD version
+proc           /proc           linprocfs       defaults        0       0
+dev            /dev            devfs   rw,bind         0       0
+dev            /dev/fd         fdescfs rw,bind         0       0
+sys            /sys            linsysfs        defaults        0       0
+<% else -%>
+# Linux version
+proc            /proc           proc    defaults        0       0
+/dev/pts        /dev/pts        none    rw,bind         0       0
+tmpfs           /dev/shm        tmpfs   defaults        0       0
+<% end %>
+
diff --git a/modules/schroot/templates/schroot-dsa/fstab.erb b/modules/schroot/templates/schroot-dsa/fstab.erb
new file mode 100644 (file)
index 0000000..2e2cd1b
--- /dev/null
@@ -0,0 +1,25 @@
+# fstab: static file system information for chroots.
+# Note that the mount point will be prefixed by the chroot path
+# (CHROOT_PATH)
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+
+<% if scope.lookupvar('site::nodeinfo')['ldap'].has_key?('architecture') and scope.lookupvar('site::nodeinfo')['ldap']['architecture'][0].start_with?('kfreebsd') -%>
+# kFreeBSD version
+proc           /proc           linprocfs       defaults        0       0
+dev            /dev            devfs   rw,bind         0       0
+dev            /dev/fd         fdescfs rw,bind         0       0
+/home          /home           nullfs  rw              0       0
+/tmp           /tmp            nullfs  rw              0       0
+
+<% else -%>
+# Linux version
+/proc          /proc           none    rw,bind         0       0
+/sys           /sys            none    rw,bind         0       0
+/dev           /dev            none    rw,bind         0       0
+/dev/pts       /dev/pts        none    rw,bind         0       0
+/home          /home           none    rw,bind         0       0
+/tmp           /tmp            none    rw,bind         0       0
+tmpfs-shm      /dev/shm        tmpfs   defaults,size=64m       0 0
+
+<% end %>