From nobody Fri May 13 16:37:13 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 177CF1ADAACB; Fri, 13 May 2022 16:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L0Dnk09Mrz3rsS; Fri, 13 May 2022 16:37:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652459834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieIVyOv6pmUGEamqH1O91IZ5X8mjcLRXyh8A90mzi3Y=; b=RBdnlYLbuoQgSHoKfC+cGtHojvLkrGsohkQKchZ2uI3bxg2nPoiTpwT6vPEbvMzHrq3lWQ mwkpVRDmFOIEpJlYkpTlHqbNW4DIhiO69pFmI+NLDY5kWCtNMGEqN8xgAfk2qmJzhTjn1f 9VZ00yMS2BAQgYg4g2LNIpIEuiWWmSeR8iwbGuyKWdHSSErXlHn1hlCTZyaE2WRb1HosLe 6soHBr3Idn8acosoXQlZAZTUxAptUA0nZklgHSlxHLTG5wNMVkY5RdiozqV/GShylNde84 I486rqEnUYs4yaXnr96MutdYa8bcSzBV9o0Ke5uV8Y1M1zJUvvxM6ssbuORzeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9CEA2636A; Fri, 13 May 2022 16:37:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24DGbDUk061621; Fri, 13 May 2022 16:37:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24DGbDao061620; Fri, 13 May 2022 16:37:13 GMT (envelope-from git) Date: Fri, 13 May 2022 16:37:13 GMT Message-Id: <202205131637.24DGbDao061620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brad Davis Subject: git: 147585b4893b - main - bsdinstall: allow whitelabeling the installer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 147585b4893bc38698aaa971af336b241477eac3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652459834; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ieIVyOv6pmUGEamqH1O91IZ5X8mjcLRXyh8A90mzi3Y=; b=PIctolFOn0yPRXAG70DQ1mvPA+igYr0CM+kMeW79EV6DIVuMFhG0obJ5p6otRKXEoNBsRD zx9kavjjNi4Gi5FvjV3rx6Vo+yAKs8x4sbSKWm9cg6P4NEAkAFeW65aX7S9S6zuT8DfmEp rarWeRPiUa2uAbnEFy5wTG+OI8TkUWmmak/HncguxnFpu57kS6YLVEM35XBMmSoUO+tq7H aK4G9fCFnAi8RCJTrii+Xgzmt8/CS08hCHZYjKD2Hxzt3+OaMqIwjX2/DDhrKLeGVqTQ8+ 1h4Zr+E85DVhUCB3/u0Gnfu/wFgad1cMeySD5K1VQp++bnyJRoNGftMihFLd6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652459834; a=rsa-sha256; cv=none; b=PoNOjw1ZCEwpHkTMk7fgP+nZ813w3yiWj/XQ1NQJsdnpkzQHrzOjTQPb67TCFGTzqyXBWb D+QYUKjPy/Df5O0cymSlQS5hi9jF8SxXSkNA6pV1/aeAlCDjpAJ/QSKB+YTRO52et8pI+O zaGvNXvnF4kh7XUBRloaKOxOAwrTUxXL9SsPgJVcaKxDG4XugJmfyfaYTal8b0jwoKuyzL 6AbgdmeNVZJbAyZQDcGH0RRI1O2bn+9ucoR2untMBvF/FyiG2pciJIAbSPx3byn4L7QWB4 lUawhcypIw+t39upTI9DRYE5opUzTmLp2/mSV0fCYcaIM9LxuOgx7VVsk9F3BQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by brd: URL: https://cgit.FreeBSD.org/src/commit/?id=147585b4893bc38698aaa971af336b241477eac3 commit 147585b4893bc38698aaa971af336b241477eac3 Author: Brad Davis AuthorDate: 2022-05-13 16:35:43 +0000 Commit: Brad Davis CommitDate: 2022-05-13 16:35:43 +0000 bsdinstall: allow whitelabeling the installer Override OSNAME to change the name of the OS in the installer. This is a first step, the shell changes will be separate. Reviewed by: allanjude Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D34878 Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/bsdinstall/Makefile | 9 +++++++++ usr.sbin/bsdinstall/distextract/Makefile | 2 +- usr.sbin/bsdinstall/distextract/distextract.c | 4 +++- usr.sbin/bsdinstall/distfetch/Makefile | 2 +- usr.sbin/bsdinstall/distfetch/distfetch.c | 4 +++- usr.sbin/bsdinstall/partedit/Makefile | 2 +- usr.sbin/bsdinstall/partedit/part_wizard.c | 8 ++++---- usr.sbin/bsdinstall/partedit/partedit.c | 8 ++++---- usr.sbin/bsdinstall/partedit/partedit.h | 2 ++ 9 files changed, 28 insertions(+), 13 deletions(-) diff --git a/usr.sbin/bsdinstall/Makefile b/usr.sbin/bsdinstall/Makefile index 88cb691d8dda..761051a5f48f 100644 --- a/usr.sbin/bsdinstall/Makefile +++ b/usr.sbin/bsdinstall/Makefile @@ -1,9 +1,18 @@ # $FreeBSD$ +OSNAME?= FreeBSD SUBDIR= distextract distfetch partedit scripts SUBDIR_PARALLEL= SCRIPTS= bsdinstall MAN= bsdinstall.8 PACKAGE= bsdinstall +GENHDRS= opt_osname.h +SRCS+= ${GENHDRS} +CLEANFILES+= ${GENHDRS} + +opt_osname.h: .PHONY + if ! grep -q "^#define OSNAME \"${OSNAME}\"$"" ${.TARGET}; then \ + echo "#define OSNAME \"${OSNAME}\"" > ${.TARGET}; \ + fi .include diff --git a/usr.sbin/bsdinstall/distextract/Makefile b/usr.sbin/bsdinstall/distextract/Makefile index 5e9f2b9e1473..6ae9bb65e8fb 100644 --- a/usr.sbin/bsdinstall/distextract/Makefile +++ b/usr.sbin/bsdinstall/distextract/Makefile @@ -2,7 +2,7 @@ BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distextract -CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib +CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/.. LIBADD= archive bsddialog m MAN= diff --git a/usr.sbin/bsdinstall/distextract/distextract.c b/usr.sbin/bsdinstall/distextract/distextract.c index f7f973fe336c..30400ba0f021 100644 --- a/usr.sbin/bsdinstall/distextract/distextract.c +++ b/usr.sbin/bsdinstall/distextract/distextract.c @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_osname.h" + /* Data to process */ static const char *distdir = NULL; static struct archive *archive = NULL; @@ -82,7 +84,7 @@ main(void) errx(EXIT_FAILURE, "Error libbsdialog: %s", bsddialog_geterror()); bsddialog_initconf(&conf); - bsddialog_backtitle(&conf, "FreeBSD Installer"); + bsddialog_backtitle(&conf, OSNAME " Installer"); bsddialog_infobox(&conf, "Checking distribution archives.\nPlease wait...", 4, 35); diff --git a/usr.sbin/bsdinstall/distfetch/Makefile b/usr.sbin/bsdinstall/distfetch/Makefile index f4ae37edf1a5..0104df0e3aec 100644 --- a/usr.sbin/bsdinstall/distfetch/Makefile +++ b/usr.sbin/bsdinstall/distfetch/Makefile @@ -2,7 +2,7 @@ BINDIR= ${LIBEXECDIR}/bsdinstall PROG= distfetch -CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib +CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/.. LIBADD= fetch bsddialog MAN= diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c index c5749c07854a..6963ee08968f 100644 --- a/usr.sbin/bsdinstall/distfetch/distfetch.c +++ b/usr.sbin/bsdinstall/distfetch/distfetch.c @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_osname.h" + static int fetch_files(int nfiles, char **urls); int @@ -76,7 +78,7 @@ main(void) bsddialog_geterror()); } bsddialog_initconf(&conf); - bsddialog_backtitle(&conf, "FreeBSD Installer"); + bsddialog_backtitle(&conf, OSNAME " Installer"); for (i = 0; i < ndists; i++) { urls[i] = malloc(PATH_MAX); diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile index f89a1d374fb8..96c4ddb53961 100644 --- a/usr.sbin/bsdinstall/partedit/Makefile +++ b/usr.sbin/bsdinstall/partedit/Makefile @@ -5,7 +5,7 @@ PROG= partedit LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \ ${BINDIR}/partedit ${BINDIR}/scriptedpart SYMLINKS= ../libexec/bsdinstall/partedit /usr/sbin/sade -CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib +CFLAGS+= -I${SRCTOP}/contrib/bsddialog/lib -I${.OBJDIR}/.. LIBADD+= geom util bsddialog PARTEDIT_ARCH= ${MACHINE} diff --git a/usr.sbin/bsdinstall/partedit/part_wizard.c b/usr.sbin/bsdinstall/partedit/part_wizard.c index a030608ac764..83fc29eb0359 100644 --- a/usr.sbin/bsdinstall/partedit/part_wizard.c +++ b/usr.sbin/bsdinstall/partedit/part_wizard.c @@ -173,7 +173,7 @@ boot_disk_select(struct gmesh *mesh) if (n > 1) { conf.title = "Partitioning"; button = bsddialog_menu(&conf, - "Select the disk on which to install FreeBSD.", 0, 0, 0, + "Select the disk on which to install " OSNAME ".", 0, 0, 0, n, disks, &selected); chosen = (button == BSDDIALOG_OK) ? @@ -259,7 +259,7 @@ query: conf.button.default_cancel = true; snprintf(message, sizeof(message), "Would you like to use this entire " - "disk (%s) for FreeBSD or partition it to share it with other " + "disk (%s) for " OSNAME " or partition it to share it with other " "operating systems? Using the entire disk will erase any data " "currently stored there.", disk); conf.title = "Partition"; @@ -275,7 +275,7 @@ query: sprintf(warning, "The existing partition scheme on this " "disk (%s) is not bootable on this platform. To install " - "FreeBSD, it must be repartitioned. This will destroy all " + OSNAME ", it must be repartitioned. This will destroy all " "data on the disk. Are you sure you want to proceed?", scheme); conf.title = "Non-bootable Disk"; @@ -362,7 +362,7 @@ wizard_makeparts(struct gmesh *mesh, const char *disk, const char *fstype, humanize_number(neededstr, 7, MIN_FREE_SPACE, "B", HN_AUTOSCALE, HN_DECIMAL); sprintf(message, "There is not enough free space on %s to " - "install FreeBSD (%s free, %s required). Would you like " + "install " OSNAME " (%s free, %s required). Would you like " "to choose another disk or to open the partition editor?", disk, availablestr, neededstr); diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c index bcf107f7b397..22d1dbfca194 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.c +++ b/usr.sbin/bsdinstall/partedit/partedit.c @@ -95,7 +95,7 @@ main(int argc, const char **argv) err(1, "%s", bsddialog_geterror()); bsddialog_initconf(&conf); if (!sade_mode) - bsddialog_backtitle(&conf, "FreeBSD Installer"); + bsddialog_backtitle(&conf, OSNAME " Installer"); i = 0; /* Revert changes on SIGINT */ @@ -118,7 +118,7 @@ main(int argc, const char **argv) return (error); } } else { - prompt = "Create partitions for FreeBSD, F1 for help.\n" + prompt = "Create partitions for " OSNAME ", F1 for help.\n" "No changes will be made until you select Finish."; } @@ -294,7 +294,7 @@ validate_setup(void) if (root == NULL) { conf.title = "Error"; bsddialog_msgbox(&conf, "No root partition was found. " - "The root FreeBSD partition must have a mountpoint " + "The root " OSNAME " partition must have a mountpoint " "of '/'.", 0, 0); return (false); } @@ -308,7 +308,7 @@ validate_setup(void) conf.title = "Warning"; button = bsddialog_yesno(&conf, "The chosen root partition " "has a preexisting filesystem. If it contains an existing " - "FreeBSD system, please update it with freebsd-update " + OSNAME " system, please update it with freebsd-update " "instead of installing a new system on it. The partition " "can also be erased by pressing \"No\" and then deleting " "and recreating it. Are you sure you want to proceed?", diff --git a/usr.sbin/bsdinstall/partedit/partedit.h b/usr.sbin/bsdinstall/partedit/partedit.h index 5c0405922d21..aa1ec285ff80 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.h +++ b/usr.sbin/bsdinstall/partedit/partedit.h @@ -35,6 +35,8 @@ #include #include +#include "opt_osname.h" + struct gprovider; struct gmesh; struct ggeom;