mirror of
https://github.com/webmin/webmin.git
synced 2025-08-16 14:51:18 +00:00
Support SD / MMC disks http://sourceforge.net/p/webadmin/bugs/4334/
This commit is contained in:
@ -28,3 +28,5 @@ Added support for creating EXT4 filesystems.
|
||||
SATA devices using SCSI emulution now show up with SATA as the description.
|
||||
---- Changes since 1.550 ----
|
||||
Added support for using parted to manage disks if installed, which also supports the new GPT partition table format which is needed on disks larger than 2T.
|
||||
---- Changes since 1.660 ----
|
||||
Added support for SD card filesystems, as seen on the Raspberry PI and other small devices.
|
||||
|
@ -198,6 +198,10 @@ if (open(PARTS, "/proc/partitions")) {
|
||||
# PV disk from Xen
|
||||
push(@devs, "/dev/$1");
|
||||
}
|
||||
elsif (/\d+\s+\d+\s+\d+\s+(mmcblk\d+)\s/) {
|
||||
# SD card / MMC, seen on Raspberry Pi
|
||||
push(@devs, "/dev/$1");
|
||||
}
|
||||
}
|
||||
close(PARTS);
|
||||
|
||||
@ -294,6 +298,11 @@ while(<FDISK>) {
|
||||
$disk->{'desc'} = &text('select_device', 'Xen', uc($1));
|
||||
$disk->{'type'} = 'ide';
|
||||
}
|
||||
elsif ($disk->{'device'} =~ /\/mmcblk([0-9]+)$/) {
|
||||
# SD-card / MMC
|
||||
$disk->{'desc'} = &text('select_device', 'SD-Card', $1);
|
||||
$disk->{'type'} = 'ide';
|
||||
}
|
||||
elsif ($disk->{'device'} =~ /\/vd([a-z]+)$/) {
|
||||
# KVM virtual disk
|
||||
$disk->{'desc'} = &text('select_device',
|
||||
@ -580,7 +589,7 @@ return @disks;
|
||||
}
|
||||
|
||||
# partition_description(device)
|
||||
# Converts a device path like /dev/hda into a human-readable name
|
||||
# Converts a device path like /dev/hda1 into a human-readable name
|
||||
sub partition_description
|
||||
{
|
||||
my ($device) = @_;
|
||||
@ -588,6 +597,8 @@ return $device =~ /(s|h|xv|v)d([a-z]+)(\d+)$/ ?
|
||||
&text('select_part', $1 eq 's' ? 'SCSI' :
|
||||
$1 eq 'xv' ? 'Xen' :
|
||||
$1 eq 'v' ? 'VirtIO' : 'IDE', uc($2), "$3") :
|
||||
$device =~ /mmcblk(\d+)p(\d+)$/ ?
|
||||
&text('select_part', 'SD-Card', "$1", "$2") :
|
||||
$device =~ /scsi\/host(\d+)\/bus(\d+)\/target(\d+)\/lun(\d+)\/part(\d+)/ ?
|
||||
&text('select_spart', "$1", "$2", "$3", "$4", "$5") :
|
||||
$device =~ /ide\/host(\d+)\/bus(\d+)\/target(\d+)\/lun(\d+)\/part(\d+)/ ?
|
||||
|
@ -2406,6 +2406,10 @@ return $_[0] =~ /^\/dev\/(s|h|xv|v)d([a-z]+)(\d+)$/ ?
|
||||
&text('select_device', $1 eq 's' ? 'SCSI' : $1 eq 'xv' ? 'Xen' :
|
||||
$1 eq 'v' ? 'VirtIO' : 'IDE',
|
||||
uc($2)) :
|
||||
$_[0] =~ /^\/dev\/mmcblk(\d+)p(\d+)$/ ?
|
||||
&text('select_part', "SD-Card", "$1", "$2") :
|
||||
$_[0] =~ /^\/dev\/mmcblk(\d+)$/ ?
|
||||
&text('select_device', "SD-Card", "$1") :
|
||||
$_[0] =~ /rd\/c(\d+)d(\d+)p(\d+)$/ ?
|
||||
&text('select_mpart', "$1", "$2", "$3") :
|
||||
$_[0] =~ /ida\/c(\d+)d(\d+)p(\d+)$/ ?
|
||||
|
Reference in New Issue
Block a user