This commit is contained in:
Jamie Cameron
2013-12-18 15:10:41 -08:00
parent 0453ccb044
commit 40c6bfb40f
3 changed files with 18 additions and 1 deletions

View File

@ -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.

View File

@ -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+)/ ?

View File

@ -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+)$/ ?