Merge lp:~cyphermox/usb-creator/squashfs-places into lp:usb-creator

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 471
Merged at revision: 471
Proposed branch: lp:~cyphermox/usb-creator/squashfs-places
Merge into: lp:usb-creator
Diff against target: 51 lines (+17/-0)
2 files modified
debian/changelog (+6/-0)
usbcreator/install.py (+11/-0)
To merge this branch: bzr merge lp:~cyphermox/usb-creator/squashfs-places
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
Review via email: mp+257829@code.launchpad.net

Description of the change

Handle the squashfs locations: erase any "old" locations which would interfere with the image we're trying to copy to disk.

To post a comment you must log in.
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Self-approving... :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-04-23 15:19:07 +0000
3+++ debian/changelog 2015-04-29 21:36:09 +0000
4@@ -11,6 +11,12 @@
5 proper polkit integration for KVM use.
6 - CVE number pending
7
8+ [ Mathieu Trudel-Lapierre ]
9+ * usbcreator/install.py: remove the directories known to normally contain
10+ a squashfs; since it could be confusing the installer if, for example, a
11+ squashfs from desktop is still under casper/ after copying server files
12+ to a USB key. (LP: #1117292)
13+
14 -- Marc Deslauriers <marc.deslauriers@ubuntu.com> Thu, 23 Apr 2015 11:18:01 -0400
15
16 usb-creator (0.2.67) vivid; urgency=medium
17
18=== modified file 'usbcreator/install.py'
19--- usbcreator/install.py 2015-03-10 15:24:32 +0000
20+++ usbcreator/install.py 2015-04-29 21:36:09 +0000
21@@ -185,6 +185,15 @@
22 self.progress_thread.start()
23 self.check()
24
25+ def remove_squashfs(self):
26+ logging.debug('remove_squashfs')
27+ '''Remove squashfs files which may conflict.'''
28+ squashfs_places = [ "install", "casper", "live" ]
29+ for place in squashfs_places:
30+ squashfs_place = os.path.join(self.target, place)
31+ if os.path.exists(squashfs_place):
32+ shutil.rmtree(squashfs_place)
33+
34 def remove_extras(self):
35 logging.debug('remove_extras')
36 '''Remove files created by usb-creator.'''
37@@ -499,6 +508,7 @@
38 logging.debug('Removing %s' % t)
39 shutil.rmtree(t)
40 self.check()
41+ self.remove_squashfs()
42 self.remove_extras()
43
44 self.initialize_progress_thread()
45@@ -617,6 +627,7 @@
46 elif os.path.isdir(f):
47 logging.debug('Removing %s' % f)
48 shutil.rmtree(f)
49+ self.remove_squashfs()
50 self.remove_extras()
51 self.check()
52

Subscribers

People subscribed via source and target branches