forked from ungleich-public/cdist
add missing types from private repo
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
4ace4348a7
commit
a9109c94a4
4 changed files with 153 additions and 0 deletions
36
cdist/conf/type/__chroot_mount/gencode-remote
Executable file
36
cdist/conf/type/__chroot_mount/gencode-remote
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
# cdist 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, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# cdist 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 cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
chroot="/$__object_id"
|
||||
|
||||
cat << DONE
|
||||
# Prepare chroot
|
||||
[ -d "${chroot}/proc" ] || mkdir "${chroot}/proc"
|
||||
mount -t proc none "${chroot}/proc"
|
||||
[ -d "${chroot}/sys" ] || mkdir "${chroot}/sys"
|
||||
mount -t sysfs none "${chroot}/sys"
|
||||
[ -d "${chroot}/dev" ] || mkdir "${chroot}/dev"
|
||||
mount --rbind /dev "${chroot}/dev"
|
||||
[ -d "${chroot}/tmp" ] || mkdir -m 1777 "${chroot}/tmp"
|
||||
mount -t tmpfs none "${chroot}/tmp"
|
||||
if [ ! -f "${chroot}/etc/resolv.conf" ]; then
|
||||
cp /etc/resolv.conf "${chroot}/etc/"
|
||||
fi
|
||||
DONE
|
42
cdist/conf/type/__chroot_mount/man.text
Normal file
42
cdist/conf/type/__chroot_mount/man.text
Normal file
|
@ -0,0 +1,42 @@
|
|||
cdist-type__install_chroot_mount(7)
|
||||
===================================
|
||||
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
||||
|
||||
|
||||
NAME
|
||||
----
|
||||
cdist-type__install_chroot_mount - mount a chroot
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
Mount and prepare a chroot for running commands within it.
|
||||
|
||||
|
||||
REQUIRED PARAMETERS
|
||||
-------------------
|
||||
None.
|
||||
|
||||
|
||||
OPTIONAL PARAMETERS
|
||||
-------------------
|
||||
None.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
__install_chroot_mount /path/to/chroot
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
- cdist-type(7)
|
||||
|
||||
|
||||
COPYING
|
||||
-------
|
||||
Copyright \(C) 2012 Steven Armstrong. Free use of this software is
|
||||
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
33
cdist/conf/type/__chroot_umount/gencode-remote
Executable file
33
cdist/conf/type/__chroot_umount/gencode-remote
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
# cdist 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, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# cdist 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 cdist. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
chroot="/$__object_id"
|
||||
|
||||
cat << DONE
|
||||
umount -l "${chroot}/tmp"
|
||||
umount -l "${chroot}/dev"
|
||||
umount -l "${chroot}/sys"
|
||||
umount -l "${chroot}/proc"
|
||||
rm -f "${chroot}/etc/resolv.conf"
|
||||
# ensure /etc/resolvconf/resolv.conf.d/tail is not linked to \
|
||||
# e.g. /etc/resolvconf/resolv.conf.d/original
|
||||
rm -f "${chroot}/etc/resolvconf/resolv.conf.d/tail"
|
||||
touch "${chroot}/etc/resolvconf/resolv.conf.d/tail"
|
||||
DONE
|
42
cdist/conf/type/__chroot_umount/man.text
Normal file
42
cdist/conf/type/__chroot_umount/man.text
Normal file
|
@ -0,0 +1,42 @@
|
|||
cdist-type__install_chroot_umount(7)
|
||||
====================================
|
||||
Steven Armstrong <steven-cdist--@--armstrong.cc>
|
||||
|
||||
|
||||
NAME
|
||||
----
|
||||
cdist-type__install_chroot_umount - unmount a chroot mounted by __chroot_mount
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
Undo what __chroot_mount did.
|
||||
|
||||
|
||||
REQUIRED PARAMETERS
|
||||
-------------------
|
||||
None.
|
||||
|
||||
|
||||
OPTIONAL PARAMETERS
|
||||
-------------------
|
||||
None.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
__install_chroot_umount /path/to/chroot
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
- cdist-type(7)
|
||||
|
||||
|
||||
COPYING
|
||||
-------
|
||||
Copyright \(C) 2012 Steven Armstrong. Free use of this software is
|
||||
granted under the terms of the GNU General Public License version 3 (GPLv3).
|
Loading…
Reference in a new issue