From c8a591cd16141bc47607de114b47f576f02cad01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rodr=C3=ADguez?= <ruben@trisquel.info> Date: Wed, 29 Oct 2014 02:19:06 +0100 Subject: [PATCH] Added ubuntu-release-upgrader helper --- .../ubuntu-release-upgrader/DistUpgrade.cfg | 32 +- .../DistUpgrade.cfg.toutatis | 91 +++++ helpers/make-ubuntu-release-upgrader | 326 ++++++++++++++++++ 3 files changed, 433 insertions(+), 16 deletions(-) create mode 100644 helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.toutatis create mode 100644 helpers/make-ubuntu-release-upgrader diff --git a/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg index 44308e10..b3bcd056 100644 --- a/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg +++ b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg @@ -1,7 +1,7 @@ [View] # the views will be tried in this order, if one fails to import, the next # is tried -View=DistUpgradeViewGtk,DistUpgradeViewGtk3,DistUpgradeViewKDE,DistUpgradeViewText +View=DistUpgradeViewGtk3,DistUpgradeViewGtk,DistUpgradeViewKDE,DistUpgradeViewText #View=DistUpgradeViewNonInteractive #Depends= python-apt (>= 0.6.0), apt (>= 0.6) # the views below support upgrades over ssh connection @@ -10,20 +10,20 @@ SupportSSH=DistUpgradeViewText,DistUpgradeViewNonInteractive # Distro contains global information about the upgrade [Distro] # the meta-pkgs we support -MetaPkgs=trisquel, trisquel-mini -BaseMetaPkgs=trisquel-base, trisquel-desktop-common, trisquel-gnome-base, trisquel-minimal +MetaPkgs=trisquel-recommended, trisquel-mini-recommended, triskel-recommended, trisquel-sugar-recommended +BaseMetaPkgs=trisquel-minimal, trisquel-base-recommended Demotions=demoted.cfg RemoveEssentialOk=sysvinit, sysvutils, belocs-locales-bin RemovalBlacklistFile=removal_blacklist.cfg # if those packages were installed, make sure to keep them installed -KeepInstalledPkgs=gnumeric, hpijs +KeepInstalledPkgs=gnumeric, hpijs, xserver-xorg-video-all KeepInstalledSection=translations RemoveObsoletes=yes -ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools +ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools, gnome-session-flashback # hints for for stuff that should be done early -PostUpgradePurge=ltsp-client, ltspfsd, linux-restricted-modules-common -PostUpgradeRemove=casper, libflashsupport, kvm-source, gtk-qt-engine, libparted1.8-12, usplash, printconf, foomatic-db-gutenprint, ebox-printers, kbluetooth, kde-plasmoid-cwp -PostUpgradeUpgrade=brasero +PostUpgradePurge=ltsp-client, ltspfsd +PostUpgradeRemove=libflashsupport, kvm-source, gtk-qt-engine, libparted1.8-12, usplash, printconf, foomatic-db-gutenprint, ebox-printers, kbluetooth, kde-plasmoid-cwp, kdm, xsettings-kde +PostUpgradeUpgrade=brasero,edubuntu-desktop #PostUpgradeInstall=apt PostInstallScripts=./trisquel-postinstall.sh EnableApport=yes @@ -34,19 +34,19 @@ BadVersions=blcr-dkms_0.8.2-13 #SlideshowUrl=http://people.canonical.com/~mvo/ubiquity-slideshow-upgrade/slides/ [KernelRemoval] -Version=3.0.0 +Version=3.2.0 BaseNames=linux-image,linux-headers,linux-image-debug,linux-backport-modules,linux-header-lbm Types=386,ec2,generic,rt,server,virtual # information about the individual meta-pkgs [trisquel] -KeyDependencies=gdm +KeyDependencies=trisquel-desktop-common-data, unity-greeter, trisquel-session # those pkgs will be marked remove right after the distUpgrade in the cache -PostUpgradeRemove=casper, xscreensaver, gnome-cups-manager, powermanagement-interface, deskbar-applet, nautilus-cd-burner -ForcedObsoletes=desktop-effects, cups-pdf, policykit-gnome, gnome-mount +PostUpgradeRemove=casper, xscreensaver, gnome-cups-manager, powermanagement-interface, deskbar-applet, nautilus-cd-burner, compiz-core, gdm, gnome-ppp, gwibber, remmina-common +ForcedObsoletes=desktop-effects, cups-pdf, policykit-gnome, gnome-mount, gdm, notification-daemon [trisquel-mini] -KeyDependencies=trisquel-mini-data lxdm +KeyDependencies=trisquel-mini-data unity-greeter #Remove previous gnome component from ltrisquel to avoid pulling gnome depends on upgrade (LP: #945215) PostUpgradeRemove=casper, gnome-bluetooth, gnome-power-manager @@ -55,12 +55,13 @@ BackupExt=distUpgrade LogDir=/var/log/dist-upgrade/ [Sources] -From=brigantia -To=toutatis +From=toutatis +To=belenos ValidOrigin=Trisquel ValidMirrors = mirrors.cfg Components=main Pockets=security,updates,backports +;AllowThirdParty=False ;[PreRequists] ;Packages=release-upgrader-apt,release-upgrader-dpkg @@ -88,4 +89,3 @@ RealReboot=no DebugBrokenScripts=no DpkgProgressLog=no ;TerminalTimeout=2400 - diff --git a/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.toutatis b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.toutatis new file mode 100644 index 00000000..b3bcd056 --- /dev/null +++ b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.toutatis @@ -0,0 +1,91 @@ +[View] +# the views will be tried in this order, if one fails to import, the next +# is tried +View=DistUpgradeViewGtk3,DistUpgradeViewGtk,DistUpgradeViewKDE,DistUpgradeViewText +#View=DistUpgradeViewNonInteractive +#Depends= python-apt (>= 0.6.0), apt (>= 0.6) +# the views below support upgrades over ssh connection +SupportSSH=DistUpgradeViewText,DistUpgradeViewNonInteractive + +# Distro contains global information about the upgrade +[Distro] +# the meta-pkgs we support +MetaPkgs=trisquel-recommended, trisquel-mini-recommended, triskel-recommended, trisquel-sugar-recommended +BaseMetaPkgs=trisquel-minimal, trisquel-base-recommended +Demotions=demoted.cfg +RemoveEssentialOk=sysvinit, sysvutils, belocs-locales-bin +RemovalBlacklistFile=removal_blacklist.cfg +# if those packages were installed, make sure to keep them installed +KeepInstalledPkgs=gnumeric, hpijs, xserver-xorg-video-all +KeepInstalledSection=translations +RemoveObsoletes=yes +ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools, gnome-session-flashback +# hints for for stuff that should be done early +PostUpgradePurge=ltsp-client, ltspfsd +PostUpgradeRemove=libflashsupport, kvm-source, gtk-qt-engine, libparted1.8-12, usplash, printconf, foomatic-db-gutenprint, ebox-printers, kbluetooth, kde-plasmoid-cwp, kdm, xsettings-kde +PostUpgradeUpgrade=brasero,edubuntu-desktop +#PostUpgradeInstall=apt +PostInstallScripts=./trisquel-postinstall.sh +EnableApport=yes +# this supported blacklisting certain versions to ensure we do not upgrade +# - blcr-dkms fails to build on kernel 2.6.35 +BadVersions=blcr-dkms_0.8.2-13 +# ubiquity slideshow +#SlideshowUrl=http://people.canonical.com/~mvo/ubiquity-slideshow-upgrade/slides/ + +[KernelRemoval] +Version=3.2.0 +BaseNames=linux-image,linux-headers,linux-image-debug,linux-backport-modules,linux-header-lbm +Types=386,ec2,generic,rt,server,virtual + +# information about the individual meta-pkgs +[trisquel] +KeyDependencies=trisquel-desktop-common-data, unity-greeter, trisquel-session +# those pkgs will be marked remove right after the distUpgrade in the cache +PostUpgradeRemove=casper, xscreensaver, gnome-cups-manager, powermanagement-interface, deskbar-applet, nautilus-cd-burner, compiz-core, gdm, gnome-ppp, gwibber, remmina-common +ForcedObsoletes=desktop-effects, cups-pdf, policykit-gnome, gnome-mount, gdm, notification-daemon + +[trisquel-mini] +KeyDependencies=trisquel-mini-data unity-greeter +#Remove previous gnome component from ltrisquel to avoid pulling gnome depends on upgrade (LP: #945215) +PostUpgradeRemove=casper, gnome-bluetooth, gnome-power-manager + +[Files] +BackupExt=distUpgrade +LogDir=/var/log/dist-upgrade/ + +[Sources] +From=toutatis +To=belenos +ValidOrigin=Trisquel +ValidMirrors = mirrors.cfg +Components=main +Pockets=security,updates,backports +;AllowThirdParty=False + +;[PreRequists] +;Packages=release-upgrader-apt,release-upgrader-dpkg +;SourcesList=prerequists-sources.list +;SourcesList-ia64=prerequists-sources.ports.list +;SourcesList-hppa=prerequists-sources.ports.list + +[Aufs] +; this is a xor option, either full or chroot overlay +;EnableFullOverlay=yes +;EnableChrootOverlay=yes +; sync changes from the chroot back to the real system +;EnableChrootRsync=yes +; what chroot dir to use +;ChrootDir=/tmp/upgrade-chroot +; the RW dir to use (either for full overlay or chroot overlay) +;RWDir=/tmp/upgrade-rw + +[Network] +MaxRetries=3 + +[NonInteractive] +ForceOverwrite=yes +RealReboot=no +DebugBrokenScripts=no +DpkgProgressLog=no +;TerminalTimeout=2400 diff --git a/helpers/make-ubuntu-release-upgrader b/helpers/make-ubuntu-release-upgrader new file mode 100644 index 00000000..e617e44d --- /dev/null +++ b/helpers/make-ubuntu-release-upgrader @@ -0,0 +1,326 @@ +#!/bin/sh +# +# Copyright (C) 2008-2010 Rubén RodrÃguez <ruben@trisquel.info> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Note that you would need to publish and sign the upgrade tarball +# gpg -ba release_name.tar.gz +# Also, don't forget to update the meta-release files at archive and packages.t.i + +VERSION=9 + +. ./config + +#%FSDG: Remove functions to deal with proprietary drivers +rm ./DistUpgrade/xorg_fix_proprietary.py +rm ./DistUpgrade/NvidiaDetector +sed s/self.checkForNvidia/#self.checkForNvidia/ DistUpgrade/DistUpgradeCache.py -i +#sed s/self._test_and_warn_on_old_nvidia/#self._test_and_warn_on_old_nvidia/ -i DistUpgrade/DistUpgradeQuirks.py +#sed s/self._test_and_warn_on_nvidia_and_no_sse/#self._test_and_warn_on_nvidia_and_no_sse/ -i DistUpgrade/DistUpgradeQuirks.py +sed s/self._test_and_warn_on_dropped_fglrx_support/#self._test_and_warn_on_dropped_fglrx_support/ -i DistUpgrade/DistUpgradeQuirks.py +sed '/nvidia/d' DistUpgrade/build-tarball.sh -i +rm tests/test-data/xorg.conf.fglrx + +#% Make sure nvidia-common and fglrx-modaliases are not installed +apt-get remove --purge -y nvidia-common || true +apt-get remove --purge -y fglrx-modaliases || true + +#https://bugs.launchpad.net/ubuntu/+source/python-defaults/+bug/990740 +cat << EOF >> DistUpgrade/DistUpgradeQuirks.py + + def from_taranisPostInitialUpdate(self): + logging.debug("Setting APT::Immediate-Configure=false") + apt.apt_pkg.config.set("APT::Immediate-Configure", "false") + os.system("apt-get install --force-yes -y libblkid1 lzma dpkg") + + def from_taranisPostCleanup(self): + logging.debug("Setting APT::Immediate-Configure=true") + apt.apt_pkg.config.set("APT::Immediate-Configure", "true") +EOF + + +rm ./DistUpgrade/Ubuntu.info +cat << EOF > DistUpgrade/Trisquel.info +ChangelogURI: http://packages.trisquel.info/changelogs/pool/%s/%s/%s/%s_%s/%s + +Suite: $CODENAME +RepositoryType: deb +BaseURI: http://archive.trisquel.info/trisquel/ +Description: Trisquel $CODENAME +Component: main +Enabled: 1 +CompDescription: Trisquel GNU/linux packages + +Suite: $CODENAME-security +RepositoryType: deb +BaseURI: http://archive.trisquel.info/trisquel/ +Description: Trisquel $CODENAME Security Updates +Component: main +Enabled: 1 +CompDescription: Trisquel GNU/linux packages + +Suite: $CODENAME-updates +RepositoryType: deb +BaseURI: http://archive.trisquel.info/trisquel/ +Description: Trisquel $CODENAME Updates +Component: main +Enabled: 1 +CompDescription: Trisquel GNU/linux packages + +Suite: $CODENAME-backports +RepositoryType: deb +BaseURI: http://archive.trisquel.info/trisquel/ +Description: Trisquel $CODENAME Backports +Component: main +Enabled: 1 +CompDescription: Trisquel GNU/linux packages +EOF + +rm DistUpgrade/ReleaseAnnouncement +cat << EOF > DistUpgrade/ReleaseAnnouncement += Welcome to Trisquel GNU/Linux $REVISION '$CODENAME' = + +The Trisquel team is proud to announce Trisquel $REVISION '$CODENAME'. +We recommend to apply all pending updates to the system before upgrading. + +Trisquel is a fully free operating system based in GNU/Linux, for domestic +users, small enterprises and educational centers. + +We hope you enjoy Trisquel. + +== Feedback and Helping == + +If you would like to help shape Trisquel, take a look at the list of +ways you can participate at + + http://trisquel.info/en/wiki/how-help + +Your comments, bug reports, patches and suggestions will help ensure +that our next release is the best release of Trisquel ever. If you feel +that you have found a bug please send it to us via + + http://trisquel.info/project/issues + +If you have a question, or if you think you may have found a bug but +aren't sure, first try asking on the #trisquel IRC channel on Freenode, +on the Trisquel Users mailing list, or on the Trisquel forums: + + http://listas.trisquel.info/ + http://trisquel.info/forum + +== More Information == + +You can find out more about Trisquel on our website, IRC channel and wiki. +If you're new to Trisquel, please visit: + + http://trisquel.info + +To sign up for future Trisquel announcements, please subscribe to Trisquel's +very low volume announcement list at: + + http://listas.trisquel.info/mailman/listinfo/trisquel-announce + +EOF + +rm DistUpgrade/DevelReleaseAnnouncement +cat << EOF > DistUpgrade/DevelReleaseAnnouncement +This is a development release, do not install on production systems! + +EOF + +cat DistUpgrade/ReleaseAnnouncement >> DistUpgrade/DevelReleaseAnnouncement + +rm DistUpgrade/EOLReleaseAnnouncement +cat << EOF > DistUpgrade/EOLReleaseAnnouncement += Trisquel GNU/Linux $REVISION '$CODENAME' is NO LONGER SUPPORTED! = + +You are atempting to upgrade to a version of Trisquel that is no longer +supported. Since we do only keep upgrade packages for decomissioned releases +for a while, this upgrade may fail. Try the sandbox method first (by running +update-manager -s) or ask in our forums, lists or irc channels if you are +unsure about this procedure. + +Even if the required upgrade packages for $CODENAME are still available, to +get a currently supported release you would need to upgrade at least once +more after this procedure ends, so we recommend you to do a clean install +using the latest LTS or STS edition. + +== Feedback and Helping == + +If you would like to help shape Trisquel, take a look at the list of +ways you can participate at + + http://trisquel.info/en/wiki/how-help + +Your comments, bug reports, patches and suggestions will help ensure +that our next release is the best release of Trisquel ever. If you feel +that you have found a bug please send it to us via + + http://trisquel.info/project/issues + +If you have a question, or if you think you may have found a bug but +aren't sure, first try asking on the #trisquel IRC channel on Freenode, +on the Trisquel Users mailing list, or on the Trisquel forums: + + http://listas.trisquel.info/ + http://trisquel.info/forum + +== More Information == + +You can find out more about Trisquel on our website, IRC channel and wiki. +If you're new to Trisquel, please visit: + + http://trisquel.info + +To sign up for future Trisquel announcements, please subscribe to Trisquel's +very low volume announcement list at: + + http://listas.trisquel.info/mailman/listinfo/trisquel-announce + +EOF + +rm DistUpgrade/EOLReleaseAnnouncement.html DistUpgrade/ReleaseAnnouncement.html + +apt-get install -q -y parsewiki +parsewiki DistUpgrade/EOLReleaseAnnouncement > DistUpgrade/EOLReleaseAnnouncement.html +parsewiki DistUpgrade/ReleaseAnnouncement > DistUpgrade/ReleaseAnnouncement.html + +rm data/removal_blacklist.cfg +cat <<EOF > data/removal_blacklist.cfg +# blacklist of packages that should never be removed +trisquel-base +trisquel-minimal +trisquel-desktop-common +trisquel +trisquel-mini +triskel +trisquel-sugar +# update-manager should not remove itself +update-manager +update-manager-core +EOF + +rm data/mirrors.cfg +cat << EOF > data/mirrors.cfg +http://archive.trisquel.info/trisquel/ +ftp://archive.trisquel.info/trisquel/ +http://es.archive.trisquel.info/trisquel/ +ftp://es.archive.trisquel.info/trisquel/ +http://fr.archive.trisquel.info/trisquel/ +ftp://fr.archive.trisquel.info/trisquel/ +http://nl.archive.trisquel.info/trisquel/ +ftp://nl.archive.trisquel.info/trisquel/ +http://us.archive.trisquel.info/trisquel/ +http://in.archive.trisquel.info/trisquel/ +ftp://in.archive.trisquel.info/trisquel/ +http://mirror.cedia.org.ec/trisquel.packages/ +http://mirrors.serverhost.ro/trisquel/packages/ +http://cn.archive.trisquel.info/trisquel/ +http://ftp.caliu.cat/pub/distribucions/trisquel/packages +http://mirrors.knoesis.org/trisquel/packages/ +http://mirrors.ukfast.co.uk/sites/trisquel.info/ +EOF + +rm data/DistUpgrade.cfg* +cp $DATA/DistUpgrade.cfg* data/ + +cat << EOF1 > DistUpgrade/trisquel-postinstall.sh +#!/bin/sh + +# Making sure this is gone +apt-get remove --force-yes -y notification-daemon + +if ! [ -f /etc/grub.d/01_PASSWORD ]; then +cat << EOF > /etc/grub.d/01_PASSWORD +#! /bin/sh -e +# Trisquel enables a random password to grub during install +# Comment this file to remove the password. +# This file should only be readable by root. + +echo set superusers=grub +echo password grub \$(bash -c 'echo \$RANDOM') +EOF +fi + +# Just in case +update-initramfs -u +update-grub +EOF1 +chmod 755 DistUpgrade/trisquel-postinstall.sh + + +replace changelogs.ubuntu.com packages.trisquel.info . + +/bin/sed -i 's/�~Lubuntu/�~Ltrisquel/g; s/被ubuntu/被trisquel/g; s#http://launchpad.net/ubuntu/+source/%s/%s/+changelog#http://trisquel.info/project/issues#g; s/<.*@ubuntu.com/<info@trisquel.info/g; s/ ubuntu\n/ trisquel\n/g; s/ubuntu\ /trisquel\ /g; s/\ ubuntu/\ trisquel/g; s/Ubuntu/Trisquel/g; s/ubuntu-desktop/trisquel-/g; s/www.ubuntu.com/trisquel.info/g; s/www.ubuntulinux.org/trisquel.info/g ' po/*.po $(find | grep py$) $(find | grep '\.glade$') + +apt-get install --force-yes -y rpl +rpl 11\.04 5\.0 DistUpgrade/*.ui +rpl 11\.04 5\.0 po/* -R +rpl 11\.10 5\.5 DistUpgrade/*.ui +rpl 11\.10 5\.5 po/* -R +rpl 12\.04 6\.0 DistUpgrade/*.ui +rpl 12\.04 6\.0 po/* -R +rpl 14\.04 7\.0 po/* -R +rpl 14\.04 7\.0 DistUpgrade/*.ui -R +replace '14.04' '7.0' . -R +rpl $UPSTREAM $CODENAME . -R +rpl oneiric brigantia . -R +rpl natty dagda . -R +rpl maverick slaine . -R +rpl lucid taranis . -R +rpl karmic awen . -R +rpl jaunty dwyn . -R +rpl hardy robur . -R +rpl lucid taranis . -R +rpl precise toutatis . -R + +rm ./data/demoted.cfg ./DistUpgrade/demoted.cfg.hardy ./DistUpgrade/demoted.cfg.lucid +#cp ./utils/demoted.cfg.precise data/demoted.cfg +#cp ./utils/demoted.cfg.precise utils/demoted.cfg +rm utils/demoted.cfg.lucid utils/demoted.cfg.hardy utils/demoted.cfg.dapper utils/demoted.cfg.precise + +echo "notification-daemon" > data/demoted.cfg +echo "notification-daemon" $DATA/demoted utils/demoted.cfg + +rpl " Ubuntu " " Trisquel " . -R +rpl "Ubuntu " "Trisquel " . -R +rpl " Ubuntu" " Trisquel" . -R +rpl " ubuntu " " trisquel " . -R +rpl "ubuntu " "trisquel " . -R +rpl " ubuntu" " trisquel" . -R +rpl archive.ubuntu.com/ubuntu es.archive.trisquel.info/trisquel . -R +rpl security.ubuntu.com/ubuntu archive.trisquel.info/trisquel . -R +rpl archive.ubuntu.com es.archive.trisquel.info . -R +rpl security.ubuntu.com archive.trisquel.info . -R +sed 's/main restricted" %/main\\n" %/g' DistUpgrade/DistUpgradeController.py -i +rpl "main restricted" "main" DistUpgrade -R +sed 's/,"restricted"//g' DistUpgrade/DistUpgradeController.py -i +#sed 's/","restricted"/\\n"/g' DistUpgrade/DistUpgradeController.py -i +#rpl '10.04' $REVISION DistUpgrade po -R +replace Ubuntu Trisquel . -R +replace Kubuntu Triskel . -R +replace Canonical Trisquel . -R +replace Trisquel-Gettext Ubuntu-Gettext . -R + +sed '1s/trisquel/ubuntu/' debian/control -i +sed '/drivers/d' debian/control -i + +changelog "Compiled for Trisquel" + +PARALLEL=false compile + +cp ../dist-upgrader* /root -- GitLab