Feature #12517
closedallow for custom per-distribution branding
100%
Description
Inspired by the uncluttered but informative boot banner used in Unleashed OS I think we should allow distributions to choose to override the machine boot and zone boot banner message to announce their distribution branding. By default, for stock illumos-gate
builds, we'll just announce ourselves as "illumos":
illumos Version master-72a6dc12743 64-bit Hostname: newcastle newcastle console login:
A potential boot a banner for OmniOS might look like:
OmniOS Version omnios-r151032-702376803e 64-bit Hostname: sydney sydney console login:
or even:
OmniOS Release 151030 (LTS) Version omnios-r151030-bf2ac028ce 64-bit Hostname: melbourne melbourne console login:
Ultimately, the string before Version
above would able to be overridden in illumos.sh
via a DISTRO_NAME
variable, which defaults to the value illumos
. Those with a sense of nostalgia can specify DISTRO_NAME='SunOS Release 5.11'
and get the same output they get today. The string in DISTRO_NAME
will also replace SunOS
in the mcs
comments in shipped binaries, and the default /etc/motd
generated in the gate.
Related issues
Updated by Joshua M. Clulow about 2 years ago
Testing Notes¶
Loading unix... Loading /platform/i86pc/amd64/boot_archive... Loading /platform/i86pc/amd64/boot_archive.hash... Booting... illumos Version rti-banner-0-gb41f086d5d 64-bit Hostname: oi0 oi0 console login: root Password: Apr 14 21:05:32 oi0 login: ROOT LOGIN /dev/console Last login: Sat Nov 2 13:40:44 on console The illumos Project illumos rti-banner-0-gb41f086d5d April 2020 You have new mail. root@oi0:~# mcs -p /usr/bin/id /usr/bin/id: @(#)illumos rti-banner-0-gb41f086d5d April 2020
Updated by Joshua M. Clulow about 2 years ago
Updated by Joshua M. Clulow about 2 years ago
Testing Notes (Supplemental)¶
Built the final patchset for this change and rebooted into it. Confirmed visually that the boot banner is updated correctly with the same version shown in uname -v
. Booted a zone and checked that the zone console (zlogin -C
) also displayed the same updated banner.
Earlier I also performed a build and test with the two line boot banner that Peter suggested he would like to have, and that also worked both on the system console and on the zone console.
Confirming also that the mcs
comments are working as expected:
$ uname -v rti-banner-0-g6dc88a2f5f $ mcs -p /usr/bin/ls /usr/bin/ls: @(#)illumos rti-banner-0-g6dc88a2f5f April 2020 $ mcs -p /usr/bin/pax /usr/bin/pax: @(#)SunOS 5.11 onnv-gate:2010-08-18 August 2010
Updated by Joshua M. Clulow about 2 years ago
Testing Notes (Appendix)¶
Some additional specifics on template string testing appear below. I wrote a unit test program to exercise the template engine while I was developing it:
#include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/bootbanner.h> void printfunc(const char *line, uint_t lnum) { printf(" [%u] %s\n", lnum, line); } int main(int argc, char *argv[]) { bootbanner_print(printfunc, 0); return (0); }
Run under a harness:
#!/bin/bash function t { printf -- '---- TEMPLATE: %s ----\n' "$1" shift [[ -n $1 ]] && printf ' BOOTBANNER1="%s"\n' "$1" [[ -n $2 ]] && printf ' BOOTBANNER2="%s"\n' "$2" [[ -n $3 ]] && printf ' BOOTBANNER3="%s"\n' "$3" [[ -n $4 ]] && printf ' BOOTBANNER4="%s"\n' "$4" [[ -n $5 ]] && printf ' BOOTBANNER5="%s"\n' "$5" printf '\n' rm -f bbt gcc \ -I$SRC/uts/common \ -DBOOTBANNER1="\"$1\"" \ -DBOOTBANNER2="\"$2\"" \ -DBOOTBANNER3="\"$3\"" \ -DBOOTBANNER4="\"$4\"" \ -DBOOTBANNER5="\"$5\"" \ -o bbt bbt.c bootbanner.c printf -- 'output:\n' "$1" ./bbt printf '\n' } t 'five lines, no expansion' a b c d e t 'one line, no expansion' a t 'illumos default' '^o Version ^v ^w-bit' t 'retro' '^s Release ^r Version ^v ^w-bit' t 'tribblix' 'Welcome to Tribblix, the retro ^o distribution' \ '^v | March 2020 | http://www.tribblix.org/'
The test harness produces this output:
---- TEMPLATE: five lines, no expansion ---- BOOTBANNER1="a" BOOTBANNER2="b" BOOTBANNER3="c" BOOTBANNER4="d" BOOTBANNER5="e" output: [0] a [1] b [2] c [3] d [4] e ---- TEMPLATE: one line, no expansion ---- BOOTBANNER1="a" output: [0] a ---- TEMPLATE: illumos default ---- BOOTBANNER1="^o Version ^v ^w-bit" output: [0] illumos Version rti-banner-0-g6dc88a2f5f 64-bit ---- TEMPLATE: retro ---- BOOTBANNER1="^s Release ^r Version ^v ^w-bit" output: [0] SunOS Release 5.11 Version rti-banner-0-g6dc88a2f5f 64-bit ---- TEMPLATE: tribblix ---- BOOTBANNER1="Welcome to Tribblix, the retro ^o distribution" BOOTBANNER2="^v | March 2020 | http://www.tribblix.org/" output: [0] Welcome to Tribblix, the retro illumos distribution [1] rti-banner-0-g6dc88a2f5f | March 2020 | http://www.tribblix.org/
I have also done the full OS build and reboot and zone checks for both the default configuration (no overrides in the environment) and the sample Tribblix string from above. The chief difference between the kernel and the usermode implementation is how we produce the bit width string, and the default banner template exercises that.
Updated by Electric Monk about 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 6112cec5d5374dff12a12bd285afeb5e660b7154
commit 6112cec5d5374dff12a12bd285afeb5e660b7154 Author: Joshua M. Clulow <josh@sysmgr.org> Date: 2020-05-01T20:46:49.000Z 12517 allow for custom per-distribution branding Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk> Reviewed by: Peter Tribble <peter.tribble@gmail.com> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
Updated by Joshua M. Clulow about 2 years ago
- Related to Bug #12878: check_rtime: missing entries added