From f30d929a4527d9c8f3c2c5d40b3f26a8e6cef292 Mon Sep 17 00:00:00 2001 From: Alexey Sheplyakov Date: Wed, 15 Jul 2020 17:11:54 +0400 Subject: [PATCH] install2, rootfs: Create groups necessary for joining a (AD) domain --- .../install2/image-scripts.d/86-all-groups | 24 +++++++++++++++++++ .../rootfs/image-scripts.d/30-all-groups | 13 ++++++++++ 2 files changed, 37 insertions(+) create mode 100755 features.in/build-distro/install2/image-scripts.d/86-all-groups create mode 100755 features.in/build-distro/rootfs/image-scripts.d/30-all-groups diff --git a/features.in/build-distro/install2/image-scripts.d/86-all-groups b/features.in/build-distro/install2/image-scripts.d/86-all-groups new file mode 100755 index 00000000..43f00544 --- /dev/null +++ b/features.in/build-distro/install2/image-scripts.d/86-all-groups @@ -0,0 +1,24 @@ +#!/bin/sh -efu +### Ensure that all the necesary system groups exist + +SCRIPT="/usr/share/install2/postinstall.d/86-all-groups" + +cat > "$SCRIPT" << EOF +#!/bin/sh -efu + +. install2-init-functions + +# don't override the script start message on the same line +echo "Ensuring that all the necesary system groups exist" + +echo '/usr/share/install3/default-groups +/etc/alterator/auth/user-groups +/etc/alterator/auth/admin-groups' \ +| while read LIST; do + [ -s "\$destdir\$LIST" ] || continue + for GROUP in \$(cat "\$destdir\$LIST"); do + exec_chroot groupadd -r "\$GROUP" &>/dev/null ||: + done +done +EOF +chmod +x "$SCRIPT" diff --git a/features.in/build-distro/rootfs/image-scripts.d/30-all-groups b/features.in/build-distro/rootfs/image-scripts.d/30-all-groups new file mode 100755 index 00000000..c36c2239 --- /dev/null +++ b/features.in/build-distro/rootfs/image-scripts.d/30-all-groups @@ -0,0 +1,13 @@ +#!/bin/sh -eu + +# ensure that all the necesary system groups exist + +echo '/usr/share/install3/default-groups +/etc/alterator/auth/user-groups +/etc/alterator/auth/admin-groups' \ +| while read LIST; do + [ -s "$LIST" ] || continue + for GROUP in $(cat "$LIST"); do + groupadd -r "$GROUP" &>/dev/null ||: + done +done