# HG changeset patch # User Robert McIntyre # Date 1422593312 28800 # Node ID 75db8d48c313e67b21399df71528befa2deaa850 # Parent 9fd4948b43035b3defcaf884c04c83cb2c870bce rename. diff -r 9fd4948b4303 -r 75db8d48c313 backup-luks-headers.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backup-luks-headers.pl Thu Jan 29 20:48:32 2015 -0800 @@ -0,0 +1,19 @@ +#!/bin/perl + + + +sub backup { + my $uuid = shift; + my @command = + ("cryptsetup", "luksHeaderBackup", "--header-backup-file", + "./$uuid.luksHeader", "/dev/disk/by-uuid/$uuid"); + print("@command\n"); + system(@command); +} + +# TODO -- find all luks drives and do this automatically. + +&backup("fd14a1d5-ece0-43c4-a3c5-eb93af261cb5"); +&backup("23d75d33-611b-424b-810a-099aef0bdd57"); +&backup("8543575b-25cc-4132-88ef-39af98f646ae"); +&backup("da9b2d38-bb64-459f-b1c8-480b790a2a50"); diff -r 9fd4948b4303 -r 75db8d48c313 cd-burn.pl --- a/cd-burn.pl Thu Jan 29 20:47:48 2015 -0800 +++ b/cd-burn.pl Thu Jan 29 20:48:32 2015 -0800 @@ -23,10 +23,7 @@ @burn_command = ("cdrecord", "gracetime=3", "-v", "tsize=".$size."s", "-data", "-"); -@aes_loop_command = ("aespipe", "-P", "/etc/cd-key", "-e", "aes256"); - - -$final_command = "mkisofs @mkisofs_args | @aes_loop_command | @burn_command"; +$final_command = "mkisofs @mkisofs_args | @burn_command"; print "$final_command\n"; system($final_command); diff -r 9fd4948b4303 -r 75db8d48c313 cd-crypt-burn.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cd-crypt-burn.pl Thu Jan 29 20:48:32 2015 -0800 @@ -0,0 +1,33 @@ +#!/bin/perl + +use File::Basename; + +$tmp_iso="/home/r/tmp/image.iso"; + +@graft_points = ("-graft-points"); + +for $graft_point(@ARGV){ + push(@graft_points, '"'. basename($graft_point) .'"' . "=" + . '"'. $graft_point . '"'); +} + +@mkisofs_args = ("-iso-level", "4", "-r", "-quiet"); + +@mkisofs_args = (@mkisofs_args, @graft_points); + + +# get size of stuff +$size = `mkisofs -print-size @mkisofs_args 2>/dev/null`; +chomp($size); + +@burn_command = ("cdrecord", "gracetime=3", "-v", + "tsize=".$size."s", "-data", "-"); + +@aes_loop_command = ("aespipe", "-P", "/etc/cd-key", "-e", "aes256"); + + +$final_command = "mkisofs @mkisofs_args | @aes_loop_command | @burn_command"; + +print "$final_command\n"; +system($final_command); + diff -r 9fd4948b4303 -r 75db8d48c313 cd-simple-burn.pl --- a/cd-simple-burn.pl Thu Jan 29 20:47:48 2015 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -#!/bin/perl - -use File::Basename; - -$tmp_iso="/home/r/tmp/image.iso"; - -@graft_points = ("-graft-points"); - -for $graft_point(@ARGV){ - push(@graft_points, '"'. basename($graft_point) .'"' . "=" - . '"'. $graft_point . '"'); -} - -@mkisofs_args = ("-iso-level", "4", "-r", "-quiet"); - -@mkisofs_args = (@mkisofs_args, @graft_points); - - -# get size of stuff -$size = `mkisofs -print-size @mkisofs_args 2>/dev/null`; -chomp($size); - -@burn_command = ("cdrecord", "gracetime=3", "-v", - "tsize=".$size."s", "-data", "-"); - -$final_command = "mkisofs @mkisofs_args | @burn_command"; - -print "$final_command\n"; -system($final_command); - diff -r 9fd4948b4303 -r 75db8d48c313 luks-headers-backup.pl --- a/luks-headers-backup.pl Thu Jan 29 20:47:48 2015 -0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#!/bin/perl - - - -sub backup { - my $uuid = shift; - my @command = - ("cryptsetup", "luksHeaderBackup", "--header-backup-file", - "./$uuid.luksHeader", "/dev/disk/by-uuid/$uuid"); - print("@command\n"); - system(@command); -} - -# TODO -- find all luks drives and do this automatically. - -&backup("fd14a1d5-ece0-43c4-a3c5-eb93af261cb5"); -&backup("23d75d33-611b-424b-810a-099aef0bdd57"); -&backup("8543575b-25cc-4132-88ef-39af98f646ae"); -&backup("da9b2d38-bb64-459f-b1c8-480b790a2a50");