1. Copy "resolv.conf" before running apt-get update / yum update.
Without this DNS is probably not available/working.
2. Copy /etc/sudoers from the host, if we're installing sudo.
60 lines
814 B
Bash
Executable File
60 lines
814 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copy files from a 'skel' directory, if present, into the
|
|
# new images
|
|
#
|
|
|
|
|
|
prefix=$1
|
|
|
|
|
|
#
|
|
# Source our common functions
|
|
#
|
|
if [ -e /usr/lib/xen-tools/common.sh ]; then
|
|
. /usr/lib/xen-tools/common.sh
|
|
else
|
|
. ./hooks/common.sh
|
|
fi
|
|
|
|
|
|
#
|
|
# Log our start
|
|
#
|
|
logMessage Script $0 starting
|
|
|
|
|
|
#
|
|
# Copy "required" files from our host.
|
|
#
|
|
cp /etc/timezone ${prefix}/etc
|
|
|
|
|
|
#
|
|
# If the host has sudo then copy the configuration file, and install
|
|
# the package
|
|
#
|
|
if [ -e /etc/sudoers ]; then
|
|
|
|
logMessage Installing SUDO too.
|
|
|
|
#
|
|
# Copy file and fixup permissions.
|
|
#
|
|
cp /etc/sudoers ${prefix}/etc
|
|
chown root:root ${prefix}/etc/sudoers
|
|
chmod 440 ${prefix}/etc/sudoers
|
|
|
|
#
|
|
# Install sudo
|
|
#
|
|
installDebianPackage ${prefix} sudo
|
|
|
|
fi
|
|
|
|
|
|
#
|
|
# Log our finish
|
|
#
|
|
logMessage Script $0 finished
|