Skip to content

Commit

Permalink
[contrib] Fix rom-o-matic git version number issues
Browse files Browse the repository at this point in the history
Fixes issue in which git version number is not displayed on startup
when iPXE is built through rom-o-matic.

Remove special characters from filename generated by rom-o-matic (so
that you get "ipxe-1.0.0+c3b4-undionly.kkpxe" instead of
"ipxe-1.0.0+ (c3b4)-undionly.kkpxe")

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
maxnet authored and mcb30 committed Jul 23, 2012
1 parent def7f57 commit ee36363
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contrib/rom-o-matic/build.php
Expand Up @@ -179,7 +179,12 @@ function rm_build_dir ()

// Make the requested image. $status is set to 0 on success
$make_target = "bin/${nic}.${fmt_extension}";
$make_cmd = "make -C '$build_dir' '$make_target' $emb_script_cmd 2>&1";
$gitversion = exec('git describe --always --abbrev=1 --match "" 2>/dev/null');
if ($gitversion) {
$gitversion = "GITVERSION=$gitversion";
}

$make_cmd = "make -C '$build_dir' '$make_target' $gitversion $emb_script_cmd 2>&1";

exec ( $make_cmd, $maketxt, $status );

Expand Down Expand Up @@ -239,7 +244,7 @@ function rm_build_dir ()
// Delete build directory as soon as it is not needed
rm_build_dir ();

$output_filename = "ipxe-${version}-${nic}.${fmt_extension}";
$output_filename = preg_replace('/[^a-z0-9\+\.\-]/i', '', "ipxe-${version}-${nic}.${fmt_extension}");

// Try to force IE to handle downloading right.
Header ( "Cache-control: private");
Expand Down

0 comments on commit ee36363

Please sign in to comment.