cozybit / distro11s

12 stars 5 forks source link

[PATCH] distro11s: be more forceful in debian upgrades #14

Closed jasonabele closed 10 years ago

jasonabele commented 10 years ago
From 9264315d545ef6d47d6a3cd7fd1063fad8d66f9a Mon Sep 17 00:00:00 2001
From: Jason Abele <jason@cozybit.com>
Date: Fri, 9 Aug 2013 11:24:25 -0700
Subject: [PATCH] distro11s: be more forceful in debian upgrades

We will fix up any necessary config files later with the overlay steps,
so do not let dpkg/apt fail for changed configs or held back packages

Signed-off-by: Jason Abele <jason@cozybit.com>

---
 scripts/debian-rootfs.sh |   24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/scripts/debian-rootfs.sh b/scripts/debian-rootfs.sh
index f0331f4..96fb082 100755
--- a/scripts/debian-rootfs.sh
+++ b/scripts/debian-rootfs.sh
@@ -1,5 +1,12 @@
 source `dirname $0`/common.sh

+function clean_install_state {
+   echo "Fixing installation issues"
+   # Cleanup any failed package installs/upgrades
+   yes "" | sudo chroot ${STAGING} dpkg --configure -a --force-all
+   yes "" | sudo chroot ${STAGING} aptitude -y -f install
+}
+
 if [ ! -e  ${STAMPS}/debian-rootfs.bootstrapped -o ${FORCE_BUILD} -eq 1 ]; then
    root_check "This script runs debootstrap in ${STAGING}"
    echo "Populating base rootfs with debian"
@@ -16,19 +23,18 @@ if [ ! -e  ${STAMPS}/debian-rootfs.bootstrapped -o ${FORCE_BUILD} -eq 1 ]; then
 fi

 echo "Updating package cache"
-sudo chroot ${STAGING} apt-get update
-echo "Fixing old installation issues"
-# Fix for the old force-installed tshark 1.9.0
-sudo chroot ${STAGING} apt-get -y remove tshark wireshark-common libwireshark3
-sudo chroot ${STAGING} apt-get -y -f install
+sudo chroot ${STAGING} aptitude update
+clean_install_state
+echo "Updating installed packages"
+yes "" | sudo chroot ${STAGING} aptitude -y full-upgrade
+clean_install_state
 echo "Install locales support"
-sudo chroot ${STAGING} apt-get -y install locales
+yes "" | sudo chroot ${STAGING} aptitude -y install locales
 sudo chroot ${STAGING} sed -i -e "s/^#\s*\(.*$LANG\)/\1/" /etc/locale.gen
 sudo chroot ${STAGING} locale-gen
 echo "Updating base packages"
-sudo chroot ${STAGING} apt-get -y upgrade
-sudo chroot ${STAGING} apt-get -y --force-yes --no-install-recommends install ${BOARD11S_PACKAGES} || exit 1
-sudo chroot ${STAGING} apt-get -y build-dep ${BOARD11S_BUILDDEP_PACKAGES} || exit 1
+yes "" | sudo chroot ${STAGING} aptitude -y --without-recommends install ${BOARD11S_PACKAGES} || exit 1
+yes "" | sudo chroot ${STAGING} aptitude -y build-dep ${BOARD11S_BUILDDEP_PACKAGES} || exit 1

 cp ${DISTRO11S_CONF} ${STAGING}/etc/distro11s.conf || exit 1

-- 
1.7.9.5