info "Mounting ${TARGET_DIR}/run/lock ..."
mount -t tmpfs -o size=3% tmpfs ${TARGET_DIR}/run/lock
+ if [[ ! -d "${TARGET_DIR}/run/lock" ]] ; then
+ info "Creating ${TARGET_DIR}/run/lock ..."
+ MKDIR "${TARGET_DIR}/run/lock"
+ fi
+
}
#------------------------------------------------------------------------------
echo
info "Adding Profitbricks Debian repository."
- CHROOT apt-key adv --fetch-keys http://alexandria.pb.local/profitbricks-repository/0CC30F89AD6863A7.asc
cat >${TARGET_DIR}/etc/apt/sources.list.d/profitbricks.list <<EOF
# ProfitBricks Debian repositories
-
-deb http://repo01.pb.local/pb-debian wheezy main non-free contrib
-deb http://repo01.pb.local/pb-debian wheezy-proposed main non-free contrib
-
+deb http://repo.pb.local/pb-debian wheezy main non-free contrib
EOF
+ export DEBIAN_FRONTEND="noninteractive"
+ CHROOT apt-get update --allow-unauthenticated
+ CHROOT apt-get install --allow-unauthenticated --yes profitbricks-keyring
+
}
#------------------------------------------------------------------------------
update_packages() {
echo
info "Updating all packages."
- if [[ ! -d "${TARGET_DIR}/run/lock" ]] ; then
- info "Creating ${TARGET_DIR}/run/lock ..."
- MKDIR "${TARGET_DIR}/run/lock"
- fi
export DEBIAN_FRONTEND="noninteractive"
CHROOT apt-get update || true
CHROOT aptitude full-upgrade -y || true
CP -p files/authorized_keys ${TARGET_DIR}/root/.ssh/
CHOWN root:root ${TARGET_DIR}/root/.ssh/authorized_keys
- for f in files/inputrc files/modules files/rc.local ; do
+ for f in files/inputrc files/modules files/rc.local files/nsswitch.conf ; do
b=$(basename ${f})
CP -p ${f} ${TARGET_DIR}/etc/${b}
CHOWN root:root ${TARGET_DIR}/etc/${b}
info "Enabling ${GREEN}rc.local${NORMAL} in runlevel ..."
CHROOT update-rc.d rc.local defaults
+ info "Disabling ${YELLOW}avahi-daemon${NORMAL} in all runlevels ..."
+ CHROOT update-rc.d avahi-daemon remove || true
+
}
#------------------------------------------------------------------------------