-END
-;
+ # Grab the known partitions of the current block device.
+ my @partitions = &get_device_partitions($device);
+
+ foreach my $partition (@partitions) {
+ my $disabled;
+
+ # Omit the partition size.
+ my $bsize = &get_device_size($partition);
+
+ # Convert into human-readable format.
+ my $size = &General::formatBytes($bsize);
+
+ # Get the mountpoint.
+ my $mountpoint = $mountpoints{$partition};
+
+ if ($mountpoint eq "/" or $mountpoint =~ "^/boot") {
+ $disabled = "disabled";
+ } elsif(&is_mounted($mountpoint)) {
+ $disabled = "disabled";
}
- }
- foreach $partitionentry (sort @partitions)
- {
- @partitionline = split( /\;/, $partitionentry );
- if (( "$partitionline[0]" =~ /^$scanline[0]/ ) && !( "$partitionline[2]" eq "" )) {
- $size = int($partitionline[1] / 1024);
- print <
-
UUID=$partitionline[2]
-
-
/dev/$partitionline[0]
-
$Lang::tr{'size'} $size MB
-
-
+ # Omit the used filesystem.
+ my $fs = $filesystems{$partition};
+
+ # Check if the device is used as swap.
+ if (&is_swap($partition)) {
+ $disabled = "disabled";
+ $mountpoint = "swap";
+ }
+
+ print <
+