lp:~c-lobrano/snappy/hw-assign-fix-overwrite-udev-rule
- Get this branch:
- bzr branch lp:~c-lobrano/snappy/hw-assign-fix-overwrite-udev-rule
Branch merges
- John Lenton (community): Approve
-
Diff: 159 lines (+87/-9)3 files modified.bzrignore (+3/-0)
snappy/hwaccess.go (+71/-9)
snappy/hwaccess_test.go (+13/-0)
Related bugs
Bug #1497299: hw-assign overwrites existing udev rules | Critical | Fix Released |
Related blueprints
Branch information
Recent revisions
- 717. By Carlo Lobrano
-
Optimized addUdevRuleForSnap method
Remove call to os.OpenFile and use ioutil.ReadFile directly
to check for the udev rule file existence. - 716. By Carlo Lobrano
-
Changes according to John Lenton (Chipaca)'s code review
- Fix creation of the new udev rule file for snap
- Fix coding rules violations - 713. By Carlo Lobrano
-
Update hw-unassign according to changes for fix Bug #1497299
hw-unassign just delete the snap's udev rule file, even when more than one
rule is present. Due to Bug #1497299 udev rule file could not contain
more than one rule at a time, so the problem has never pop out.Fix the above problem adding UpdateUdevRuleF
orSnapp function that: - acquire the list of the Udev rules to keep, namely not related to the to-be-unassigned device node
- delete the current snap's udev rule file
- create a new snap's udev rule file with the rules at the first point - 712. By Carlo Lobrano
-
Fix for Bug #1497299
Open the Snap's udev rule in append mode, in place of writing a new file each time hw-assign is called.
Note: hw-unassign deletes the entire snap's udev rule file when called.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:~snappy-dev/snappy/snappy-moved-to-github