diff --git a/usr.sbin/bsdinstall/scripts/pkgbase.in b/usr.sbin/bsdinstall/scripts/pkgbase.in --- a/usr.sbin/bsdinstall/scripts/pkgbase.in +++ b/usr.sbin/bsdinstall/scripts/pkgbase.in @@ -103,7 +103,8 @@ for component, _ in pairs(components) do -- Decide which sets we want to offer to the user: -- - -- "minimal" is not offered since it's always included. + -- "minimal" is not offered since it's always included, as is + -- "pkg" if it's present. -- -- "-dbg" sets are never offered, because those are handled -- via the "debug" component. @@ -113,7 +114,8 @@ -- -- 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 + if component ~= "pkg" and + not component:match("^minimal") and not component:match("%-dbg$") and not (component == "kernels") and not (not options.no_kernel and component:match("%-jail$")) then @@ -161,6 +163,13 @@ -- autoremove then trying to remove minimal. local selected = {"minimal"} + -- If pkg is available, always install it so the user can manage the + -- installed system. This is optional, because a repository built + -- from src alone won't have a pkg package. + if components["pkg"] then + table.insert(selected, "pkg") + end + if not options.no_kernel then table.insert(selected, "kernel") end @@ -203,6 +212,9 @@ table.insert(components["kernel"], package) elseif kernel_packages[package:match("(.*)%-dbg$")] then table.insert(components["kernel-dbg"], package) + elseif package == "pkg" then + components["pkg"] = components["pkg"] or {} + table.insert(components["pkg"], package) end end