summaryrefslogtreecommitdiffstats
path: root/krebs/4lib/infest/1prepare
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-09-27 20:08:36 +0200
committerlassulus <lass@aidsballs.de>2015-09-27 20:08:36 +0200
commita9f6f7ac7b8e70633164d10980d1d041f34be3ac (patch)
tree13a8bdfafd994c999c5eeae3ff5e2537a4d96f0f /krebs/4lib/infest/1prepare
parentb6383dba83a2e9ec6ada40fb780c15a56c8d715e (diff)
parentbc2bd6e2f6e9295b14e641b82bff62b40641988d (diff)
Merge branch 'makefu'
Diffstat (limited to 'krebs/4lib/infest/1prepare')
-rw-r--r--krebs/4lib/infest/1prepare74
1 files changed, 0 insertions, 74 deletions
diff --git a/krebs/4lib/infest/1prepare b/krebs/4lib/infest/1prepare
deleted file mode 100644
index 07c00c3a5..000000000
--- a/krebs/4lib/infest/1prepare
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /bin/sh
-set -efu
-
-prepare() {(
- if test -e /etc/os-release; then
- . /etc/os-release
- case $ID in
- centos)
- case $VERSION_ID in
- 7)
- prepare_centos7 "$@"
- exit
- ;;
- esac
- ;;
- esac
- fi
- echo "$0 prepare: unknown OS" >&2
- exit -1
-)}
-
-prepare_centos7() {
- type bzip2 2>/dev/null || yum install -y bzip2
- type git 2>/dev/null || yum install -y git
- type rsync 2>/dev/null || yum install -y rsync
- if ! getent group nixbld >/dev/null; then
- groupadd -g 30000 -r nixbld
- fi
- for i in `seq 1 10`; do
- if ! getent passwd nixbld$i 2>/dev/null; then
- useradd \
- -c "CentOS Nix build user $i" \
- -d /var/empty \
- -g 30000 \
- -G 30000 \
- -l \
- -M \
- -s /sbin/nologin \
- -u $(expr 30000 + $i) \
- nixbld$i
- rm -f /var/spool/mail/nixbld$i
- fi
- done
-
- #
- # mount install directory
- #
-
- if ! mount | grep -Fq '/dev/mapper/centos-root on /mnt type xfs'; then
- mkdir -p /newshit
- mount --bind /newshit /mnt
- fi
-
- if ! mount | grep -Fq '/dev/sda1 on /mnt/boot type xfs'; then
- mkdir -p /mnt/boot
- mount /dev/sda1 /mnt/boot
- fi
-
- mount | grep 'on /mnt\>' >&2
-
- #
- # prepare install directory
- #
-
- mkdir -p /mnt/etc/nixos
- mkdir -m 0555 -p /mnt/var/empty
-
- if ! mount | grep -Fq '/dev/mapper/centos-root on /mnt/root type xfs'; then
- mkdir -p /mnt/root
- mount --bind /root /mnt/root
- fi
-}
-
-prepare "$@"