]> pere.pagekite.me Git - homepage.git/blob - blog/data/2010-06-08-upgrade-kde.txt
Generated.
[homepage.git] / blog / data / 2010-06-08-upgrade-kde.txt
1 Title: Automatic upgrade testing from Lenny to Squeeze
2 Tags: english, debian, debian edu, bootsystem
3 Date: 2010-06-11 22:50
4
5 <p>The last few days I have done some upgrade testing in Debian, to
6 see if the upgrade from Lenny to Squeeze will go smoothly. A few bugs
7 have been discovered and reported in the process
8 (<a href="http://bugs.debian.org/585410">#585410</a> in nagios3-cgi,
9 <a href="http://bugs.debian.org/584879">#584879</a> already fixed in
10 enscript and <a href="http://bugs.debian.org/584861">#584861</a> in
11 kdebase-workspace-data), and to get a more regular testing going on, I
12 am working on a script to automate the test.</p>
13
14 <p>The idea is to create a Lenny chroot and use tasksel to install a
15 Gnome or KDE desktop installation inside the chroot before upgrading
16 it. To ensure no services are started in the chroot, a policy-rc.d
17 script is inserted. To make sure tasksel believe it is to install a
18 desktop on a laptop, the tasksel tests are replaced in the chroot
19 (only acceptable because this is a throw-away chroot).</p>
20
21 <p>A naive upgrade from Lenny to Squeeze using aptitude dist-upgrade
22 currently always fail because udev refuses to upgrade with the kernel
23 in Lenny, so to avoid that problem the file /etc/udev/kernel-upgrade
24 is created. The bug report
25 <a href="http://bugs.debian.org/566000">#566000</a> make me suspect
26 this problem do not trigger in a chroot, but I touch the file anyway
27 to make sure the upgrade go well. Testing on virtual and real
28 hardware have failed me because of udev so far, and creating this file
29 do the trick in such settings anyway. This is a
30 <a href="http://www.linuxquestions.org/questions/debian-26/failed-dist-upgrade-due-to-udev-config_sysfs_deprecated-nonsense-804130/">known
31 issue</a> and the current udev behaviour is intended by the udev
32 maintainer because he lack the resources to rewrite udev to keep
33 working with old kernels or something like that. I really wish the
34 udev upstream would keep udev backwards compatible, to avoid such
35 upgrade problem, but given that they fail to do so, I guess
36 documenting the way out of this mess is the best option we got for
37 Debian Squeeze.</p>
38
39 <p>Anyway, back to the task at hand, testing upgrades. This test
40 script, which I call <tt>upgrade-test</tt> for now, is doing the
41 trick:</p>
42
43 <blockquote><pre>
44 #!/bin/sh
45 set -ex
46
47 if [ "$1" ] ; then
48 desktop=$1
49 else
50 desktop=gnome
51 fi
52
53 from=lenny
54 to=squeeze
55
56 exec &lt; /dev/null
57 unset LANG
58 mirror=http://ftp.skolelinux.org/debian
59 tmpdir=chroot-$from-upgrade-$to-$desktop
60 fuser -mv .
61 debootstrap $from $tmpdir $mirror
62 chroot $tmpdir aptitude update
63 cat > $tmpdir/usr/sbin/policy-rc.d &lt;&lt;EOF
64 #!/bin/sh
65 exit 101
66 EOF
67 chmod a+rx $tmpdir/usr/sbin/policy-rc.d
68 exit_cleanup() {
69 umount $tmpdir/proc
70 }
71 mount -t proc proc $tmpdir/proc
72 # Make sure proc is unmounted also on failure
73 trap exit_cleanup EXIT INT
74
75 chroot $tmpdir aptitude -y install debconf-utils
76
77 # Make sure tasksel autoselection trigger. It need the test scripts
78 # to return the correct answers.
79 echo tasksel tasksel/desktop multiselect $desktop | \
80 chroot $tmpdir debconf-set-selections
81
82 # Include the desktop and laptop task
83 for test in desktop laptop ; do
84 echo > $tmpdir/usr/lib/tasksel/tests/$test &lt;&lt;EOF
85 #!/bin/sh
86 exit 2
87 EOF
88 chmod a+rx $tmpdir/usr/lib/tasksel/tests/$test
89 done
90
91 DEBIAN_FRONTEND=noninteractive
92 DEBIAN_PRIORITY=critical
93 export DEBIAN_FRONTEND DEBIAN_PRIORITY
94 chroot $tmpdir tasksel --new-install
95
96 echo deb $mirror $to main > $tmpdir/etc/apt/sources.list
97 chroot $tmpdir aptitude update
98 touch $tmpdir/etc/udev/kernel-upgrade
99 chroot $tmpdir aptitude -y dist-upgrade
100 fuser -mv
101 </pre></blockquote>
102
103 <p>I suspect it would be useful to test upgrades with both apt-get and
104 with aptitude, but I have not had time to look at how they behave
105 differently so far. I hope to get a cron job running to do the test
106 regularly and post the result on the web. The Gnome upgrade currently
107 work, while the KDE upgrade fail because of the bug in
108 kdebase-workspace-data</p>
109
110 <p>I am not quite sure what kind of extract from the huge upgrade logs
111 (KDE 167 KiB, Gnome 516 KiB) it make sense to include in this blog
112 post, so I will refrain from trying. I can report that for Gnome,
113 aptitude report 760 packages upgraded, 448 newly installed, 129 to
114 remove and 1 not upgraded and 1024MB need to be downloaded while for
115 KDE the same numbers are 702 packages upgraded, 507 newly installed,
116 193 to remove and 0 not upgraded and 1117MB need to be downloaded</p>
117
118 <p>I am very happy to notice that the Gnome desktop + laptop upgrade
119 is able to migrate to dependency based boot sequencing and parallel
120 booting without a hitch. Was unsure if there were still bugs with
121 packages failing to clean up their obsolete init.d script during
122 upgrades, and no such problem seem to affect the Gnome desktop+laptop
123 packages.</p>