diff options
author | makefu <github@syntax-fehler.de> | 2015-10-01 18:49:34 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-10-01 18:49:34 +0200 |
commit | 49c00cf74f778152f4aed943dedb7bbf283b16e7 (patch) | |
tree | 29946a2fedb005b68a417acf3ac04d6f858f8aa1 /krebs/3modules/build/infest/prepare.sh | |
parent | 73aa31010415ac5f7bf86d2bb77099fc3097905a (diff) | |
parent | 4af4fa89e50c3769d9331608cec2e6752ceb4fcb (diff) |
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'krebs/3modules/build/infest/prepare.sh')
-rw-r--r-- | krebs/3modules/build/infest/prepare.sh | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/krebs/3modules/build/infest/prepare.sh b/krebs/3modules/build/infest/prepare.sh deleted file mode 100644 index 07c00c3a..00000000 --- a/krebs/3modules/build/infest/prepare.sh +++ /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 "$@" |