Signed-off-by: Ted Hess <thess@kitschensync.net>
use warnings;
use Getopt::Long qw(:config no_ignore_case);
use warnings;
use Getopt::Long qw(:config no_ignore_case);
+use File::Temp qw(tempfile);
my($debug) = 0;
my($quiet) = 0;
my($debug) = 0;
my($quiet) = 0;
# don't touch RedBoot and SysConf anyway. If no Trailer is specified,
# put in one.
if (not defined $redboot and not -e "RedBoot") {
# don't touch RedBoot and SysConf anyway. If no Trailer is specified,
# put in one.
if (not defined $redboot and not -e "RedBoot") {
open TMP, ">$redboot" or die "Cannot open file $redboot: $!";
push @cleanup, $redboot;
# The RedBoot partition is 256 * 1024 = 262144; the trailer we add
open TMP, ">$redboot" or die "Cannot open file $redboot: $!";
push @cleanup, $redboot;
# The RedBoot partition is 256 * 1024 = 262144; the trailer we add
close TMP;
}
if (not defined $sysconf and not -e "SysConf") {
close TMP;
}
if (not defined $sysconf and not -e "SysConf") {
open TMP, ">$sysconf" or die "Cannot open file $sysconf: $!";
push @cleanup, $sysconf;
# The SysConf partition is 128 * 1024 = 131072
open TMP, ">$sysconf" or die "Cannot open file $sysconf: $!";
push @cleanup, $sysconf;
# The SysConf partition is 128 * 1024 = 131072
close TMP;
}
if (not defined $trailer and not -e "Trailer") {
close TMP;
}
if (not defined $trailer and not -e "Trailer") {
open TMP, ">$trailer" or die "Cannot open file $trailer: $!";
push @cleanup, $trailer;
for my $i (@sercomm_flash_trailer) {
open TMP, ">$trailer" or die "Cannot open file $trailer: $!";
push @cleanup, $trailer;
for my $i (@sercomm_flash_trailer) {