diff --git a/tools/setup_stack_user.sh b/tools/setup_stack_user.sh index 85d418ed82..231a20f332 100755 --- a/tools/setup_stack_user.sh +++ b/tools/setup_stack_user.sh @@ -40,9 +40,15 @@ mkdir -p $STAGING_DIR/$DEST chroot $STAGING_DIR groupadd libvirtd || true chroot $STAGING_DIR useradd stack -s /bin/bash -d $DEST -G libvirtd || true -# a simple password - pass +# Add a simple password - pass echo stack:pass | chroot $STAGING_DIR chpasswd +# Configure sudo +grep -q "^#includedir.*/etc/sudoers.d" $STAGING_DIR/etc/sudoers || + echo "#includedir /etc/sudoers.d" | sudo tee -a $STAGING_DIR/etc/sudoers +cp $TOP_DIR/files/sudo/* $STAGING_DIR/etc/sudoers.d/ +sed -e "s,%USER%,$USER,g" -i $STAGING_DIR/etc/sudoers.d/* + # and has sudo ability (in the future this should be limited to only what # stack requires) echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers @@ -64,3 +70,5 @@ cp_it ~/.bashrc $STAGING_DIR/$DEST/.bashrc # Give stack ownership over $DEST so it may do the work needed chroot $STAGING_DIR chown -R stack $DEST +# Unmount +umount $STAGING_DIR diff --git a/tools/warm_apts_and_pips.sh b/tools/warm_apts_and_pips.sh index 854a938b63..ec7e916c24 100755 --- a/tools/warm_apts_and_pips.sh +++ b/tools/warm_apts_and_pips.sh @@ -48,4 +48,6 @@ chroot $STAGING_DIR apt-get install -y --download-only `cat files/apts/* | grep chroot $STAGING_DIR apt-get install -y --force-yes `cat files/apts/* | grep -v NOPRIME | cut -d\# -f1` || true mkdir -p $STAGING_DIR/var/cache/pip PIP_DOWNLOAD_CACHE=/var/cache/pip chroot $STAGING_DIR pip install `cat files/pips/*` || true + +# Unmount umount $STAGING_DIR