added base src
[xv6-db.git] / sign.pl
blobd793035c8d6d6c25d947431a398cd40cc67c8afb
1 #!/usr/bin/perl
3 open(SIG, $ARGV[0]) || die "open $ARGV[0]: $!";
5 $n = sysread(SIG, $buf, 1000);
7 if($n > 510){
8 print STDERR "boot block too large: $n bytes (max 510)\n";
9 exit 1;
12 print STDERR "boot block is $n bytes (max 510)\n";
14 $buf .= "\0" x (510-$n);
15 $buf .= "\x55\xAA";
17 open(SIG, ">$ARGV[0]") || die "open >$ARGV[0]: $!";
18 print SIG $buf;
19 close SIG;