From b0a4c0fb486c766fc9433f55033d8b4401114c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Guzm=C3=A1n?= Date: Sat, 14 Jun 2025 22:47:34 -0600 Subject: [PATCH] ubuntu-release-upgrader: start work for ecne do-release-upgrade. --- .../ubuntu-release-upgrader/DistUpgrade.cfg | 4 +- .../DistUpgrade.cfg.aramo | 93 +++++++++++++++++++ ...automatic_install_usrmerge_for_t-r-u.patch | 42 +++++++++ helpers/make-ubuntu-release-upgrader | 73 +++++++++------ 4 files changed, 182 insertions(+), 30 deletions(-) create mode 100644 helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.aramo create mode 100644 helpers/DATA/ubuntu-release-upgrader/patch_changes/000-automatic_install_usrmerge_for_t-r-u.patch diff --git a/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg index 8b65961..0a5bed4 100644 --- a/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg +++ b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg @@ -68,8 +68,8 @@ BackupExt=distUpgrade LogDir=/var/log/dist-upgrade/ [Sources] -From=nabia -To=aramo +From=aramo +To=ecne ValidOrigin=Trisquel ValidMirrors = mirrors.cfg Components=main diff --git a/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.aramo b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.aramo new file mode 100644 index 0000000..0a5bed4 --- /dev/null +++ b/helpers/DATA/ubuntu-release-upgrader/DistUpgrade.cfg.aramo @@ -0,0 +1,93 @@ +[View] +# the views will be tried in this order, if one fails to import, the next +# is tried +View=DistUpgradeViewGtk3,DistUpgradeViewKDE,DistUpgradeViewText +#View=DistUpgradeViewNonInteractive +#Depends= apt (>= 1.0.10.2ubuntu2) +# 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, trisquel-mini, triskel, trisquel-sugar, trisquel-gnome +BaseMetaPkgs=trisquel-minimal, trisquel-base +IgnoredTasks=minimal, standard +Demotions=demoted.cfg +RemovalDenylistFile=removal_denylist.cfg +# if those packages were installed, make sure to keep them installed +KeepInstalledPkgs=xserver-xorg-video-all +KeepInstalledSection=translations +RemoveObsoletes=yes +PurgeObsoletes=yes +#ForcedObsoletes=ksplash-engine-moodin, powernowd, laptop-mode-tools +# hints for for stuff that should be done right after the cache calculated +# the dist-upgrade (not to be confused with the PostUpgrade hooks in the +# quirks handling) +#PostUpgradePurge=linux-restricted-modules-common +#PostUpgradeRemove=xsettings-kde +PostUpgradeRemove=resolvconf,notification-daemon +#PostUpgradeUpgrade=brasero,edubuntu-desktop +#PostUpgradeInstall=apt +#PostInstallScripts=./trisquel-postinstall.sh +EnableApport=no +# this supported deny listing 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/ + +[trisquel] +KeyDependencies=lightdm, mate-desktop-environment, marco, ubuntu-mate-default-settings, lightdm-gtk-greeter +# those pkgs will be marked remove right after the distUpgrade in the cache +PostUpgradeRemove=casper, xscreensaver, powermanagement-interface, compiz-core, gdm, gnome-ppp, resolvconf +ForcedObsoletes= cups-pdf, notification-daemon, libcogl15, resolvconf + +[trisquel-mini] +KeyDependencies=lxde +#Remove previous gnome component from ltrisquel to avoid pulling gnome depends on upgrade (LP: #945215) +PostUpgradeRemove=casper, gnome-bluetooth, resolvconf +ForcedObsoletes= cups-pdf, notification-daemon, libcogl15, resolvconf + +[triskel] +KeyDependencies=triskel-settings-desktop, plasma-desktop, sddm +PostUpgradeRemove=powermanagement-interface, guidance-power-manager, kde-guidance-powermanager, kmix +# those packages are marked as obsolete right after the upgrade +ForcedObsoletes=ivman, gtk-qt-engine +# help the resolver a bit: LP: #1426132 +PostUpgradeInstall=baloo-kf5 + +[trisquel-sugar] +KeyDependencies=sugar, lightdm-gtk-greeter + +[trisquel-gnome] +KeyDependencies=gnome-core, gdm3 + +[Files] +BackupExt=distUpgrade +LogDir=/var/log/dist-upgrade/ + +[Sources] +From=aramo +To=ecne +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 + +[Network] +MaxRetries=3 + +[NonInteractive] +ForceOverwrite=yes +RealReboot=no +DebugBrokenScripts=no +DpkgProgressLog=no +;TerminalTimeout=2400 diff --git a/helpers/DATA/ubuntu-release-upgrader/patch_changes/000-automatic_install_usrmerge_for_t-r-u.patch b/helpers/DATA/ubuntu-release-upgrader/patch_changes/000-automatic_install_usrmerge_for_t-r-u.patch new file mode 100644 index 0000000..9d2e828 --- /dev/null +++ b/helpers/DATA/ubuntu-release-upgrader/patch_changes/000-automatic_install_usrmerge_for_t-r-u.patch @@ -0,0 +1,42 @@ +diff --git a/DistUpgrade/DistUpgradeQuirks.py b/DistUpgrade/DistUpgradeQuirks.py +index 9423f091..00d9b84c 100644 +--- a/DistUpgrade/DistUpgradeQuirks.py ++++ b/DistUpgrade/DistUpgradeQuirks.py +@@ -2000,17 +2000,27 @@ class DistUpgradeQuirks(object): + break + + if fail: +- logging.debug('System is not /usr-merged!') +- self._view.error( +- _( +- f'Cannot upgrade system with unmerged /usr' +- ), +- _( +- 'Please install the usrmerge package to fix this, ' +- 'and then try the upgrade again.' +- ), ++ logging.warning( ++ "System is not /usr-merged. Installing usrmerge before continuing..." ++ ) ++ res = subprocess.run(["apt-get", "update"]) ++ res2 = subprocess.run(["apt-get", "-y", "install", "usrmerge"]) ++ ++ if res2.returncode != 0: ++ # Installation failed, abort the upgrade with a clear message ++ self.controller.error(_( ++ "The system is not /usr-merged and 'usrmerge' could not be " ++ "installed automatically. Please install it manually and " ++ "try again." ++ )) ++ return ++ ++ # Re-check that /usr merge is now in place ++ # (ensure /bin -> /usr/bin, /lib -> /usr/lib, etc.) ++ logging.info( ++ "usrmerge installed successfully; system is now /usr-merged. " ++ "Proceeding with the upgrade." + ) +- self.controller.abort() + + def _disable_cloud_init(self): + """ diff --git a/helpers/make-ubuntu-release-upgrader b/helpers/make-ubuntu-release-upgrader index c0980e5..191cfce 100644 --- a/helpers/make-ubuntu-release-upgrader +++ b/helpers/make-ubuntu-release-upgrader @@ -1,5 +1,6 @@ #!/bin/sh # +# Copyright (C) 2025 Luis Guzmán # Copyright (C) 2008-2024 Ruben Rodriguez # Copyright (C) 2014 Santiago Rodriguez # Copyright (C) 2019 Mason Hock @@ -24,13 +25,20 @@ # Also, don't forget to update the meta-release files at archive and packages.t.i # The "obsoletes" list from ubuntu has been removed -VERSION=16 +VERSION=16.1 . ./config +# Previous upstream release name, update for each release. +PREV_UPS_REL=jammy +PREV_TRIS_REL=aramo +# Use git Mirrors.masterlist as source. +Mirrors_masterlist=$(mktemp) +Mirrors_masterlist_git="trisquel-packages/-/raw/master/extra/mirrors/Mirrors.masterlist" +TPH_GIT_URL="https://gitlab.trisquel.org/trisquel/package-helpers/" # Fix PEP440 version compatibility # https://salsa.debian.org/debian/distro-info/-/commit/e2877dc44659d034155495e91976874c209a3c02 -patch --no-backup-if-mismatch -Np1 < $DATA/pep440.patch +patch_p1 $DATA/pep440.patch #%FSDG: Remove functions to deal with proprietary drivers rm ./DistUpgrade/xorg_fix_proprietary.py @@ -226,25 +234,11 @@ trisquel-release-upgrader-core EOF rm data/mirrors.cfg -#https://mirmon.trisquel.org/conf.txt -cat << EOF > data/mirrors.cfg -https://archive.trisquel.info/trisquel/ -https://archive.trisquel.org/trisquel/ -https://mirror.fsf.org/trisquel/ -https://mirror.cedia.org.ec/trisquel.packages/ -https://mirrors.ustc.edu.cn/trisquel/ -https://ftp.caliu.cat/pub/distribucions/trisquel/packages/ -https://ftp.acc.umu.se/mirror/trisquel/packages/ -https://mirrors.ocf.berkeley.edu/trisquel/ -https://mirror.librelabucm.org/trisquel/ -https://mirror.linux.pizza/trisquel/packages/ -https://quantum-mirror.hu/mirrors/pub/trisquel/packages/ -https://mirror.csclub.uwaterloo.ca/trisquel/packages/ -https://ftpmirror1.infania.net/mirror/trisquel/packages/ -https://mirrors.nju.edu.cn/trisquel/ -https://mirror.math.princeton.edu/pub/trisquel-packages/ -https://mirrors.dotsrc.org/trisquel/ -EOF +# https://gitlab.trisquel.org/trisquel/trisquel-packages/-/tree/master/extra/mirrors +# FIXME: Propose a way to integrate from git and avoid fetching via wget/curl. +wget https://gitlab.trisquel.org/trisquel/$Mirrors_masterlist_git -o /dev/null -O $Mirrors_masterlist +python3 $DATA/../python-apt/parse-mirror-masterlist.py $Mirrors_masterlist|grep https|sort > data/mirrors.cfg +rm $Mirrors_masterlist replace changelogs.ubuntu.com packages.trisquel.org . @@ -288,16 +282,23 @@ rpl noble ecne . -R rm data/DistUpgrade.cfg* cp $DATA/DistUpgrade.cfg* data/ -cat << EOF >> data/demoted.cfg +cat << EOF | tee -a utils/demoted.cfg utils/demoted.cfg.$PREV_UPS_REL notification-daemon resolvconf eom +desktop-common EOF -sed 's|.ubuntu-bug ubuntu-release-upgrader-core. in a terminal|https://gitlab.trisquel.org/trisquel/package-helpers in a browser.|' DistUpgrade/DistUpgradeCache.py -i -replace "https*://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+filebug" "https://gitlab.trisquel.org/trisquel/package-helpers/-/issues" . -replace "https*://launchpad.net/ubuntu/+source/ubuntu-release-upgrader" "https://gitlab.trisquel.org/trisquel/package-helpers/" . -replace "https*://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+filebug" "https://gitlab.trisquel.org/trisquel/package-helpers/-/issues" . +for i in utils/demoted.cfg utils/demoted.cfg.$PREV_UPS_REL +do + sort -o $i $i +done +mv data/demoted.cfg.$PREV_UPS_REL data/demoted.cfg.$PREV_TRIS_REL + +sed -i "s|the command .ubuntu-bug ubuntu-release-upgrader-core. in a terminal|$TPH_GIT_URL|" DistUpgrade/DistUpgradeCache.py +replace "https*://launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+filebug" "${TPH_GIT_URL}-/issues" . +replace "https*://launchpad.net/ubuntu/+source/ubuntu-release-upgrader" "$TPH_GIT_URL" . +replace "https*://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+filebug" "${TPH_GIT_URL}-/issues" . find -type f |xargs rename 's/ubuntu-release-upgrader/trisquel-release-upgrader/g' replace "ubuntu-release-upgrader" "trisquel-release-upgrader" . mv kubuntu-devel-release-upgrade triskel-devel-release-upgrade @@ -325,12 +326,28 @@ rpl "main restricted" "main" DistUpgrade -R replace Ubuntu Trisquel replace Canonical Trisquel replace "https*://www.ubuntu.com/" "https://trisquel.info" . -replace "https*://wiki.ubuntu.com/X/Bugs/" "https://gitlab.trisquel.org/trisquel/package-helpers/-/issues" . +replace "https*://wiki.ubuntu.com/X/Bugs/" "${TPH_GIT_URL}-/issues" . replace "https*://wiki.ubuntu.com/" "https://trisquel.info/wiki" . replace "https*://help.ubuntu.com/community" "https://trisquel.info/wiki" . +/bin/sed -i \ + -e 's/kubuntu/triskel/g' \ + -e 's/xubuntu/trisquel-mini/g' \ + -e 's/�~Lubuntu/�~Ltrisquel/g' \ + -e 's/被ubuntu/被trisquel/g' \ + -e "s#http://launchpad.net/ubuntu/+source/%s/%s/+changelog#$TPH_GIT_URL#g" \ + -e 's/<.*@ubuntu.com/