+
    j:                         ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	H
t
 ^ RIHtHt ^RIHt ^RIHtHt ^RIHtHt  ! R R]4      tR# )	    N)PIPEPopen)datetimetimezone)gettext)RiscvProfileRiscvProfileException)S390xGenerationget_system_s390x_generationc                   <  a  ] tR t^'t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR0R lt R t!R0R lt"R0R  lt#R! t$R" t%R# t&R$ t'R% t(R& t)R1R' lt*R( t+R) t,R* t-R+ t.R, t/R- t0R.t1V t2R/# )2DistUpgradeQuirksa  
This class collects the various quirks handlers that can
be hooked into to fix/work around issues that the individual
releases have.

The following handlers are supported:
- PreCacheOpen: run *before* the apt cache is opened the first time
                to set options that affect the cache
- PostInitialUpdate: run *before* the sources.list is rewritten but
                     after an initial apt-get update
- PreDistUpgradeCache: run *right before* the dist-upgrade is
                       calculated in the cache
- PostDistUpgradeCache: run *after* the dist-upgrade was calculated
                        in the cache
- StartUpgrade: before the first package gets installed (but the
                download is finished)
- PostUpgrade: run *after* the upgrade is finished successfully and
               packages got installed
- PostCleanup: run *after* the cleanup (orphaned etc) is finished
c                    Wn         VP                  V n        W n        \        R R.\        RR7      P                  4       ^ ,          P                  4       V n        ^ V n        RV n	        RV n
        RV n        RV n        R# )unamez-rT)stdoutuniversal_newlinesNF)
controller_viewconfigr   r   communicatestripr   extra_snap_space_poke_snapstore_reachable
_snap_list_did_change_font)selfr   r   s   &&&?/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeQuirks.py__init__DistUpgradeQuirks.__init__=   so    $%%
GT?4.244?KM!EEJUW 	
 !
$)! %    c                    V P                   P                  '       d   \        P                  ! R4       R# \        P                  ! R4       V P                  4        R# )z2run before the apt cache is opened the first time )not running quirks in partialUpgrade modeNzrunning Quirks.PreCacheOpen)r   _partialUpgradelogginginfodebug_add_apport_ignore_listr   s   &r   PreCacheOpenDistUpgradeQuirks.PreCacheOpenJ   s=     ??***LLDE34$$&r    c                4   V P                   P                  '       d   \        P                  ! R4       R# \        P                  ! R4       V P                  4        V P                  4        V P                  4        V P                  4        V P                  4        V P                  4        V P                   P                  pV P                  V4       V P                  4        RV9  d   \        P                  ! R4       R# VR,          P                  '       d[   \        P                   P#                  R4      '       g&   \        P                   P#                  R4      '       d   V P%                  4        V P&                  '       d   V P)                  4        R# R# )z1run after the apt cache is opened the first time r"   Nz running Quirks.PostInitialUpdatesnapd'package required for Quirk not in cachez/run/snapd.socketz/run/snapd-snap.socket)r   r#   r$   r%   r&   _test_and_fail_on_rva23_test_and_fail_without_cgroupv2_test_and_fail_on_z13_test_and_fail_on_pi_old_eeprom;_test_and_fail_rabbitmq_server_installed_and_not_upgradable_test_and_fail_on_tpm_fdecache_test_and_warn_if_ros_installed#_maybe_prevent_flatpak_auto_removalis_installedospathexists_checkStoreConnectivityr   _calculateSnapSizeRequirementsr   r4   s   & r   PostInitialUpdate#DistUpgradeQuirks.PostInitialUpdateU   s    ??***LLDE89$$&,,.""$,,.HHJ&&(%%,,U3002%MMCD>&&& 344 899((* $$$//1 %r    c                b   V P                   P                  '       d   \        P                  ! R 4       R# \        P                  ! R4       V P                   P
                  pRV9  d   \        P                  ! R4       R# VR,          P                  '       d#   V P                  '       d   V P                  4        RV9   d:   VR,          P                  '       d!   V P                  4        V P                  4        RV9   d.   VR,          P                  '       d   V P                  4        R# R# R# )r"   Nzrunning Quirks.PostUpgrader,   r-   ubuntu-desktop-raspiubuntu-server-raspi)r   r#   r$   r%   r&   r4   r7   r   _replaceDebsAndSnaps_replace_fkms_overlay_remove_z3fold_add_kms_overlayr=   s   & r   PostUpgradeDistUpgradeQuirks.PostUpgradex   s    ??***LLDE23%%%MMCD>&&&%%'!U*+,999**,##% E)*+888%%' 9 *r    c                R   V P                   P                  '       d   \        P                  ! R 4       R#  \        P                  ! R4       V P                  4         \        P                  ! RR.4       R#   \         d%   p\        P                  ! RT 24        Rp?R# Rp?ii ; i)r"   Nzrunning Quirks.PostCleanupsnaprefreshzFailed to refresh snaps : )	r   r#   r$   r%   r&   _remove_apport_ignore_list
subprocess
check_call	Exception)r   es   & r   PostCleanupDistUpgradeQuirks.PostCleanup   s}    ??***LLDE23'')	<!!69"56 	<MM6qc:;;	<s   A7 7B&B!!B&c                h   V P                   P                  '       d   \        P                  ! R 4       R# \        P                  ! R4       V P                   P
                  pV P                  4        V P                  4        V P                  4        V P                  4        V P                  V4       R# )r"   Nzrunning Quirks.StartUpgrade)r   r#   r$   r%   r&   r4   _removeOldApportCrashes_killUpdateNotifier_pokeScreensaver_set_generic_font_disable_kdump_tools_on_installr=   s   & r   StartUpgradeDistUpgradeQuirks.StartUpgrade   s|    ??***LLDE34%%$$&  " ,,U3r    c                    V P                   P                  '       d   \        P                  ! R4       R# \        P                  ! R4       V P                  4        V P                  4        V P                  4        R# )z.run right before calculating the dist-upgrade r"   Nz"running Quirks.PreDistUpgradeCache)r   r#   r$   r%   r&   _maybe_remove_gpg_wks_server_install_linux_sysctl_defaults_fix_lintian_resolver_deadlockr(   s   &r   PreDistUpgradeCache%DistUpgradeQuirks.PreDistUpgradeCache   sU     ??***LLDE:;))+++-++-r    c                   V P                   P                  '       d   \        P                  ! R4       R# \        P                  ! R4       V P                  4        V P                  4        V P                  4        V P                  4        R# )z'run after calculating the dist-upgrade r"   Nz#running Quirks.PostDistUpgradeCache)	r   r#   r$   r%   r&   _install_linux_metapackage+_switch_to_systemd_coredump_for_kde_flavors_force_piboot_try_install_force_dracut_installr(   s   &r   PostDistUpgradeCache&DistUpgradeQuirks.PostDistUpgradeCache   sa     ??***LLDE;<'')88:&&(""$r    c                   \        4       pR F/  pVP                  \        P                  ! RV,          4      4       K1  	  RpV F`  pV'       d    MWV FM  pVP	                  VP
                  4      '       g   K&  VP                  '       g   VP                  '       d   Rp K^  	  Kb  	  V'       dU   V P                  P                  \        R4      \        R4      4      pV'       g   V P                  P                  4        R# R# R# )z
Test and warn if ROS is installed. A given ROS release only
supports specific Ubuntu releases, and can cause the upgrade
to fail in an overly-cryptic manner.
zros-[^\-]+-%sFTz-The Robot Operating System (ROS) is installeda	  It appears that ROS is currently installed. Each ROS release is very strict about the versions of Ubuntu it supports, and Ubuntu upgrades can fail if that guidance isn't followed. Before continuing, please either uninstall ROS, or ensure the ROS release you have installed supports the version of Ubuntu to which you're upgrading.

For ROS 1 releases, refer to REP 3:
https://www.ros.org/reps/rep-0003.html

For ROS 2 releases, refer to REP 2000:
https://www.ros.org/reps/rep-2000.html

Are you sure you want to continue?N)catkinzrosboost-cfgroscleanzros-environmentzros-workspace)setaddrecompilematchnamer7   marked_installr   askYesNoQuestion_r   abort)r   r4   ros_package_patternspackage_nameros_is_installedpkgpatternress   &&      r   r5   1DistUpgradeQuirks._test_and_warn_if_ros_installed   s      #u!L !$$

+l:;=! !C/==**'''3+=+=+=+/(	 0	  **--AB 7 89C %%'  r    c                   RpRV P                   P                  9  d   R# V P                   P                  R,          P                  '       g   R# \        P                  P                  R4      '       g   R# R F^  p\        P                  ! RV.\        P                  R7      pVP                  P                  R4      P                  4       '       g   K\  Rp M	  \        P                  ! RP                  V'       d   R	MR
4      4       V'       g   R# V P                   P                  R,          P                  RR7       R F  pW@P                   P                  9  d   K  V P                   P                  V,          P                  '       g   KN  \        P                  ! RP                  V4      4       V P                   P                  V,          P                  RR7       K  	  V P                   P                  P!                  V P"                  P%                  4       V P"                  P'                  V P                   P                  4      4       R# )z
If flatpak is installed, and there are either active remotes, or
flatpak apps installed, prevent flatpak's auto-removal on upgrade.
FflatpakNz/usr/bin/flatpak)r   utf-8Tz-flatpak will{}be marked as manually installed z NOT )autoz'{} will be marked as manually installed)remoteslist)zplasma-discover-backend-flatpakzgnome-software-plugin-flatpak)r   r4   r7   r8   r9   r:   rM   runr   r   decoder   r$   r&   format	mark_autocommitr   getAcquireProgressgetInstallProgress)r   prevent_auto_removalsubcmdrrx   s   &    r   r6   5DistUpgradeQuirks._maybe_prevent_flatpak_auto_removal   s   
  %DOO111$$Y/<<<ww~~011)F'0%??A xxw'--//'+$ * 	Ev%9cwG	I $i(222>5C/////??((-:::MMC!6#;(OO!!#&00e0<5 	$$JJ))+JJ))$//*?*?@	
r    c                   V P                   P                  R8w  d   R# RV P                   P                  9   d.   V P                   P                  R,          P                  '       g   R# Rp\        P
                  ! RV R24        V P                   P                  V,          P                  RR7       R#   \         d(   p\        P                  ! R	T R
T 24        Rp?R# Rp?ii ; i)z
Fix an issue on Noble where the resolver can get stuck in a deadlock
due to lintian being broken by a newer version of libyaml-libyaml-perl
and the resolver refusing to upgrade lintian due to having to install
libfile-libmagic-perl.

Fixes LP: #2150319
nobleNlintianzlibfile-libmagic-perlzQuirk: Marking 'z-' for install to prevent dependency deadlock.Fauto_fixzQuirk: Failed to mark 'z' for install: )	r   fromDistr4   r7   r$   r%   mark_installrO   error)r   pkg_namerP   s   &  r   r^   0DistUpgradeQuirks._fix_lintian_resolver_deadlock,  s     ??##w.T__222%%i0=== +xj ) 	
	OO!!(+88%8H 	MM)(?1#F 	s   -B4 4C&?C!!C&c                   R R.pRp \         P                  ! \         P                  P                  V4      RR7       \	        VR4      ;_uu_ 4       pV F  pVP                  V R24       K  	  RRR4       R#   + '       g   i     R# ; i  \         d(   p\        P                  ! RT R	T 24        Rp?R# Rp?ii ; i)
z/usr/libexec/tracker-extract-3z!/usr/sbin/update-apt-xapian-index2/etc/apport/blacklist.d/upgrade-quirks-ignore-listTexist_okw
NzFailed to create : )	r8   makedirsr9   dirnameopenwriterO   r$   r&   )r   ignore_listr9   fbinrP   s   &     r   r'   )DistUpgradeQuirks._add_apport_ignore_listJ  s    ,/

 D	;KK-=dCA&CGGse2J' ' !  	;MM-dV2aS9::	;s6   A	B A9/B 9B
	B 
B B?B::B?c                    R p \         P                  ! V4       R#   \         d(   p\        P                  ! RT RT 24        Rp?R# Rp?ii ; i)r   zFailed to remove r   N)r8   removerO   r$   r&   )r   r9   rP   s   &  r   rL   ,DistUpgradeQuirks._remove_apport_ignore_list[  sD    C	;IIdO 	;MM-dV2aS9::	;s    AA		Ac                    \         P                  P                  R4      '       d1   \        P                  ! R4       \
        P                  ! . RO4       R# R# )zkill update-notifierz/usr/bin/killallzkilling update-notifierN)killallz-qzupdate-notifier)r8   r9   r:   r$   r&   rM   callr(   s   &r   rU   %DistUpgradeQuirks._killUpdateNotifierc  s7     77>>,--MM34OO@A .r    c                   \         P                  P                  R 4      '       d   \         P                  P	                  R4      '       dk   \
        P                  ! R4       RpVR,          pVR,          p \        P                  ! VRR7      V n	        \        P                  ! V P                  4       R	# R	# R	#   \        \        3 d    \
        P                  ! R4        R	# i ; i)
z/usr/bin/xdg-screensaverDISPLAYz$setup poke timer for the screensaverzwhile true;z3 do /usr/bin/xdg-screensaver reset >/dev/null 2>&1;z sleep 30; doneTshellz failed to setup screensaver pokeN)r8   r9   r:   environgetr$   r&   rM   r   r   atexitregister_stopPokeScreensaverOSError
ValueError	exception)r   cmds   & r   rV   "DistUpgradeQuirks._pokeScreensaverj  s    GGNN566

y))MM@ACHHC$$CF'--c>
 9 9: * 7 Z( F!!"DEFs   6=B9 9'C$#C$c                    R pV P                   e=    V P                   P                  4        V P                   P                  4       pRV n         V#   \         d    \        P
                  ! R4        L,i ; i)FNzfailed to stop screensaver poke)r   	terminatewaitr   r$   r   )r   rz   s   & r   r   &DistUpgradeQuirks._stopPokeScreensaverw  sg    ::!E

$$&jjoo' DJ
  E!!"CDEs   4A !A32A3c           	     8    R F\  p\         P                   ! RV,          4       F8  p\        P                  ! RV: RV: R24       \        P                  ! V4       K:  	  K^  	  R#   \
         d)   p\        P                  ! RT,          4        Rp?R# Rp?ii ; i)z9remove old apport crash files and whoopsie control files z/var/crash/*%szremoving old z file ''z+error during unlink of old crash files (%s)N)z.crashz.uploadz	.uploaded)globr$   r&   r8   unlinkrO   warning)r   extr   rP   s   &   r   rT   )DistUpgradeQuirks._removeOldApportCrashes  sp    	O9#3c#9:AMMa"HIIIaL ; :  	OOOIAMNN	Os   A"A& &B1BBc                   Rp\         P                  P                  4       pRVR&    \        . RO\        \        VRR7      P                  4       p\        P                  ! RT^ ,          \        P                  4      '       d
   RT n	        R# \        P                  ! R	T^ ,          \        P                  4      '       Ed   \        P                  ! R
4       RpT P                  P                  pRT9   dd   TR,          P                   '       dK   TR,          P"                  P$                  P'                  R4      '       g   \        P                  ! R4       RpT'       dM   \)        R4      p\)        R4      pT P*                  P                  Yx4       T P                  P-                  4        MT P*                  P/                  \)        R4      \)        R4      4      pMRT^,          9   dF   \        P                  ! R4       T P*                  P/                  \)        R4      \)        R4      4      pM=RT^,          9   d   Rp\        P                  ! R4       M\        P                  ! R4       T'       g   T P                  P-                  4        R# R#   \         d,   p\        P                  ! RT 24       RT n	         Rp?R# Rp?ii ; i)z9check for connectivity to the snap store to install snapsFzC.UTF-8LANGT)r   stderrenvr   z8Failed to check snap store connectivity, assuming none: Nz	^ \* PASSz^ \*.*unreachablezNo snap store connectivitylxdz1:zlxd is installedz#Connection to the Snap Store faileda  You have the package lxd installed but your system is unable to reach the Snap Store. lxd is now provided via a snap and the release upgrade will fail if snapd is not functional. Please make sure you're connected to the Internet and update any firewall or proxy settings as needed so that you can reach api.snapcraft.io. If you are an enterprise with a firewall setup you may want to configure a Snap Store proxy.zConnection to Snap Store failedzYour system does not have a connection to the Snap Store. For the best upgrade experience make sure that your system can connect to api.snapcraft.io.
Do you still want to continue with the upgrade?zerror: unknown commandz snap debug command not availablezOutdated snapd packagezYour system does not have the latest version of snapd. Please update the version of snapd on your system to improve the upgrade experience.
Do you still want to continue with the upgrade?zerror: access deniedzNot running as root!z-Unhandled error connecting to the snap store.)rJ   r&   connectivity)r8   r   copyr   r   r   rO   r$   r&   r   rm   search	MULTILINEr   r   r4   r7   	candidateversion
startswithrs   r   rt   rr   )	r   rz   snap_env	connectedrP   old_lxd_deb_installedr4   summarymsgs	   &        r   r;   )DistUpgradeQuirks._checkStoreConnectivity  s'   ::??$$		?%)x1577B{}  99\9Q<>>(,D%YY+Yq\2<<HHMM67$)!OO))E~<,,,e..66AA$GGMM"45,0)$AB 	. 
 

  .%%'jj1178 H I &15MM<=**--*+ D EC $y|3CMM01MMIJOO!!# y  	MMJ1#N ).D%	s   (J K KKc           
        ^ RI p^ RIp^ RIHp V P	                  4        V P
                  P                  \        R4      4       V P                  P                  4        EF8  w  rEVR,          R8w  d   K  RRRR	R
VR
,          RVR,          /pR. RV./pVP                  P                  R\        VP                  V4      RR7      R7      pVP                  RR4       VP                  RR4       VP                  RV P                  P                   4        VP                  P#                  V4      P%                  4       p	VP'                  V	4      p
\)        V
R,          ^ ,          R,          R	,          R,          4      pT ;P2                  T,          un        EK;  	  R#   \*        T\,        3 d#    \.        P0                  ! RT,          4        EKr  i ; i)r   N)URLErrorz"Calculating snap size requirementscommandinstallzinstance-keyzupgrade-size-checkactiondownloadsnap-idchannelcontextactionsz)https://api.snapcraft.io/v2/snaps/refreshr~   encoding)urldatazSnap-Device-Series16zContent-typezapplication/jsonzSnap-Device-ArchitectureresultsrJ   sizezFailed fetching size of snap %s)jsonurllib.requesturllib.errorr   _prepare_snap_replacement_datar   updateStatusrs   r   itemsrequestRequestbytesdumps
add_headerr   archurlopenreadloadsintKeyErrorr   r$   r&   r   )r   r   urllibr   rJ   snap_objectr   r   reqresponser%   r   s   &           r   r<   0DistUpgradeQuirks._calculateSnapSizeRequirements  s   )
 	++- 	

"F GH!%!6!6!8D9%2 4*;y1;y1	F 2F8D ..((?4::d+g> ) @C NN/6NN>+=>NN5t7K7KL!>>11#6;;=zz(+4	?1-f5jA&IJ !!T)!!5 "9. h
3 ?$FGs   A(F/GGc                *   V P                   P                  \        R4      4       V P                  P	                  4        EF  w  rVR,          pVR8X  d<   VR,          pV P                   P                  \        RV,          4      4       RVRWA.pMpVR8X  d1   V P                   P                  \        R	V,          4      4       RW1.pM9V P                   P                  \        R
V,          4      4       RVRVR,          V.p V P                   P                  4        \        P                  ! V\        P                  RR7      pV P                   P                  4        TP                  ^ 8X  d   \        P                  ! T: RT: R24       TR8X  g   EKV  TR,          '       g   EKh  T P                  P                  P                  TR,          4       EK  	  R#   \        P                   d$    \        P                  ! T: RT: R24        EK  i ; i)z>install a snap and mark its corresponding package for removal zProcessing snap replacementsr   switchr   zswitching channel for snap %srJ   z	--channelr   zremoving snap %szinstalling snap %sT)r   checkz	 of snap z failedz
 succeededr   debN)r   r   rs   r   r   processEventsrM   r   r   CalledProcessErrorr$   r&   
returncoder   forced_obsoletesappend)r   rJ   r   r   r   	popenargsprocs   &      r   rC   &DistUpgradeQuirks._replaceDebsAndSnaps  s   

"@ AB "&!6!6!8D!),G("%i0

''5<= $Wk7I	H$

''*<t*C(DE#W3	

''*>*E(FG#W(+i*@$H		

((*!~~%??  

((* !#7DIJ)#E(:(:0077E8JK; "9. 00 FGs   AG3HHc                   \         P                  ! R4      pVP                  V4      pVP                  V4      pV'       dW   V'       dO   VP                  ^4      : RVP                  ^4      : 2pVP                  ^4      : RVP                  ^4      : 2p\        P
                  ! RV: RV: 24       \        P                  P                  W4      ^ 8  # )z"copied from ubuntu-drivers common z(.+)-([0-9]+)-(.+)-z
Comparing z with )	rm   rn   ro   groupr$   r&   aptapt_pkgversion_compare)r   term1term2ry   match1match2s   &&&   r   _is_greater_than"DistUpgradeQuirks._is_greater_than   s     **12u%u%f%||A%||A0E%||A%||A0E 	u=>{{**581<<r    c           	        T;'       d    R;'       g    Rp\         P                  ! R4      p\         P                  ! R4      pRpRpV EF=  pRVP                  9   g   K  RVP                  9  g   K*  VP                  '       g   VP                  '       g   KP  VP                  VP                  4      p	V	'       g   Ku  VP                  P                  R,          p
V	P                  ^4      : RV	P                  ^4      : 2pV P                  VV4      '       g   K  TpVP                  V
4      pR	V
9   d8   V'       d0   R
V: RV	P                  ^4      : RVP                  ^4      : 2pEK$  R
V: RV	P                  ^4      : 2pEK@  	  V# )zMGet the linux headers or linux metapackage
copied from ubuntu-drivers-common
z-headers zlinux-image-(.+)-([0-9]+)-(.+)z
linux-(.+)zlinux-imageextraSourcer  z-lts-linux)
rm   rn   rp   r7   rq   ro   r   recordr  r  )r   r4   headerssuffixry   source_patternmetapackager   rx   ro   sourcecurrent_versionmatch_sources   &&&          r   _get_linux_metapackage(DistUpgradeQuirks._get_linux_metapackage0  sF    ''Z--2**=>L1C)gSXX.E%%%);););chh/ 5 ]]11(;F16Q16Q'AO ,,_-46 6"1'5';';F'C"f, ,2+0;;q>+7+=+=a+@+BK ,2+0;;q>+;KC H r    c                4   V P                   P                  pV P                  VR4      pW!9  d    \        P                  ! RV,          4       R# W,          P
                  '       g3   \        P                  ! RV,          4       RpVP                  W#4       R# R# )zZEnsure the linux metapackage is installed for the newest_kernel
installed. (LP: #1509305)
Fz$linux metapackage (%s) not availableNz installing linux metapackage: %sz8linux metapackage may have been accidentally uninstalled)r   r4   r%  r$   r%   r7   r   )r   r4   linux_metapackagereasons   &   r   rb   ,DistUpgradeQuirks._install_linux_metapackage`  s     %% 77uE )LL?*+ ,'444LL;*+ ,OF09	 5r    c                :   V P                   P                  '       g   \        P                  P                  P                  R4      '       gN   RpVR,          p\        P                  ! V4       \        P                  P                  P                  RR4       R# R# R# )zHensure that on a desktop install recommends are installed
(LP: #759262)
zApt::Install-Recommendsz%Apt::Install-Recommends was disabled,z! enabling it just for the upgrade1N)	r   
serverModer  r  r   find_br$   r   rk   )r   r   s   & r   +ensure_recommends_are_installed_on_desktops=DistUpgradeQuirks.ensure_recommends_are_installed_on_desktopss  sr     )));;%%,,-FGG=::$""&&'@#F	 H *r    c                   VP                  RR4      p\        V\        4      '       g   V.pV FU  pW0P                  P                  9  d   K  V'       d.   V P                  P                  V,          P
                  RJ d   KT   R# 	  R# )zsHelper function that checks if the given deb2snap entry
has at least one metapkg which is installed on the system.
metapkgNFT)r   
isinstancer   r   r4   r7   )r   deb2snap_entrymetapkg_listr2  s   &&  r   _is_deb2snap_metapkg_installed0DistUpgradeQuirks._is_deb2snap_metapkg_installed~  sr     &)))T:,--(>L#Goo333OO))'2??5H $ r    c                   ^ RI p/ p/ p \        P                  P                  \        P                  P	                  \        P                  P                  \        4      4      R4      p\        VR4      ;_uu_ 4       pVP                  VP                  4       4      pRRR4       XR,           F  pVR,          V,          pV P                  V4      '       g   K,  VP                  RR4      p	VP                  RR4      P                  V P                  P                  R7      p
VP                  R	R
4      P                  V P                  P                  R7      pVP                  RR4      pWW3W'&   K  	  VR,           Fy  pVR,          V,          pVP                  RR4      p	V P                  V4      '       g   K>  XP                  RR4      P                  V P                  P                  R7      p
W3W7&   K{  	  W#3#   + '       g   i     ELi; i  \          d*   p\"        P$                  ! RT,          4        Rp?Y#3# Rp?ii ; i)r   Nzdeb2snap.jsonr   seededr  from_channelzstable/ubuntu-{FROM_VERSION})FROM_VERSION
to_channelzstable/ubuntu-{TO_VERSION})
TO_VERSIONforce_switchFunseededz%error reading deb2snap.json file (%s))r   r8   r9   joinr   abspath__file__r   r   r   r6  r   r   r   fromVersion	toVersionrO   r$   r   )r   r   seeded_snapsunseeded_snapsdeb2snap_pathr   d2srJ   seedr  	from_chanto_chanr>  unseedrP   s   &              r   _parse_deb2snap_json&DistUpgradeQuirks._parse_deb2snap_json  s   -	IGGLL 9:M mS))Qjj* * H8}T*::4@@hhud+
 !HH"2 &!%!<!<    (( 0 &#88     $xx>&)g%L"- &0 JZ.jj-::6BB HH"2 &!%!<!<    ),'7$ ( ++U *))N  	IOOCaGHH++	Is1   A2H < G<EH <H		H IH??Ic           	     
   / V n         V P                  4       w  rRp\        P                  ! RR.R\        P                  R7      P                  4       pV'       d   V^ ,          P                  R4      ^R#  Uu. uF  pVP                  4       ^ ,          NK  	  ppV FG  pWa9   g   Wb9   d   K  RRV P                  P                   2RV P                  P                   2R	3W&   KI  	  V P                  P                  \        R
4      4       VP                  4        EF  w  rgVw  rr/ p\        P                  ! RRV.R\        P                  R7      P                  4       pV P                  P                  4        \        P                   ! RV^ ,          \        P"                  4      '       d   \$        P&                  ! RV,          4       \        P                   ! RV	,          V^ ,          \        P"                  4      '       g)   \$        P&                  ! RV,          4       V'       g   EK  RVR&   MV P                  P(                  pV'       dA   W9  g   W,          P*                  '       g#   \$        P&                  ! RV: RV: R24       EKu  \        P                   ! RV^ ,          4      pV'       g!   \$        P&                  ! RV,          4       EK  RVR&   WR&   V^,          VR&   WR&   WP                   V&   EK  	  VP                  4        EF4  w  pw  r/ p\        P                  ! RRV.R\        P                  R7      P                  4       pV P                  P                  4        \        P                   ! RV^ ,          \        P"                  4      '       g   K  \$        P&                  ! RV,          4       \        P                   ! RV	,          V^ ,          \        P"                  4      '       g!   \$        P&                  ! RV,          4       EK	  RVR&   \        P                  ! RRV.R\        P                  R7      P                  4       pV P                  P                  4        V^ ,          P                  R4       F  pVP                  4       p\-        V4      ^8w  d   K%  V^,          pV^,          pVP/                  VR,           4      '       g   KW  VP                  R4      ^ ,          pVR8w  g   Kx  VV9  g   K  \$        P&                  ! RV: R V: R!24       RVR&   R"VR&    M	  WP                   V&   EK7  	  V P                   # u upi )$zHelper function fetching all required info for the deb-to-snap
migration: version strings for upgrade (from and to) and the list
of snaps (with actions).
r  rJ   r   T)r   r   r   Nzstable/ubuntu-FzChecking for installed snapsr%   z^installed: zSnap %s is installedz^tracking:.*%sz+Snap %s is not tracking the release channelr  r   zDeb package z) is not installed. Skipping snap package z installationzsnap-id:\s*(\w*)z'Could not parse snap-id for the %s snapr   r  r   r   r   connections:r  zSnap z is being used by z. Switching it to stable trackstable)r   rM  rM   r   r   r   splitr   rC  rD  r   r   rs   r   r  rm   r   r   r$   r&   r4   r7   lenr   )r   rE  rF  	snap_listlinesnaps_installedrJ   propsr  r:  r<  r>  r   	snap_infor4   ro   connsconn	conn_colsplugslot	plug_snaps   &                     r   r   0DistUpgradeQuirks._prepare_snap_replacement_data  sx   
 '+'@'@'B$	$$ff%58<,6OO==H[] 	  ,5Q<+=+=d+CAb+IK+I4  $zz|A+I  K ('4+A ()D)D(EF()B)B(CD	*L&	 ( 	

"@ AB'--/KD<A9S
K"((&&$)?<@0:AAL  JJ$$&yy)A,EE4t;<yy!2\!A!*1r||= =MM"O$(#) * ( !)1I& --S-UZ5L5L5LMMDG#O P		"5y|DMM"K$(#) *)2I&%(E").qI&%/	"$/OOD!O 0P *8)=)=)?%D%3K"((&&$)?<@0:AAL  JJ$$&yy)A,EE4t;<yy!2\!A!*1r||= =MM"O$(#) *)1I& #((&-)F<@0:AAL  

((*!!HNN40D $

I9~* $Q<D$Q<Dtcz22$(JJsOA$6	$+$N:#MM-19+> ? 6>K	25=K	2!! 1$ )4%U *@V EKs   8 Uc                   R p\         P                  ! V4      pVR,          VR,          V3 F  p VR,          pVP                  4       pVP                  RRR7      P	                  4       ^ ,          P                  4       pV Uu. uF  pV'       g   K  VR8w  g   K  VNK  	  p	pWy8X  d   \        P                  ! RV4       MQVP                  R	4      p
V
P                  V4       VP                  R
P                  V	4      P                  R4      4        R# 	  \        P                  ! RV4       R# u upi   \         d     EK  \         d%   p\        P                  ! RXY4        Rp? R# Rp?ii ; i)zQYou may need to remove zswap.zpool=z3fold from cmdline.txt on your boot partitionnewcurrentzcmdline.txtr~   replace)errorszzswap.zpool=z3foldzno z3fold usage found in %sz.txt.distUpgrader   Nz2failed to update kernel command line in %s: %s; %sz(failed to locate kernel command line; %s)pathlibPath
read_bytesr   
splitlinesrT  r$   r   with_suffixwrite_bytesr@  encodeFileNotFoundErrorr   r   )r   boot_dirfailure_action	boot_root	boot_pathcmdline_pathold_content
old_paramsparam
new_paramsbackup_pathexcs   &&          r   rE    DistUpgradeQuirks._remove_z3fold;  sl   % 	 LL*	#e+Y-BINI(=8*557  &&wy&AZ\!%%*UW  ",!+ !&*>!> E!+  
 +OO5|E #/":":;M"NK++K8 ,,,33G<>/ O< 	@$	&) %   +,8#OsC   AD5
D0D0D0!A1D50D55E2E2E2E--E2c                    VR ,           p\        VRRR7      ;_uu_ 4       pVP                  V4       RRR4        \        TRRR7      ;_uu_ 4       pTP                  T4       RRR4       R#   + '       g   i     LC; i  \         d$   p\        P                  ! RXYt4        Rp?R# Rp?ii ; i  + '       g   i     R# ; i  \         d$   p\        P                  ! RY7T4        Rp?R# Rp?ii ; i)z.distUpgrader   r~   r   Nz0unable to write boot config backup to %s: %s; %sz-unable to write new boot config to %s: %s; %s)r   r   IOErrorr$   r   )r   
old_config
new_configboot_config_filenamerp  boot_backup_filenamer   ry  s   &&&&&   r   _replace_pi_boot_config)DistUpgradeQuirks._replace_pi_boot_configh  s    	#7.#H *C'BBa
# C	E*C'BBa
# CB CB 	MML.E	
 CBB 	EMMI.^E E	Esh   B A.B C B2$C .A>	9B >B B/B**B/2C	=C C C4C//C4c                   R p \         P                  P                  VR4      p\        VRRR7      ;_uu_ 4       pVP	                  4       pRRR4       RP                  R XP                  R	R
7       4       4      pYe8X  d   \        P                  ! RT4       R# T P                  YVY24       R#   + '       g   i     Lk; i  \
         d    \        P                  ! RXT4        R# i ; i)zfYou may need to replace the vc4-fkms-v3d overlay with vc4-kms-v3d in config.txt on your boot partition
config.txtr   r~   r   N+failed to open boot configuration in %s; %sr  c              3      "   T Fs  pVP                  R 4      '       d!   RV,           VP                  R R4      ,           M6VP                  R4      '       g   VP                  4       R8X  d
   RV,           MTx  Ku  	  R# 5i)zdtoverlay=vc4-fkms-v3dz0# changed by do-release-upgrade (LP: #1923673)
#dtoverlay=vc4-kms-v3dzgpu_mem=z	start_x=1z1# disabled by do-release-upgrade (LP: #1923673)
#N)r   re  rstrip.0rW  s   & r   	<genexpr>:DistUpgradeQuirks._replace_fkms_overlay.<locals>.<genexpr>  sz      
 > 788 @$FLL13JKL z**dkkm{.J A4G	 >s   A=6A=(A=T)keependsz3no fkms overlay or camera firmware line found in %s)r8   r9   r@  r   r   rn  r$   r   rj  r   r  )r   ro  rp  r  r   boot_configr~  s   &&     r   rD   'DistUpgradeQuirks._replace_fkms_overlayy  s    ? 		#%77<<,#G *C'BBaffh C WW 
 $...=
 

  $OO $%9;$$%9	K7 CB  	MMG.@	s.   6C B.C .B>	9C >C #C('C(c                H  a
a R p. ROo
 \         P                  P                  VR4      p\        VRRR7      ;_uu_ 4       pVP	                  4       pRRR4       R oT
T3R	 lpXP                  4        Uu. uF  qwP                  4       NK  	  ppT! T4      pRP                  R
 T 4       4      p	Y8X  d   \        P                  ! RT4       R# T P                  YYY24       R#   + '       g   i     L; i  \
         d    \        P                  ! RXT4        R# i ; iu upi )zbYou may need to add dtoverlay=vc4-kms-v3d to an [all] section in config.txt on your boot partitionr  r  r   r~   r   Nr  c                 N   R p^ p\        V 4       F  w  r4VP                  4       pV'       dp   TpVP                  R4      '       d   Vu # VP                  R4      '       d   VP                  R4      '       d   VR8H  pKo  VP                  R4      '       d   RpK  K  VR8H  pK  	  V# )Tr  [][all]zinclude F)	enumerater  r   endswith)linesin_alllastindexrW  s   &    r   find_insertion_point@DistUpgradeQuirks._add_kms_overlay.<locals>.find_insertion_point  s     FD(/{{} D'>??#--$--2D2D!%44 "'	 5 "W_F  0  Kr    c                    < S! V 4      p W,          P                  R 4      '       d   V #  SWV% V #   \         d     Li ; i)r  )r   
IndexError)r  insert_pointadded_linesr  s   & r   add_kms_overlay;DistUpgradeQuirks._add_kms_overlay.<locals>.add_kms_overlay  sW    /6L&112IJJ L K
 0;E|,L	  s   1 1 ??c              3   2   "   T F  qR ,           x  K  	  R# 5i)r   N r  s   & r   r  5DistUpgradeQuirks._add_kms_overlay.<locals>.<genexpr>  s     ;UTD[[Us   z)no addition of KMS overlay required in %s)z,# added by do-release-upgrade (LP: #2065051)r  zdisable_fw_kms_setup=1r  z[pi3+]dtoverlay=vc4-kms-v3d,cma-128r  z[pi02]r  r  r  )r8   r9   r@  r   r   rn  r$   r   rj  r  r   r  )r   ro  rp  r  r   r  r  rW  r  r~  r  r  s   &&        @@r   rF   "DistUpgradeQuirks._add_kms_overlay  s   3 	
	#%77<<,#G *C'BBaffh C	0		 ,7+A+A+CD+C4+CD&WW;U;;
$OOG02$$%9	Ke CB  	MMG.@	P Es5   6C5  C"C5 5D"C2	-C5 2C5 5#DDc                p   V P                   P                  pRpRpV F'  pWA9   g   K  W,          P                  '       g   K%  Tp M	  Vf   R# \        P                  ! RV4       RV9   dK   VR,          P                  '       g0   \        P                  ! R4       VR,          P                  4        R# R# R# )z
Force installation of dracut over initramfs-tools.

At present this is only used on the Raspberry Pi images. See
LP: #2148475 for further details.
Nz4Raspberry Pi seed detected (%s), switching to dracutdracutzMarking dracut for installationrB   rA   r   r4   r7   r$   r&   r   r   r4   raspi_seedsmeta_pkgrx   s   &    r   re   'DistUpgradeQuirks._force_dracut_install  s     %%EC|
 7 7 7 
 BH	NuU8_%A%A%AMM;<(O((* &Br    c                p   V P                   P                  pRpRpV F'  pWA9   g   K  W,          P                  '       g   K%  Tp M	  Vf   R# \        P                  ! RV4       RV9   dK   VR,          P                  '       g0   \        P                  ! R4       VR,          P                  4        R# R# R# )z`
Force installation of piboot-try over flash-kernel.

This is required in the resolute upgrade.
NzERaspberry Pi seed detected (%s), switching flash-kernel to piboot-tryz
piboot-tryz#Marking piboot-try for installationr  r  r  s   &    r   rd   +DistUpgradeQuirks._force_piboot_try_install  s     %%EC|
 7 7 7 
 "	$ 5 |)<)I)I)IMM?@,,,. *J r    c                   RpV P                   '       d   R# V P                  P                  RR4      R29   d   R# V P                  P                  4       f   \        P
                  ! R4       R# RpV P                  P                  RR4      P                  R4      pR	V9   g   R
V9   d   RpM	RV9   d   Rp\        \        . R3O4      \        V4      ,          4      pV P                  P                  RRV R.\        P                  RR7      pVP                  P                  R4      P                  R4      w  rgpT;'       g    Rp \        V4       \        P
                  ! RV RV RV RV R2	4       V P                  P                  RRV RRV RV R2.4      pVP"                  ^ 8w  d   \        P
                  ! RV RV 24       R# RV n         \$        P&                  P)                  V P                  P+                  4       R4      p	\$        P,                  ! \$        P&                  P/                  V	4      RR7       \0        P2                  ! V	4      P5                  R R!7       \$        P6                  ! V	V P                  P                  4       V P                  P9                  4       4       V'       dz   R"p
\$        P,                  ! \$        P&                  P/                  V
4      RR7       R#p\;        V
R$4      ;_uu_ 4       pVP=                  R%V R&V R'V RV R(V R)24       RRR4       R# R*p\$        P,                  ! \$        P&                  P/                  V4      RR7       \;        VR$4      ;_uu_ 4       pVP=                  R+V R,V RV R-24       RRR4       V P                  P?                  R..4       V P                  P?                  R/\$        P&                  PA                  V4      .4      pVP"                  ^ 8w  d:   \        P
                  ! R0\$        P&                  PA                  V4       R124       R# R#   \          d    Rp ELi ; i  + '       g   i     R# ; i  + '       g   i     L; i)4zDue to changes to the Ubuntu font we enable a generic font
(in practice DejaVu or Noto) during the upgrade.
See https://launchpad.net/bugs/2034986
SansNXDG_SESSION_TYPEr  z3Cannot determine non-root UID, will not change fontzorg.gnome.desktop.interfaceXDG_CURRENT_DESKTOPrQ  MATEUKUIzorg.mate.interface
X-Cinnamonzorg.cinnamon.desktop.interfacez/usr/bin/gsettingsr   z	font-namer~   )r   r   z'
r   Ubuntu11zSetting generic font z& during the upgrade. Original font is .rk   "zFailed to change font to Tz!.config/upgrade-need-font-restorer   i  )modez//etc/xdg/autostart/upgrade-restore-font.desktopz'$HOME/.config/upgrade-need-font-restorer   z[Desktop Entry]
Name=Restore font after upgrade
Comment=Auto-generated by ubuntu-release-upgrader
Type=Application
Exec=sh -c 'if [ -e "z" ]; then gsettings set z font-name "z	";rm -f "z"; fi'
NoDisplay=true
z2/usr/lib/systemd/user/upgrade-restore-font.servicez# Auto-generated by ubuntu-release-upgrader
[Unit]
Description=Restore font after upgrade
After=graphical-session.target dconf.service
ConditionPathExists=%h/.config/upgrade-need-font-restore

[Service]
Type=oneshot
ExecStart=/usr/bin/gsettings set z font-name 'zm'
ExecStart=/usr/bin/rm -f %h/.config/upgrade-need-font-restore

[Install]
WantedBy=graphical-session.target
zdaemon-reloadenablezFailed to enable z%. Font will not be restored on reboot)r  tty)BudgieLXQtr  r  r  XFCE)!r   r   get_user_envget_user_uidr$   r&   rT  boolrk   run_as_userrM   r   r   r   
rpartitionr   r   r  r8   r9   r@  get_user_homer   r   rg  rh  touchchownget_user_gidr   r   systemctl_as_userbasename)r   	temp_fontschemadesktopsuse_autostartr   fontrs   r   need_font_restore_fileautostart_fileflagr   	unit_files   &             r   rW   #DistUpgradeQuirks._set_generic_font  s   
 	   ??''(:B?;N ??'')1MME .??//!2

%* 	
 X8!3)FX%5F HI(m

 OO''!5x+'??	 ( 
 ((..0;;C@$x	I 	-i[$ @337&$qB 	C OO'' %F81YKqa0)
  <<1MM5i[$HI $ "$OO))+/"
 	BGGOO$:;dK+,222>
"OO((*OO((*	
 NNKK7$G<Dnc**a- .2F2Jhl4&$ 8"V $''	 +  I	
BGGOOI.>)S!!QGG4 (-vQtf 566 "& 	))?*;<OO--rww''	23
 <<1MM-bgg.>.>y.I-J K@ @ A a  	D	D +*  "!s*   P? "Q9Q'?QQQ$	'Q7	c                   V P                   P                  P                  p VR,          P                  '       g   R# VR,          P                  pV UUu. uF&  w   r4VP
                  P                  '       g   K$  VNK(  	  ppp\        T4      '       g   \        P                  ! R4       T P                   P                  R,          P                  RR7       \        P                  ! T P                   P                  4      P                  T P                   P                  R,          4       R# R# u uppi   \         d     R# i ; i)ze
Prevent postfix from being unnecessarily installed, and leading to a
debconf prompt (LP: #2060578).
zgpg-wks-serverNzmail-transport-agentzENo mail-transport-agent installed, marking gpg-wks-server for removalFr   )r   r4   _cachecurrent_verprovides_list
parent_pkgr   anyr$   r%   mark_deleter  ProblemResolverprotect)r   r4   provides_mtars   verinstalled_mtas   &     r   r\   .DistUpgradeQuirks._maybe_remove_gpg_wks_server  s    %%,,	)*666 !78FFL%1%1	1>>-- \   =!!LL5
 OO!!"23???O 5 56>>%%&67 "  		s.   D6 D6 !D0;D0D6 0D6 6EEc                :   \         P                  ! 4       pVP                  V P                  P                  4      ;'       g    Rp \
        P                  ! 4       p TP                  4        R#   \         d%   p\        P                  ! RT 24        Rp?R# Rp?ii ; i  \         dp   p\        P                  ! RT 24       T P                  P                  \        RT 24      \        R4      4       T P                  P                  4         Rp?R# Rp?ii ; i)z
With release Ubuntu 25.10 we have raised the ISA profile requirement
on RISC-V to RVA23U64. Prevent systems that don't implement RVA23U64
from upgrading beyond Ubuntu 24.04 LTS.
next releasezRVA23 check: N%Sorry, cannot upgrade this system to zOn Ubuntu 25.10 and later, RISC-V systems are required to support the RVA23U64 profile, but your system does not. Please, see https://discourse.ubuntu.com/t/questing-quokka-release-notes for more information.)distro_infoUbuntuDistroInfor   r   toDistr   read_cpuinfor	   r$   r&   assert_rva23_readyr   r   rs   rt   )r   dir   cpuinfoexs   &    r   r.   )DistUpgradeQuirks._test_and_fail_on_rva23  s     ))+**T__334FF	"//1G	$&&( % 	MMM"./	 % 	$MMM"./JJ;G9E J	
 OO!!##	$s1   A. B  .B9BB D+A$DDc                v   V P                   P                  R8w  d   R# \        4       pVf   \        P                  ! R4       R# V\
        P                  8  d   \        P                  ! R4       R# V P                  P                  \        R4      \        R4      4       V P                   P                  4        R# )z
With release Ubuntu 26.04 we have raised the ISA generation
requirement on s390x to z15. Prevent systems that are below z15
from upgrading beyond Ubuntu 25.10.
s390xNz3s390x generation check: cannot determine generationz2s390x generation check: generation is z15 or newerz5Sorry, cannot upgrade this system to Ubuntu 26.04 LTSzOn Ubuntu 26.04 and later, s390x systems are required to be z15 or newer, but your system is not. Please, see https://discourse.ubuntu.com/t/resolute-raccoon-release-notes for more information.)r   r   r   r$   r&   r
   Z15r   r   rs   rt   )r   
generations   & r   r0   'DistUpgradeQuirks._test_and_fail_on_z13  s     ??7*-H-J
MME ,,,MMD 

G G	
	
 	r    c                l   V P                   P                  R9  d   R# \        P                  ! V4      p \	        VR,          P                  4       P                  R4      P                  R4      4      p\        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   R# RV9   d   RR	rTMR
V9   d   RRrTMR# \        P                  ! V\        P                  R7      p^ RIp TR,          R,          R,          pTP                  RTP                  4       4      ^ ,          p	Y8  d   R#  T P                   P#                  \%        R4      \%        R4      P'                  YeR7      4       T P                   P)                  4        R#   \         d     R# i ; i  \         d     Lyi ; i)z
Ubuntu 26.04 has minimum EEPROM requirements, partly for the "tryboot"
facility of the bootloader (for the Pi 4) and partly for kernel version
7 compatibility (for the Pi 5).

LP: #2130734
LP: #2146383
N
compatible    c              3   B   "   T F  qP                  R 4      x  K  	  R# 5i)s   raspberrypi,N)r   )r  ss   & r   r  DDistUpgradeQuirks._test_and_fail_on_pi_old_eeprom.<locals>.<genexpr>  s     Ij||O44js   TFs   brcm,bcm2711i՞ci.  s   brcm,bcm2712iOgiO  )tzchosen
bootloaderzbuild-timestampz>Iz'Newer Raspberry Pi boot EEPROM requireda\  For Ubuntu 26.04, this Raspberry Pi requires the boot EEPROM to be dated at least {minimum_dt:%c %Z} or later. If you wish to proceed with the upgrade, once this upgrader exits, run "sudo rpi-eeprom-update -a" and reboot. Afterwards, you should be able to proceed with this upgrade. Please see https://launchpad.net/bugs/{bug} for more information.)
minimum_dtbug)armhfarm64)r   r   rg  rh  rk   ri  r  rT  r  r   fromtimestampr   utcrn  structunpackr   r   rs   r   rt   )
r   dt_dirdtr  minimum_builtr   r  r  timestamp_nodebuilts
   &&        r   r1   1DistUpgradeQuirks._test_and_fail_on_pi_old_eeprom	  sy    ??'99
 \\&!	P\!::<ueeElLJ
 3IjI333IjIII*,%/s J.%/s!//(,,OJ 		 8ml:=NNNMM$(A(A(CDQGE % & 	

9 I f
f4	
 	O ! 		& ! 		s#   >F 2>F% F"!F"%F32F3c                6   \         P                  P                  R4      '       d   RV P                  P                  9   d   V P                  P                  R,          P
                  '       d   \        P                  ! R4       \        P                  ! 4       pVP                  V P                  P                  4      ;'       g    RpV P                  P                  \        RV 24      \        R4      4       V P                  P                  4        R# R# R# R# )z
LP: #2065229
z/snap/pc-kernelzubuntu-desktop-minimalzDetected TPM FDE systemr  r  zUpgrades for desktop systems running TPM FDE are not currently supported. Please see https://launchpad.net/bugs/2065229 for more information.N)r8   r9   r:   r   r4   r7   r$   r&   r  r  r   r  r   r   rs   rt   )r   r  r   s   &  r   r3   +DistUpgradeQuirks._test_and_fail_on_tpm_fdeE  s    
 GGNN,--$(=(==OO!!":;HHHMM34--/Bjj!7!78JJNGJJ;G9E ,	
 OO!!#% I > .r    c                ^   RV9  d   R# VR,          pVP                   '       d   \        P                  ! R4       R# VP                  '       d_   \        P                  ! R4       \        P
                  ! RRR7      pVP                  pV^ 8w  d   \        P                  ! RV 24       R# R# R# )	z0Disable kdump-tools if installed during upgrade.zkdump-toolsNz-kdump-tools already installed. Not disabling.z1installing kdump-tools due to upgrade. Disabling.zOecho "kdump-tools kdump-tools/use_kdump boolean false" | debconf-set-selectionsTr   z-kdump-tools debconf-set-selections returned: )r7   r$   r%   rq   rM   r   r  r&   )r   r4   rx   r
  ret_codes   &&   r   rX   1DistUpgradeQuirks._disable_kdump_tools_on_install`  s    %M"LLHILLLM>>0 D H1}&&.Z1   r    c                ^   V P                   P                  R8w  d   R# RV P                   P                  9   du   V P                   P                  R,          P                  '       gF   \        P
                  ! R4       V P                   P                  R,          P                  RR7       R# R# R# )zLP: #2089759 oracularNzlinux-sysctl-defaultsz Installing linux-sysctl-defaultsFr   )r   r   r4   r7   r$   r&   r   r(   s   &r   r]   0DistUpgradeQuirks._install_linux_sysctl_defaults}  s     ??##z1 $t'<'<<%%&=>KKKMM<=OO!!"9:GG H 	 L =r    c                   V P                   P                  pR
pRpV F'  pWA9   g   K  W,          P                  '       g   K%  Tp M	  Vf   R# \        P                  ! RV4       RV9   dI   VR,          P                  '       d0   \        P                  ! R4       VR,          P                  RR7       RV9   dI   VR,          P                  '       g0   \        P                  ! R4       VR,          P                  RR7       W,          P                  '       g0   \        P                  ! R	V4       W,          P                  4        R# R# )z
For Kubuntu and Ubuntu Studio, switch from apport-core-dump-handler
to systemd-coredump. These flavors use DrKonqi for crash handling
which requires systemd-coredump.
Nz7KDE flavor detected (%s), switching to systemd-coredumpzapport-core-dump-handlerz,Marking apport-core-dump-handler for removalFr   zsystemd-coredumpz)Marking systemd-coredump for installationz/Re-marking %s for upgrade after coredump switch)zkubuntu-desktopzubuntustudio-desktop-core)	r   r4   r7   r$   r&   r  r   marked_upgrademark_upgrade)r   r4   kde_flavor_pkgsr  rx   s   &    r   rc   =DistUpgradeQuirks._switch_to_systemd_coredump_for_kde_flavors  s    %%
 "C|
 7 7 7 #
 E	
 '%/,-:::MMHI,-9959I %'()666MMEF$%22E2B ---MMA8 O((*	 .r    c                   \        R4      ;_uu_ 4       pVP                  4       pRRR4       X F1  p VP                  4       P                  4       w  rErgrYe3R8X  g   K0   R# 	  V P                  P                  \        R4      \        R4      4       V P                  P                  4        R#   + '       g   i     L; i  \         d    \
        P                  ! RT R24        K  i ; i)z
Starting in 26.04 LTS, systemd requires cgroupv2 unified hierarchy,
and will refuse to start under other configurations which were
previously allowed.
z/proc/mountsNzcould not parse z from /proc/mounts, ignoringz1Cannot upgrade without unified cgroupv2 hierarchyzBeginning with Ubuntu 26.04 LTS, it is required that the system is booted with a unified cgroupv2 hierarchy, but this system is not.

See https://discourse.ubuntu.com/t/resolute-raccoon-release-notes for more information.)cgroup2z/sys/fs/cgroup)r   	readlinesr   rT  r   r$   r   r   r   rs   r   rt   )
r   r   mountsrW  whatwherefsoptsabs
   &         r   r/   1DistUpgradeQuirks._test_and_fail_without_cgroupv2  s     .!!Q[[]F " D04

0B0B0D-b {;;  	

C )		
 	; "!  &tf,HI 	s   B."C.B>	%C*)C*c                   ^ RI pV P                  P                  R8w  d   R# RV P                  P                  9   d.   V P                  P                  R,          P                  '       g   R#  \
        P                  ! . ROR^\
        P                  R7      pVP                  VP                  P                  R4      4      pX Uu/ uF  pVR
,          VR,          R8H  bK  	  ppVP+                  4        UUu0 uF  w  rhV'       g   K  VkK  	  p	pp0 Rmp
0 Rmp\-        WP/                  4       ,          4      pV
P1                  V	4      '       d    V'       dg   VP1                  V	4      '       gN   \#        R4      p\#        R4      pV P$                  P'                  WE4       V P                  P)                  4        R# R# R#   \        \
        P                  \        TP                  3 df    \        P                   ! R4       \#        R4      p\#        R	4      pT P$                  P'                  YE4       T P                  P)                  4         ELi ; iu upi u uppi )zf
RabbitMQ can only be upgraded to 4.X (the version in resolute) if a set
of feature flags is enabled.
Nresolutezrabbitmq-serverT)r  timeoutr   r~   z&Failed to query RabbitMQ feature flagszUnable to upgrade RabbitMQzThe RabbitMQ feature flags could not be detected.

Please follow the instructions at https://discourse.ubuntu.com/t/77271 to prepare RabbitMQ for the upgrade, then retry.rp   stateenabledzYour RabbitMQ server installation requires manual preparation before it can be upgraded to the newer version.

 Please follow the instructions at https://discourse.ubuntu.com/t/77271 to prepare RabbitMQ for the upgrade, then retry.)z/usr/sbin/rabbitmqctlz--formatterr   list_feature_flags>   restart_streamsstream_filteringstream_update_config_command$stream_sac_coordinator_unblock_group>   mqtt_v5rabbit_mqtt_qos0_queuedelete_ra_cluster_mqtt_node)r   r   r  r4   r7   rM   r   r   r   r   r   r   SubprocessErrorUnicodeDecodeErrorJSONDecodeErrorr$   r   rs   r   r   rt   r   r  keysissubset)r   r   result	raw_flagsr   messager  feature_flagsr)  enabled_flagscore_required_flagsmqtt_required_flagshas_mqtts   &            r   r2   MDistUpgradeQuirks._test_and_fail_rabbitmq_server_installed_and_not_upgradable  s   
 	??!!Z/ !6!66OO!!"34AAA	$^^ !
F 

6==#7#7#@AI( "
! L4=I55! 	 
 "/!4!4!6
!6 D!6 	 



 +.@.@.BBC %--m<<1::=II45G/G JJW.OO!!# JX[ &&  	
 	$ FG45G/G JJW.OO!!#	$"

s&   -AF? I7II?BII)	r   r   r   r   r   r   r   r   r   N)z/boot/firmware)z/proc/device-tree)3__name__
__module____qualname____firstlineno____doc__r   r)   r>   rG   rQ   rY   r_   rf   r5   r6   r^   r'   rL   rU   rV   r   rT   r;   r<   rC   r  r%  rb   r/  r6  rM  r   rE   r  rD   rF   re   rd   rW   r\   r.   r0   r1   r3   rX   r]   rc   r/   r2   __static_attributes____classdictcell__)__classdict__s   @r   r   r   '   s    *
&'!2F(.<"4 
.%-(^0
d<;";BF	OF$P&*P"LH= .`:&	G&4,lrh+&ZE"#KJFKP+2/2EAN!F!$F" H: x$6: 1+f# JV$ V$r    r   )r  r   r  r   r$   r8   rm   rM   rg  r   r   r   r   DistUpgradeGettextr   rs   r   r	   r
   r   objectr   r  r    r   <module>rJ     s?   ,      	 	   " ' , ? KT$ T$r    