dupdisc 630 B

1234567891011121314151617181920212223
  1. #!/bin/rc
  2. # dupdisc indev outdev - duplicate all blu-ray disc data tracks
  3. rfork ne
  4. if (! ~ $#* 2 || ~ $1 $2 || ~ $1 /dev/* || ~ $2 /dev/*) {
  5. echo usage: $0 indev outdev >[1=2]
  6. exit usage
  7. }
  8. echo copying /dev/$1 tracks to /dev/$2
  9. sleep 2
  10. umount /mnt/cd >[2]/dev/null
  11. cdfs -d /dev/$1 || exit
  12. cdfs -d /dev/$2 -m /n/copy || exit
  13. for (t in `{ls -p /mnt/cd | grep '^d'}) {
  14. echo $t:
  15. grep next /n/copy/ctl
  16. pump -b 81920 -k 51200 </mnt/cd/$t >/n/copy/wd/$t
  17. ls -l /n/copy
  18. }
  19. echo 'remember to *not* rm /mnt/cd/wd' >[1=2]
  20. # don't remove /mnt/cd/wd, since that would finalize the disc
  21. # and bugger the permanent toc, at least on bd-r.