debian: Modifications due to new postinit scripts, etc in core-agent-linux module

pull/1/head
Jason Mehring 10 years ago
parent f8c9dd684c
commit 88cf6f8b59

@ -43,4 +43,3 @@ fi
# Execute any template flavor or sub flavor 'post' scripts
# ------------------------------------------------------------------------------
buildStep "$0" "post"

@ -85,7 +85,7 @@ EOF
chroot "${INSTALLDIR}" apt-get update
true "${stout}"
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
chroot "${INSTALLDIR}" apt-get -y --force-yes dist-upgrade
chroot "${INSTALLDIR}" apt-get ${APT_GET_OPTIONS} dist-upgrade
# ------------------------------------------------------------------------------
# Configure keyboard
@ -115,7 +115,7 @@ EOF
for package_list in ${packages_list[@]}; do
debug "Installing extra packages from: ${package_list}"
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
xargs chroot ${INSTALLDIR} apt-get -y --force-yes install < "${package_list}"
xargs chroot ${INSTALLDIR} apt-get ${APT_GET_OPTIONS} install < "${package_list}"
done
# ------------------------------------------------------------------------------
@ -135,10 +135,10 @@ EOF
debug "Installing systemd for debian (${DEBIANVERSION})"
if [ "${DEBIANVERSION}" == "wheezy" ]; then
echo 'Yes, do as I say!' | DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
chroot "${INSTALLDIR}" apt-get -y --force-yes remove sysvinit
chroot "${INSTALLDIR}" apt-get ${APT_GET_OPTIONS} remove sysvinit
else
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
chroot "${INSTALLDIR}" apt-get -y --force-yes remove sysvinit
chroot "${INSTALLDIR}" apt-get ${APT_GET_OPTIONS} remove sysvinit
fi
# Prevent sysvinit from being re-installed
@ -155,12 +155,11 @@ EOF
chroot "${INSTALLDIR}" apt-get update
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
chroot "${INSTALLDIR}" apt-get -y --force-yes install systemd-sysv
chroot "${INSTALLDIR}" apt-get ${APT_GET_OPTIONS} install systemd-sysv
# ------------------------------------------------------------------------------
# Set multu-user.target as the default target (runlevel 3)
# ------------------------------------------------------------------------------
#chroot "${INSTALLDIR}" systemctl set-default multi-user.target
chroot "${INSTALLDIR}" rm -f /etc/systemd/system/default.target
chroot "${INSTALLDIR}" ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
@ -176,7 +175,7 @@ EOF
fi
chroot ${INSTALLDIR} apt-get update
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
chroot ${INSTALLDIR} apt-get -y --force-yes -t wheezy-backports install init-system-helpers
chroot ${INSTALLDIR} apt-get ${APT_GET_OPTIONS} -t wheezy-backports install init-system-helpers
fi
# ------------------------------------------------------------------------------
@ -199,4 +198,3 @@ fi
# Execute any template flavor or sub flavor 'post' scripts
# ------------------------------------------------------------------------------
buildStep "$0" "post"

@ -58,38 +58,12 @@ EOF
chroot "${INSTALLDIR}" locale-gen
chroot "${INSTALLDIR}" update-locale LANG=en_US.UTF-8
# # --------------------------------------------------------------------------
# # Update /etc/fstab
# # --------------------------------------------------------------------------
# #debug "Updating template fstab file..."
# #cat >> "${INSTALLDIR}/etc/fstab" <<EOF
#/dev/mapper/dmroot / ext4 defaults,noatime 1 1
#/dev/xvdc1 swap swap defaults 0 0
#
#/dev/xvdb /rw ext4 noauto,defaults,discard 1 2
#/rw/home /home none noauto,bind,defaults 0 0
#
#tmpfs /dev/shm tmpfs defaults 0 0
#devpts /dev/pts devpts gid=5,mode=620 0 0
#proc /proc proc defaults 0 0
#sysfs /sys sysfs defaults 0 0
#xen /proc/xen xenfs defaults 0 0
#
#/dev/xvdi /mnt/removable auto noauto,user,rw 0 0
#/dev/xvdd /lib/modules ext3 defaults 0 0
#EOF
# --------------------------------------------------------------------------
# Link mtab
# --------------------------------------------------------------------------
rm -f "${INSTALLDIR}/etc/mtab"
ln -s "../proc/self/mounts" "${INSTALLDIR}/etc/mtab"
# # --------------------------------------------------------------------------
# # Create modules directory
# # --------------------------------------------------------------------------
# mkdir -p "${INSTALLDIR}/lib/modules"
# --------------------------------------------------------------------------
# Start of Qubes package installation
# --------------------------------------------------------------------------
@ -141,7 +115,7 @@ EOF
# Install Qubes packages
# --------------------------------------------------------------------------
DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
chroot "${INSTALLDIR}" apt-get -y --force-yes install $(cat ${SCRIPTSDIR}/packages_qubes.list) || \
chroot "${INSTALLDIR}" apt-get ${APT_GET_OPTIONS} install $(cat ${SCRIPTSDIR}/packages_qubes.list) || \
{ umount_kill "${INSTALLDIR}"; exit 1; }
# --------------------------------------------------------------------------
@ -156,32 +130,7 @@ EOF
# Remove temporary policy layer so services can start normally in the
# deployed template.
# --------------------------------------------------------------------------
rm -f "${BUILDCHROOT}/usr/sbin/policy-rc.d"
# # --------------------------------------------------------------------------
# # Qubes needs a user named 'user'
# # --------------------------------------------------------------------------
# if chroot "${INSTALLDIR}" id -u 'user' >/dev/null 2>&1; then
# :
# else
# chroot "${INSTALLDIR}" groupadd -f user
# chroot "${INSTALLDIR}" useradd -g user -G dialout,cdrom,floppy,sudo,audio,dip,video,plugdev -m -s /bin/bash user
# fi
# # --------------------------------------------------------------------------
# # Modules setup
# # --------------------------------------------------------------------------
# echo "xen_netfront" >> "${INSTALLDIR}/etc/modules"
# # --------------------------------------------------------------------------
# # Remove `mesg` from root/.profile?
# # --------------------------------------------------------------------------
# sed -i -e '/^mesg n/d' "${INSTALLDIR}/root/.profile"
# # --------------------------------------------------------------------------
# # Need a xen log directory or xen scripts will fail
# # --------------------------------------------------------------------------
# mkdir -p -m 0700 "${INSTALLDIR}/var/log/xen"
rm -f "${INSTALLDIR}/usr/sbin/policy-rc.d"
# --------------------------------------------------------------------------
# Copy extra files to installation directory. Contains:
@ -189,13 +138,6 @@ EOF
# --------------------------------------------------------------------------
copyTree "qubes-files" "${SCRIPTSDIR}" "${INSTALLDIR}"
# # --------------------------------------------------------------------------
# # Looks like hosts file may contain tabs and qubes will not parse it
# # correctly
# # --------------------------------------------------------------------------
# expand "${INSTALLDIR}/etc/hosts" > "${INSTALLDIR}/etc/hosts.dist"
# mv "${INSTALLDIR}/etc/hosts.dist" "${INSTALLDIR}/etc/hosts"
touch "${INSTALLDIR}/tmp/.prepared_qubes"
fi

@ -27,9 +27,6 @@ rm -rf "${INSTALLDIR}/var/cache/apt/archives/*"
rm -f "${INSTALLDIR}/etc/apt/sources.list.d/qubes-builder.list"
rm -f "${INSTALLDIR}/etc/apt/trusted.gpg.d/qubes-builder.gpg"
# XXX: Whats this for?
rm -rf buildchroot
# ------------------------------------------------------------------------------
# Execute any template flavor or sub flavor 'post' scripts
# ------------------------------------------------------------------------------

@ -11,18 +11,8 @@
DEBIANVERSION=${DIST}
# Location to grab debian packages
DEBIAN_MIRROR=http://ftp.us.debian.org/debian/
#DEBIAN_MIRROR=http://http.debian.net/debian
DEBIAN_MIRROR=http://ftp.ca.debian.org/debian/
#DEBIAN_MIRROR=http://ftp.us.debian.org/debian/
#DEBIAN_MIRROR=http://ftp.ca.debian.org/debian/
# XXX: Is this even used?
EXTRAPKGS="openssh-clients,screen,vim-nox,less"
# XXX: Is this even used?
QUBESDEBIANGIT="http://dsg.is/qubes/"
# XXX: Is this even used?
# make runs the scripts with sudo -E, so HOME is set to /home/user during
# build, which does not exist. We need to write to ${HOME}/.gnupg so set it
# to something valid.
HOME=/root
APT_GET_OPTIONS="-o Dpkg::Options::="--force-confnew" --force-yes -y"

Loading…
Cancel
Save