From nobody Fri Sep 19 01:20:04 2025 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 4cSZS46wdBz68Lcc; Fri, 19 Sep 2025 01:20:04 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cSZS44jMqz49vK; Fri, 19 Sep 2025 01:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758244804; 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=g0m8NYiHMa018VePbe55ba2zs+jJi7bUxF5R2+0mSE0=; b=MmdmfVdSx0u8D8HC99ZyK6U/DRQAzuqp+tvQuEYKesPB6q/HEEf8h7KnGci71uhJ5Rjvks 8GUsJ+++ABK4xoCgje5cyTD+1OEs9PqRkrn5lLO0l0s25MLQnp+Qr3sD1YIozrue4oROFh NRN2COXtdficg/mcChIFqkYXfDg1MTG92+Jvbm16rpzI8jSpaCjp4WgdpQ4+fj+w5ti1vb e7XCnA031SJhpBWqfHzb/bpWQHY4/0KeikSTyevL2CWIeLibYufFTjgxV55MJc/pXChMWy ux75+J1FPV6Q/JUbBsssMc7Q9LUr1c0SVAcyzPIdh2+38/UWFCJCfMzZ2IqKOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758244804; 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=g0m8NYiHMa018VePbe55ba2zs+jJi7bUxF5R2+0mSE0=; b=vFzPCYWP5Ioqq/exD0VSi/VCg9UJ7pEevMqtWl75iU14m+0ir1QaFJxVE683JBCvIULB/o 1JJAL2dH5Rie0JIhvJtn+V9y1m5AGLoCyN0Fs2qQJpKrFssVN4iIot69ObZ1H+0vmuept6 IFX6Cw3YHdsMeUVQo7OhZna1wwVnSsJksx3Yrus/9Pt3cSclyI8B7Bx4Szct+ujeEj4/G8 mBf3VWdPpLpmdc9DBKviNWjHwBh8zXSZP4t+xb67qV6ql2/0G4c8jr0OJTEk1BBB1c05fk xuygZF9WSjZI66WtAJTxvuH6bNBy/QDxYjx4gsev48Rpa8VTnDI01TU9aCgxAQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758244804; a=rsa-sha256; cv=none; b=LfPLcR2gS1eSzyNzpw3J83BXEZ2bGKmR8zywrweg7e/xLkNHXbvpoxjsCfaDTWGF4sNVXt +HT1aGzX0xl0x9LMBRtz+SYRR0PRTep3kpdty7oe8mcWNTj0zdulX2XrFs3cnZwOKN4pMD JGl8/+FJbiZifhvRj9ZfjQjED6AwmYjOowQ4gJttxirFhvdyb8ddjFNsyPFVfiBIn68fFo IWn9ZPxedcgbM7PslbjvOiVGh5U+rSJlAlddQnMI0blmLVTOQcVhMwQMbiHLRuHW9QRPBu ecwGGTE40WxxnGqOcm4ubVwSlrXG+jzIzpZKORSGFyrlj0RjIamHs1Ru1Sbu2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cSZS446qSzcRT; Fri, 19 Sep 2025 01:20:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58J1K4Ji070007; Fri, 19 Sep 2025 01:20:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58J1K44t070004; Fri, 19 Sep 2025 01:20:04 GMT (envelope-from git) Date: Fri, 19 Sep 2025 01:20:04 GMT Message-Id: <202509190120.58J1K44t070004@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: e554d44c3a7f - stable/15 - bsdinstall: Use package sets for pkgbase install 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: e554d44c3a7ffa8664e89f35aec80b917f69e6b3 Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=e554d44c3a7ffa8664e89f35aec80b917f69e6b3 commit e554d44c3a7ffa8664e89f35aec80b917f69e6b3 Author: Lexi Winter AuthorDate: 2025-09-18 17:28:36 +0000 Commit: Lexi Winter CommitDate: 2025-09-19 01:18:41 +0000 bsdinstall: Use package sets for pkgbase install Update the pkgbase component selection dialogue to take the components list from the meta-package sets available on the install media, except for "kernel" which is still handled magically. Always install "minimal", and by default select "base", "kernel-dbg" and any libcompat sets (e.g., lib32) if they're available. Replace the various "dbg" options with a single "debug" component that installs the debug symbols for all the components the user selected, except for kernel since we handle that separately and it's common to want kernel debugs symbols without userland debug symbols. MFC after: 3 seconds Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D52558 (cherry picked from commit 55ba5550d25d58144007ae02b07450ec8cda7ee5) --- usr.sbin/bsdinstall/scripts/pkgbase.in | 159 ++++++++++++++++++++------------- 1 file changed, 97 insertions(+), 62 deletions(-) diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in index d123394c170e..c06a3f789791 100755 --- a/usr.sbin/bsdinstall/scripts/pkgbase.in +++ b/usr.sbin/bsdinstall/scripts/pkgbase.in @@ -77,37 +77,57 @@ end -- traditional tarball component selection dialog. local function select_components(components, options) local descriptions = { - kernel_dbg = "Kernel debug info", - base_dbg = "Base system debug info", - src = "System source tree", - tests = "Test suite", - lib32 = "32-bit compatibility libraries", - lib32_dbg = "32-bit compatibility libraries debug info", + ["kernel-dbg"] = "Debug symbols for the kernel", + ["devel"] = "C/C++ compilers and related utilities", + ["base"] = "The complete base system (includes devel)", + ["src"] = "System source tree", + ["tests"] = "Test suite", + ["lib32"] = "32-bit compatibility libraries", + ["debug"] = "Debug symbols for the selected components", } + + -- These defaults match what the non-pkgbase installer selects + -- by default. local defaults = { - kernel_dbg = "on", - base_dbg = "off", - src = "off", - tests = "off", - lib32 = "on", - lib32_dbg = "off", + ["base"] = "on", + ["kernel-dbg"] = "on", } + -- Enable compat sets by default. + for compat in all_libcompats:gmatch("%S+") do + defaults["lib" .. compat] = "on" + end -- Sorting the components is necessary to ensure that the ordering is -- consistent in the UI. local sorted_components = {} for component, _ in pairs(components) do - table.insert(sorted_components, component) + -- Decide which sets we want to offer to the user: + -- + -- "minimal" is not offered since it's always included. + -- + -- "-dbg" sets are never offered, because those are handled + -- via the "debug" component. + -- + -- "kernels" is never offered because we only want one kernel, + -- which is handled separately. + -- + -- Sets whose name ends in "-jail" are intended for jails, and + -- are only offered if no_kernel is set. + if not component:match("^minimal") and + not component:match("%-dbg$") and + not (component == "kernels") and + not (not options.no_kernel and component:match("%-jail$")) then + table.insert(sorted_components, component) + end end table.sort(sorted_components) local checklist_items = {} for _, component in ipairs(sorted_components) do - if component ~= "base" and component ~= "kernel" and - not (component == "kernel_dbg" and options.no_kernel) and - #components[component] > 0 then - local description = descriptions[component] or "''" - local default = defaults[component] or "off" + if component ~= "kernel" and not + (component == "kernel-dbg" and options.no_kernel) then + local description = descriptions[component] or "" + local default = defaults[component] or "off" table.insert(checklist_items, component) table.insert(checklist_items, description) table.insert(checklist_items, default) @@ -120,7 +140,10 @@ local function select_components(components, options) "--nocancel", "--disable-esc", "--separate-output", - "--checklist", "Choose optional system components to install:", + "--checklist", + "A minimal set of packages suitable for a multi-user system ".. + "is always installed. Select additional packages you wish ".. + "to install:", "0", "0", "0", -- autosize } append_list(bsddialog_args, checklist_items) @@ -132,10 +155,16 @@ local function select_components(components, options) -- hopefully useful stack trace. assert(exit_code == 0) - local selected = {"base"} + -- Always install the minimal set, since it's required for the system + -- to work. The base set depends on minimal, but it's fine to install + -- both, and this way the user can remove the base set without pkg + -- autoremove then trying to remove minimal. + local selected = {"minimal"} + if not options.no_kernel then table.insert(selected, "kernel") end + for component in output:gmatch("[^\n]+") do table.insert(selected, component) end @@ -145,26 +174,21 @@ end -- Returns a list of pkgbase packages selected by the user local function select_packages(pkg, options) + -- These are the components which aren't generated automatically from + -- package sets. local components = { - kernel = {}, - kernel_dbg = {}, - base = {}, - base_dbg = {}, - src = {}, - tests = {}, + ["kernel"] = {}, + ["kernel-dbg"] = {}, + ["debug"] = {}, } - for compat in all_libcompats:gmatch("%S+") do - components["lib" .. compat] = {} - components["lib" .. compat .. "_dbg"] = {} - end - local rquery = capture(pkg .. "rquery -U -r FreeBSD-base %n") for package in rquery:gmatch("[^\n]+") do - if package == "FreeBSD-src" or package:match("^FreeBSD%-src%-.*") then - table.insert(components["src"], package) - elseif package == "FreeBSD-tests" or package:match("^FreeBSD%-tests%-.*") then - table.insert(components["tests"], package) + local setname = package:match("^FreeBSD%-set%-(.+)$") + + if setname then + components[setname] = components[setname] or {} + table.insert(components[setname], package) elseif package:match("^FreeBSD%-kernel%-.*") and package ~= "FreeBSD-kernel-man" then @@ -172,40 +196,51 @@ local function select_packages(pkg, options) if package == "FreeBSD-kernel-generic" then table.insert(components["kernel"], package) elseif package == "FreeBSD-kernel-generic-dbg" then - table.insert(components["kernel_dbg"], package) - end - elseif package:match(".*%-dbg$") then - table.insert(components["base_dbg"], package) - else - local found = false - for compat in all_libcompats:gmatch("%S+") do - if package:match(".*%-dbg%-lib" .. compat .. "$") then - table.insert(components["lib" .. compat .. "_dbg"], package) - found = true - break - elseif package:match(".*%-lib" .. compat .. "$") then - table.insert(components["lib" .. compat], package) - found = true - break - end - end - if not found then - table.insert(components["base"], package) + table.insert(components["kernel-dbg"], package) end end end - -- Don't assert the existence of dbg, tests, and src packages here. If using - -- a custom local repository with BSDINSTALL_PKG_REPOS_DIR we shouldn't - -- require it to have all packages. + + -- Assert that both a kernel and the "minimal" set are available, since + -- those are both required to install a functional system. Don't worry + -- if other sets are missing (e.g. base or src), which might happen + -- when using custom install media. assert(#components["kernel"] == 1) - assert(#components["base"] > 0) + assert(#components["minimal"] == 1) - local selected = {} - for _, component in ipairs(select_components(components, options)) do - append_list(selected, components[component]) + -- Prompt the user for what to install. + local selected = select_components(components, options) + + -- Determine if the "debug" component was selected. + local debug = false + for _, component in ipairs(selected) do + if component == "debug" then + debug = true + break + end end - return selected + local packages = {} + for _, component in ipairs(selected) do + local pkglist = components[component] + append_list(packages, pkglist) + + -- If the debug component was selected, install the -dbg + -- package for each set. We have to check if the dbg set + -- actually exists, because some sets (src, tests) don't + -- have a -dbg subpackage. + for _, c in ipairs(pkglist) do + local setname = c:match("^FreeBSD%-set%-(.*)$") + if debug and setname then + local dbgset = setname.."-dbg" + if components[dbgset] then + append_list(packages, components[dbgset]) + end + end + end + end + + return packages end local function parse_options()