Skip to content
Snippets Groups Projects
Commit ffe3e5e8 authored by Tails developers's avatar Tails developers
Browse files

Import feature/sdio at commit 2737545b, as a quilt patch.

parent f1055dbd
Branches
Tags
No related merge requests found
diff --git a/lib/Tails/Persistence/Setup.pm b/lib/Tails/Persistence/Setup.pm
index 4f67db9..c946672 100644
--- a/lib/Tails/Persistence/Setup.pm
+++ b/lib/Tails/Persistence/Setup.pm
@@ -31,6 +31,7 @@ use Net::DBus qw(:typing);
use Net::DBus::GLib;
use Net::DBus::Annotation qw(:call);
use List::Util qw{first max};
+use List::MoreUtils qw{any};
use Number::Format qw(:subs);
use Path::Class;
use Tails::Persistence::Utils qw{align_up_at_2MiB align_down_at_2MiB step_name_to_class_name get_variable_from_file};
@@ -480,9 +481,9 @@ sub check_sanity {
my @checks = (
{
- method => 'device_is_usb',
+ method => 'device_is_connected_via_a_supported_interface',
message => $self->encoding->decode(gettext(
- "Tails is running from non-USB device %s.")),
+ "Tails is running from non-USB / non-SDIO device %s.")),
needs_device_arg => 1,
},
{
@@ -571,11 +572,13 @@ sub get_device_property {
->Get('org.freedesktop.DBus.Properties', $property);
}
-sub device_is_usb {
+sub device_is_connected_via_a_supported_interface {
my $self = shift;
my $device = shift;
- 'usb' eq $self->get_device_property($device, 'DriveConnectionInterface');
+ my $iface = $self->get_device_property($device, 'DriveConnectionInterface');
+
+ any { $_ eq $iface } (qw{sdio usb});
}
sub device_is_optical {
@@ -644,8 +647,16 @@ sub partitions {
my $device = shift;
$device ||= $self->device;
+ my $partition_re;
+ if ($device =~ m{mmcblk [0-9]+ \z}xms) {
+ $partition_re = qr{\A$device[p][0-9]+\z};
+ }
+ else {
+ $partition_re = qr{\A$device[0-9]+\z};
+ }
+
grep {
- $_ =~ m{\A $device [0-9]+ \z}xms
+ $_ =~ m{$partition_re}xms
} @{$self->udisks_object->EnumerateDevices()};
}
feature-sdio.1-git2737545.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment