Permalink
Browse files

allow specifying a alternate name for the hookscript

  • Loading branch information...
1 parent 578cd54 commit 4d2713d919b3f41cff1a447b0cb0a23b6a7a697c @falconindy committed May 6, 2011
Showing with 12 additions and 5 deletions.
  1. +4 −3 README.pod
  2. +8 −2 geninit.api
View
@@ -187,10 +187,11 @@ specified, the permissions of the FIFO will be 644.
Add a symlink to the image, located at the absolute path specified by link,
and pointing to the path specified by target.
-=item B<use_hookscript>
+=item B<use_hookscript> [I<script>]
-Indicate that geninit should look to include, on the image, a script by the
-same name as the builder, to be run during bootstrap.
+Indicate that geninit should a script by the to be run during bootstrap.
+Unless specified, geninit will look for a script by the same name as the
+builder.
=back
View
@@ -176,9 +176,15 @@ add_pipe() { # {{{
use_hookscript() { # {{{
# specifies that a builder should install a hookscript
# "$builder" comes from the builder parsing loop in main
+ # $1: script name (optional, defaults to the name of the builder)
+ local script=${1:-$builder}
- [[ $builder ]] || return 1
- __add_file "$basedir$_sharedir/hooks/$builder" "/hooks/$builder" 755
+ if [[ ! -f $basedir$_sharedir/hooks/$script ]]; then
+ error "unable to find hook script: $script"
+ return 1
+ fi
+
+ __add_file "$basedir$_sharedir/hooks/$script" "/hooks/$script" 755
} # }}}
add_driver_classes() { # {{{

0 comments on commit 4d2713d

Please sign in to comment.