some cleanup for utility scripts

This commit is contained in:
Anthony Young 2011-11-09 22:29:22 -08:00
parent c1024d8987
commit e228093ecd
2 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -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