summaryrefslogtreecommitdiffstats
path: root/draklive
diff options
context:
space:
mode:
Diffstat (limited to 'draklive')
-rwxr-xr-xdraklive15
1 files changed, 13 insertions, 2 deletions
diff --git a/draklive b/draklive
index 0e1c55a..97e5f05 100755
--- a/draklive
+++ b/draklive
@@ -914,8 +914,19 @@ sub record_cdrom_path {
my ($live, $path, $opts) = @_;
my $device = get_media_device($live, $opts)
or die "no device defined in media configuration\n";
- my $src = $opts->{onthefly} ? '-' : $path;
- run_('wodim', '-v', 'dev=' . $device, $src);
+
+ #- CD-Rom images can be hybrid, thus handle recording on both CD-Rom and disks
+ my $_device = basename(expand_symlinks($device));
+ my $sysfs_device = "/sys/block/$_device/capability";
+ #- GENHD_FL_CD is 8 (include/linux/genhd.h)
+ my $is_cdrom = !-e $sysfs_device || hex(cat_($sysfs_device)) & 8;
+
+ if ($is_cdrom) {
+ my $src = $opts->{onthefly} ? '-' : $path;
+ run_('wodim', '-v', 'dev=' . $device, $src);
+ } else {
+ run_('dd', if_(!$opts->{onthefly}, "if=$path"), "of=$device", "bs=2M");
+ }
}
sub record_cdrom_master {