From e4918ab0787fe9cbcde4db579d2666f3d6b7ca5e Mon Sep 17 00:00:00 2001 From: Mikko Ylinen Date: Fri, 31 Jan 2014 13:25:25 +0200 Subject: [PATCH] setup-gummiboot-conf: add splash file support The latest gummiboot supports splash image loading. Each loader entry can specify the splash image to load using 'splash' parameter. Add a new option to the script to enable callers to generate splash enabled entries. Change-Id: I5c2d997aad869455c9fec9695e5b3664525a89bd Signed-off-by: Mikko Ylinen --- setup-gummiboot-conf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/setup-gummiboot-conf b/setup-gummiboot-conf index 1fac081..4a84039 100755 --- a/setup-gummiboot-conf +++ b/setup-gummiboot-conf @@ -101,6 +101,9 @@ Options: -f, --force if the entry already exists - re-write it, if /loader/loader.conf does not exist - create one, if / does not exist - do not fail + -s, --splash + add a splash field to the entry file. is a + mandatory parameter to specify splash image location. -h, --help show this text and exit EOF } @@ -120,16 +123,20 @@ add_subcommand() fi local tmp - tmp=`getopt -n $PROG -o f,h --long force,help -- "$@"` || + tmp=`getopt -n $PROG -o f,s:,h --long force,splash:,help -- "$@"` || show_add_usage_fail "cannot parse command-line options" eval set -- "$tmp" local force= + local splash= while true; do case "$1" in -f|--force) force="-f" ;; + -s|--splash) + splash="$2"; shift + ;; -h|--help) show_add_usage exit 0 @@ -148,6 +155,9 @@ add_subcommand() if [ "$#" -gt 4 ]; then show_add_usage_fail "too many arguments: \"$1\"" fi + if [ -n "$splash" ] && ! [ -f "$splash" ]; then + show_add_usage_fail "splash file not found: \"$splash\"" + fi prepare @@ -192,6 +202,13 @@ add_subcommand() options $options EOF + # Add an optional splash image entry if the image file exists + if [ -n "$splash" ]; then + cp $verbose -- "$splash" "$entries_dir" + printf "%s\n" "splash \\loader\\entries\\${splash##*/}" \ + >> "$entry_path" + fi + if [ -n "$verbose" ]; then verbose "contents of \"$entry_path\":" cat -- "$entry_path" >&2 -- 2.7.4