From 55e95b16db458b7f9abeca96e541acbdf8d7f85b Mon Sep 17 00:00:00 2001 From: rtm Date: Mon, 12 Jun 2006 15:22:12 +0000 Subject: import --- sign.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 sign.pl (limited to 'sign.pl') diff --git a/sign.pl b/sign.pl new file mode 100755 index 0000000..d84bdc6 --- /dev/null +++ b/sign.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl + +open(SIG, $ARGV[0]) || die "open $ARGV[0]: $!"; + +$n = sysread(SIG, $buf, 1000); + +if($n > 510){ + print STDERR "boot block too large: $n bytes (max 510)\n"; + exit 1; +} + +print STDERR "boot block is $n bytes (max 510)\n"; + +$buf .= "\0" x (510-$n); +$buf .= "\x55\xAA"; + +open(SIG, ">$ARGV[0]") || die "open >$ARGV[0]: $!"; +print SIG $buf; +close SIG; -- cgit v1.2.3