ubuntu-release-upgrader: start work for ecne do-release-upgrade.

This commit is contained in:
Luis Guzmán 2025-06-14 22:47:34 -06:00
parent 1c4c985b76
commit b0a4c0fb48
4 changed files with 182 additions and 30 deletions

View file

@ -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

View file

@ -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

View file

@ -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):
"""