diff --git a/README.md b/README.md index 29d8166..1a82daa 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,36 @@ The config file can also be specified on the command line as an argument the `bu This is parsed after `config` so can be used to override values set there. +### Customizing the OS name and description displayed in NOOBS + +By default, pi-gen builds NOOBS bundles during Stages 2, 4, and 5. You can customize the OS name and description displayed by the NOOBS interface. Names and descriptions for those three stages can be dynamically generated depending on the variables set in `config`: + + * `NOOBS_NAME` (Default: Raspbian) + + The base name of the OS. The actual OS names of the bundles generated in Stages 2, 4, and 5 are based on this: + Stage 2: `$NOOBS_NAME Lite` + Stage 4: `$NOOBS_NAME` + Stage 5: `$NOOBS_NAME Full` + + * `PORT_OF` (Default: Debian) + + Specifies the OS from which your OS is ported. This is used in the dynamically generated default OS descriptions. + + * `NOOBS_DESCRIPTION_ALL` (Default: unset) + + Sets the default OS descriptions of all three stages to this. When left unset, the descriptions are generated as follows: + Stage 2: `A port of $PORT_OF with no desktop environment` + Stage 4: `A port of $PORT_OF with the Raspberry Pi Desktop` + Stage 5: `A port of $PORT_OF with desktop and recommended applications` + + * `NOOBS_DESCRIPTION_2`, `NOOBS_DESCRIPTION_4`, and `NOOBS_DESCRIPTION_5` (Default: unset) + + In addition, any of the stages' descriptions can be manually overriden and set by using these variables. + + Basically, when none of the `NOOBS_DESCRIPTION_*` variables are set, the descriptions will default to the various *"A port of..."* strings. When `NOOBS_DESCRIPTION_ALL` is set, it will override all the *"A port of..."* strings. Finally, any of the `NOOBS_DESCRIPTION_#` variables will take precedence as the description for that stage if set. + + See build.sh and `stage*/EXPORT_NOOBS` for more details. + ## How the build process works The following process is followed to build images: diff --git a/build.sh b/build.sh index a8247ab..ca722a1 100755 --- a/build.sh +++ b/build.sh @@ -193,11 +193,18 @@ export PREV_STAGE_DIR export ROOTFS_DIR export PREV_ROOTFS_DIR export IMG_SUFFIX -export NOOBS_NAME -export NOOBS_DESCRIPTION export EXPORT_DIR export EXPORT_ROOTFS_DIR +export NOOBS_NAME="${NOOBS_NAME:-Raspbian}" +export NOOBS_BASENAME="${NOOBS_NAME}" +export PORT_OF="${PORT_OF:-Debian}" +export NOOBS_DESCRIPTION +export NOOBS_DESCRIPTION_ALL +export NOOBS_DESCRIPTION_2 +export NOOBS_DESCRIPTION_4 +export NOOBS_DESCRIPTION_5 + export QUILT_PATCHES export QUILT_NO_DIFF_INDEX=1 export QUILT_NO_DIFF_TIMESTAMPS=1 diff --git a/stage2/EXPORT_NOOBS b/stage2/EXPORT_NOOBS index 136cc77..0147c44 100644 --- a/stage2/EXPORT_NOOBS +++ b/stage2/EXPORT_NOOBS @@ -1,2 +1,5 @@ -NOOBS_NAME="Raspbian Lite" -NOOBS_DESCRIPTION="A port of Debian with no desktop environment" +NAME_SUFFIX=" Lite" +NOOBS_NAME="${NOOBS_BASENAME}${NAME_SUFFIX}" + +NOOBS_DESCRIPTION="${NOOBS_DESCRIPTION_ALL:-A port of $PORT_OF with no desktop environment}" +NOOBS_DESCRIPTION="${NOOBS_DESCRIPTION_2:-$NOOBS_DESCRIPTION}" \ No newline at end of file diff --git a/stage4/EXPORT_NOOBS b/stage4/EXPORT_NOOBS index 2ef6d7b..54bbfa5 100644 --- a/stage4/EXPORT_NOOBS +++ b/stage4/EXPORT_NOOBS @@ -1,2 +1,5 @@ -NOOBS_NAME="Raspbian" -NOOBS_DESCRIPTION="A port of Debian with the Raspberry Pi Desktop" +NAME_SUFFIX="" +NOOBS_NAME="${NOOBS_BASENAME}${NAME_SUFFIX}" + +NOOBS_DESCRIPTION="${NOOBS_DESCRIPTION_ALL:-A port of $PORT_OF with the Raspberry Pi Desktop}" +NOOBS_DESCRIPTION="${NOOBS_DESCRIPTION_4:-$NOOBS_DESCRIPTION}" \ No newline at end of file diff --git a/stage5/EXPORT_NOOBS b/stage5/EXPORT_NOOBS index cb10203..7ba946e 100644 --- a/stage5/EXPORT_NOOBS +++ b/stage5/EXPORT_NOOBS @@ -1,2 +1,5 @@ -NOOBS_NAME="Raspbian Full" -NOOBS_DESCRIPTION="A port of Debian with desktop and recommended applications" +NAME_SUFFIX=" Full" +NOOBS_NAME="${NOOBS_BASENAME}${NAME_SUFFIX}" + +NOOBS_DESCRIPTION="${NOOBS_DESCRIPTION_ALL:-A port of $PORT_OF with desktop and recommended applications}" +NOOBS_DESCRIPTION="${NOOBS_DESCRIPTION_5:-$NOOBS_DESCRIPTION}" \ No newline at end of file