mirror of
				https://git.launchpad.net/livecd-rootfs
				synced 2025-11-04 02:44:07 +00:00 
			
		
		
		
	fix: Fix calls to unminimize if lxd-installer package not present (LP: #2049723)
				
					
				
			The unminimize script will try to install the lxd snap using the shim script `/usr/sbin/lxd` from the lxd-installer package. Previously `unminimize` was using `snap` to install `lxd` directly which was being diverted by diverting the `snap` command. This is no longer the case so we can remove `/usr/sbin/lxd` from the lxd-installer package if it exists and then redirect any calls to `/usr/sbin/lxd` to `/bin/true` This is a cherry pick forward port from Jammy livecd-rootfs version 2.765.37. (cherry picked from commit 8b83212372e0c1adb1dbdf7ead234f93c52a189e)
This commit is contained in:
		
							parent
							
								
									471f45101e
								
							
						
					
					
						commit
						e1ab57301f
					
				
							
								
								
									
										7
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,10 @@
 | 
				
			|||||||
 | 
					livecd-rootfs (24.04.20) noble; urgency=medium
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  * fix: Fix for calling unminimize if lxd-installer package
 | 
				
			||||||
 | 
					    not installed. (LP: #2049723)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 -- Philip Roche <phil.roche@canonical.com>  Mon, 22 Jan 2024 13:26:43 +0000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
livecd-rootfs (24.04.19) noble; urgency=medium
 | 
					livecd-rootfs (24.04.19) noble; urgency=medium
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  * live-build/auto/config: don't repeatedly add the same pass name to the
 | 
					  * live-build/auto/config: don't repeatedly add the same pass name to the
 | 
				
			||||||
 | 
				
			|||||||
@ -10,14 +10,30 @@ case ${PASS} in
 | 
				
			|||||||
        ;;
 | 
					        ;;
 | 
				
			||||||
esac
 | 
					esac
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# The unminimize script will try to install the lxd snap. We can't
 | 
					# The unminimize script will try to install the lxd snap using the shim script
 | 
				
			||||||
# do that at this stage so just neuter the snap command (the snap
 | 
					# /usr/sbin/lxd from the lxd-installer package.
 | 
				
			||||||
 | 
					# We can't do that at this stage so just neuter the lxd command (the snap
 | 
				
			||||||
# will get properly seeded by generic machinery).
 | 
					# will get properly seeded by generic machinery).
 | 
				
			||||||
dpkg-divert --add --divert /usr/bin/snap.REAL --rename /usr/bin/snap
 | 
					if [ -f "/usr/sbin/lxd" ]; then
 | 
				
			||||||
ln -s /bin/true /usr/bin/snap
 | 
					    dpkg-divert --add --divert /usr/sbin/lxd.REAL --rename /usr/sbin/lxd
 | 
				
			||||||
yes | /usr/local/sbin/unminimize
 | 
					    ln -s /bin/true /usr/sbin/lxd
 | 
				
			||||||
rm /usr/bin/snap
 | 
					    yes | /usr/local/sbin/unminimize
 | 
				
			||||||
dpkg-divert --remove --rename /usr/bin/snap
 | 
					    # unminimize also uninstalls lxd-installer package
 | 
				
			||||||
 | 
					    # and also removed `/usr/sbin/lxd` as a result, so we don't need to restore, but
 | 
				
			||||||
 | 
					    # we do need to remove the mock we used as part of dpkg-divert
 | 
				
			||||||
 | 
					    # first we need to remove the diversion
 | 
				
			||||||
 | 
					    dpkg-divert --remove --no-rename /usr/sbin/lxd
 | 
				
			||||||
 | 
					    # now remove the renamed file that we originally diverted to
 | 
				
			||||||
 | 
					    rm -v /usr/sbin/lxd.REAL
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					    # if /usr/sbin/lxd doesn't exist then lxd-installer package isn't installed.
 | 
				
			||||||
 | 
					    # Instead, we can mock the command to avoid the unminimize script failing
 | 
				
			||||||
 | 
					    ln -s /bin/true /usr/sbin/lxd
 | 
				
			||||||
 | 
					    yes | /usr/local/sbin/unminimize
 | 
				
			||||||
 | 
					    # as the lxd-installer package was not installed and thus not removed by `unminimize`
 | 
				
			||||||
 | 
					    # the mock /usr/sbin/lxd will still be present, so we need to remove it
 | 
				
			||||||
 | 
					    rm -v /usr/sbin/lxd
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Fix up missing recommends.  Other non-layered flavors handle this in
 | 
					# Fix up missing recommends.  Other non-layered flavors handle this in
 | 
				
			||||||
# live-build/auto/build, but we need to do it here.  Also, there are
 | 
					# live-build/auto/build, but we need to do it here.  Also, there are
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user