Skip to content

Commit

Permalink
Merge 5a3ea09 into 7609b64
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Dec 18, 2018
2 parents 7609b64 + 5a3ea09 commit 4d2ca88
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package/yast2-storage-ng.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Dec 18 12:43:21 CET 2018 - schubi@suse.de

- Do not touch eMMC boot partitions (mmcblk*boot*) (bsc#1119316)
- 4.1.43

-------------------------------------------------------------------
Tue Dec 18 12:02:57 CET 2018 - aschnell@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-storage-ng.spec
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-storage-ng
Version: 4.1.42
Version: 4.1.43
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
11 changes: 11 additions & 0 deletions src/lib/y2storage/disk.rb
Expand Up @@ -92,5 +92,16 @@ def preferred_ptable_type
def types_for_is
super << :disk
end

# Whether this device can be in general treated like a disk for YaST
# purposes
#
# @see Devicegraph::disk_devices
#
# @return [Boolean]
def disk_device?
# Filter out all eMMC boot partitions (mmcblk*boot*)
basename =~ /mmcblk\d+boot\d+/ ? false : super
end
end
end
45 changes: 45 additions & 0 deletions test/data/devicegraphs/eMMC_boot_partitions.yml
@@ -0,0 +1,45 @@
# 2018-12-12 16:41:55 -0500
---
- disk:
name: "/dev/mmcblk0"
size: 14080 MiB (13.75 GiB)
block_size: 0.5 KiB
io_size: 0 B
min_grain: 1 MiB
align_ofs: 0 B
partition_table: gpt
partitions:
- free:
size: 1 MiB
start: 0 B
- partition:
size: 255 MiB
start: 1 MiB
name: "/dev/mmcblk0p1"
type: primary
id: esp
file_system: vfat
- partition:
size: 14155759 KiB (13.50 GiB)
start: 256 MiB
name: "/dev/mmcblk0p2"
type: primary
id: linux
file_system: ext4
- free:
size: 17 KiB
start: 14417903 KiB (13.75 GiB)
- disk:
name: "/dev/mmcblk0boot0"
size: 16 MiB
block_size: 0.5 KiB
io_size: 0 B
min_grain: 1 MiB
align_ofs: 0 B
- disk:
name: "/dev/mmcblk0boot1"
size: 16 MiB
block_size: 0.5 KiB
io_size: 0 B
min_grain: 1 MiB
align_ofs: 0 B
9 changes: 9 additions & 0 deletions test/y2storage/disk_test.rb
Expand Up @@ -366,6 +366,15 @@
expect(disk.is?("disk_device")).to eq true
end
end

context "when the disk is an eMMC boot partitions" do
let(:scenario) { "eMMC_boot_partitions" }
let(:disk_name) { "/dev/mmcblk0boot0" }

it "returns false for values whose symbol is :disk_device" do
expect(disk.is?(:disk_device)).to eq false
end
end
end

describe "#usb?" do
Expand Down

0 comments on commit 4d2ca88

Please sign in to comment.