Commit dabbe191 authored by HardenedBSD Sync Service's avatar HardenedBSD Sync Service
Browse files

Merge branch 'freebsd/current/main' into hardened/current/master

parents c5f7ec2a 900a7922
...@@ -5421,6 +5421,11 @@ OLD_FILES+=usr/share/man/man9/crypto_find_driver.9.gz ...@@ -5421,6 +5421,11 @@ OLD_FILES+=usr/share/man/man9/crypto_find_driver.9.gz
OLD_FILES+=usr/share/man/man9/crypto_register.9.gz OLD_FILES+=usr/share/man/man9/crypto_register.9.gz
OLD_FILES+=usr/share/man/man9/crypto_unregister.9.gz OLD_FILES+=usr/share/man/man9/crypto_unregister.9.gz
   
# 20200326: compat libs for libl are no longer built
OLD_FILES+=usr/lib32/libfl.a
OLD_FILES+=usr/lib32/libl.a
OLD_FILES+=usr/lib32/libln.a
# 20200323: INTERNALLIB don't install headers anymore # 20200323: INTERNALLIB don't install headers anymore
OLD_FILES+=usr/include/libelftc.h OLD_FILES+=usr/include/libelftc.h
OLD_FILES+=usr/include/libifconfig.h OLD_FILES+=usr/include/libifconfig.h
...@@ -6375,6 +6380,7 @@ OLD_FILES+=usr/include/ssp/stdio.h ...@@ -6375,6 +6380,7 @@ OLD_FILES+=usr/include/ssp/stdio.h
OLD_FILES+=usr/include/ssp/string.h OLD_FILES+=usr/include/ssp/string.h
OLD_FILES+=usr/include/ssp/unistd.h OLD_FILES+=usr/include/ssp/unistd.h
OLD_DIRS+=usr/include/ssp OLD_DIRS+=usr/include/ssp
OLD_FILES+=usr/lib/libssp.a
   
# 20191229: GEOM_SCHED class and gsched tool removed # 20191229: GEOM_SCHED class and gsched tool removed
OLD_LIBS+=lib/geom/geom_sched.so OLD_LIBS+=lib/geom/geom_sched.so
...@@ -11369,7 +11375,6 @@ OLD_FILES+=usr/lib/libgpib.a ...@@ -11369,7 +11375,6 @@ OLD_FILES+=usr/lib/libgpib.a
OLD_FILES+=usr/lib/libgpib_p.a OLD_FILES+=usr/lib/libgpib_p.a
OLD_FILES+=usr/lib/libgpib.so OLD_FILES+=usr/lib/libgpib.so
OLD_LIBS+=usr/lib/libgpib.so.3 OLD_LIBS+=usr/lib/libgpib.so.3
OLD_FILES+=usr/lib/libgpib_p.a
OLD_FILES+=usr/lib32/libgpib.a OLD_FILES+=usr/lib32/libgpib.a
OLD_FILES+=usr/lib32/libgpib_p.a OLD_FILES+=usr/lib32/libgpib_p.a
OLD_FILES+=usr/lib32/libgpib.so OLD_FILES+=usr/lib32/libgpib.so
......
...@@ -611,8 +611,9 @@ camperiphunit(struct periph_driver *p_drv, path_id_t pathid, ...@@ -611,8 +611,9 @@ camperiphunit(struct periph_driver *p_drv, path_id_t pathid,
unit = 0; unit = 0;
i = 0; i = 0;
dname = periph_name; dname = periph_name;
while (resource_find_dev(&i, dname, &dunit, NULL, NULL) == 0) {
wired = false; for (wired = false; resource_find_dev(&i, dname, &dunit, NULL, NULL) == 0;
wired = false) {
if (resource_string_value(dname, dunit, "at", &strval) == 0) { if (resource_string_value(dname, dunit, "at", &strval) == 0) {
if (strcmp(strval, pathbuf) != 0) if (strcmp(strval, pathbuf) != 0)
continue; continue;
......
...@@ -2058,6 +2058,50 @@ union ses_status_element { ...@@ -2058,6 +2058,50 @@ union ses_status_element {
uint8_t bytes[4]; uint8_t bytes[4];
}; };
/*
* Convert element status into control as much as possible.
* Some bits have different meaning in status and control,
* while others have the same and should be preserved.
*/
static inline void
ses_status_to_ctrl(uint8_t type, uint8_t *bytes)
{
/* Updated to SES4r5. */
static const uint8_t mask[][4] = {
{ 0x60, 0x00, 0x00, 0x00 }, /* UNSPECIFIED */
{ 0x60, 0x00, 0x4e, 0x3c }, /* DEVICE */
{ 0x60, 0xc0, 0x00, 0x60 }, /* POWER */
{ 0x60, 0xc0, 0x00, 0x60 }, /* COOLING/FAN */
{ 0x60, 0xc0, 0x00, 0x80 }, /* THERM */
{ 0x60, 0xc0, 0x00, 0x01 }, /* DOORLOCK */
{ 0x60, 0xc0, 0x00, 0x5f }, /* ALARM */
{ 0x60, 0xf0, 0x01, 0x00 }, /* ESSC */
{ 0x60, 0xc0, 0x00, 0x00 }, /* SCC */
{ 0x60, 0xc0, 0x00, 0x00 }, /* NVRAM */
{ 0x60, 0x00, 0x00, 0x00 }, /* INV_OP_REASON */
{ 0x60, 0x00, 0x00, 0xe0 }, /* UPS */
{ 0x60, 0xc0, 0xff, 0xff }, /* DISPLAY */
{ 0x60, 0xc0, 0x00, 0x00 }, /* KEYPAD */
{ 0x60, 0x80, 0x00, 0xff }, /* ENCLOSURE */
{ 0x60, 0xc0, 0x00, 0x10 }, /* SCSIXVR */
{ 0x60, 0x80, 0xff, 0xff }, /* LANGUAGE */
{ 0x60, 0xc0, 0x00, 0x01 }, /* COMPORT */
{ 0x60, 0xc0, 0x00, 0x00 }, /* VOM */
{ 0x60, 0xc0, 0x00, 0x00 }, /* AMMETER */
{ 0x60, 0xc0, 0x00, 0x01 }, /* SCSI_TGT */
{ 0x60, 0xc0, 0x00, 0x01 }, /* SCSI_INI*/
{ 0x60, 0xc0, 0x00, 0x00 }, /* SUBENC */
{ 0x60, 0xff, 0x4e, 0x3c }, /* ARRAY_DEV */
{ 0x60, 0xc0, 0x00, 0x00 }, /* SAS_EXP */
{ 0x60, 0x80, 0x00, 0x40 }, /* SAS_CONN */
};
if (type >= sizeof(mask) / sizeof(mask[0]))
type = 0;
for (int i = 0; i < 4; i++)
bytes[i] &= mask[type][i];
}
/*===================== SCSI SES Status Diagnostic Page =====================*/ /*===================== SCSI SES Status Diagnostic Page =====================*/
struct ses_status_page { struct ses_status_page {
struct ses_page_hdr hdr; struct ses_page_hdr hdr;
......
...@@ -594,8 +594,8 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) ...@@ -594,8 +594,8 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
#endif #endif
tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
error = tcp_output(tp); error = tcp_output(tp);
KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()", KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()"
tp->t_fb->tfb_tcp_block_name, tp)); ", error code %d", tp->t_fb->tfb_tcp_block_name, tp, -error));
out_in_epoch: out_in_epoch:
NET_EPOCH_EXIT(et); NET_EPOCH_EXIT(et);
out: out:
...@@ -722,8 +722,8 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) ...@@ -722,8 +722,8 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
#endif #endif
NET_EPOCH_EXIT(et); NET_EPOCH_EXIT(et);
out: out:
KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()", KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()"
tp->t_fb->tfb_tcp_block_name, tp)); ", error code %d", tp->t_fb->tfb_tcp_block_name, tp, -error));
/* /*
* If the implicit bind in the connect call fails, restore * If the implicit bind in the connect call fails, restore
* the flags we modified. * the flags we modified.
......
#!/usr/libexec/flua
--[[
SPDX-License-Identifier: BSD-2-Clause-FreeBSD
Copyright (c) 2022 Stefan Esser <se@FreeBSD.org>
Generate a list of existing and required CONFLICTS_INSTALL lines
for all ports (limited to ports for which official packages are
provided).
This script depends on the ports-mgmt/pkg-provides port for the list
of files installed by all pre-built packages for the architecture
the script is run on.
The script generates a list of ports by running "pkg provides ." and
a mapping from package base name to origin via "pkg rquery '%n %o'".
The existing CONFLICTS and CONFLICTS_INSTALL definitions are fetched
by "make -C $origin -V CONFLICTS -V CONFLICTS_INSTALL". This list is
only representative for the options configured for each port (i.e.
if non-default options have been selected and registered, these may
lead to a non-default list of conflicts).
The script detects files used by more than one port, than lists by
origin the existing definition and the list of package base names
that have been detected to cause install conflicts followed by the
list of duplicate files separated by a hash character "#".
This script uses the "hidden" LUA interpreter in the FreeBSD base
systems and does not need any port except "pkg-provides" to be run.
The run-time on my system checking the ~32000 packages available
for -CURRENT on amd64 is 150 seconds.
--]]
require "lfs"
local index_file = "/usr/ports/INDEX-14"
local function read_index ()
local ORIGIN = {}
local pipe = io.popen("pkg rquery '%n %o'")
for line in pipe:lines() do
local pkgbase, origin = string.match(line, "(%S+) (%S+)")
ORIGIN[pkgbase] = origin
end
pipe:close()
return ORIGIN
end
local function read_files()
local FILES_TABLE = {}
local pkgbase, version
local pipe = io.popen("pkg provides .")
for line in pipe:lines() do
local label = string.sub(line, 1, 10)
if label == "Name : " then
name = string.sub(line, 11)
pkgbase, version = string.match(name, "(.*)-([^-]*)")
elseif label == " " or label == "Filename: " then
local file = string.sub(line, 11)
if file:sub(1, 10) == "usr/local/" then
file = file:sub(11)
else
file = "/" .. file
end
local t = FILES_TABLE[file] or {}
t[#t + 1] = pkgbase
FILES_TABLE[file] = t
end
end
pipe:close()
return FILES_TABLE
end
local PKG_PAIRS = {}
for file, pkgbases in pairs(read_files()) do
if #pkgbases > 1 then
for i = 1, #pkgbases -1 do
local pkg_i = pkgbases[i]
for j = i + 1, #pkgbases do
local pkg_j = pkgbases[j]
if pkg_i ~= pkg_j then
p1 = PKG_PAIRS[pkg_i] or {}
p2 = p1[pkg_j] or {}
p2[#p2 + 1] = file
p1[pkg_j] = p2
PKG_PAIRS[pkg_i] = p1
end
end
end
end
end
local CONFLICT_PKGS = {}
local CONFLICT_FILES = {}
for pkg_i, p1 in pairs(PKG_PAIRS) do
for pkg_j, p2 in pairs(p1) do
CONFLICT_PKGS[pkg_i] = CONFLICT_PKGS[pkg_i] or {}
CONFLICT_PKGS[pkg_j] = CONFLICT_PKGS[pkg_j] or {}
CONFLICT_FILES[pkg_i] = CONFLICT_FILES[pkg_i] or {}
CONFLICT_FILES[pkg_j] = CONFLICT_FILES[pkg_j] or {}
table.insert(CONFLICT_PKGS[pkg_i], pkg_j)
table.insert(CONFLICT_PKGS[pkg_j], pkg_i)
for _, file in ipairs(p2) do
table.insert(CONFLICT_FILES[pkg_i], file)
table.insert(CONFLICT_FILES[pkg_j], file)
end
end
end
local function table_sorted_keys(t)
result = {}
for k, _ in pairs(t) do
result[#result + 1] = k
end
table.sort(result)
return result
end
local function table_sort_uniq(t)
local result = {}
local last
table.sort(t)
for _, entry in ipairs(t) do
if entry ~= last then
last = entry
result[#result + 1] = entry
end
end
return result
end
local ORIGIN = read_index()
local RESULT_PATTERN = {}
for pkg, pkgs in pairs(CONFLICT_PKGS) do
local origin = ORIGIN[pkg]
if origin then
table.sort(pkgs)
RESULT_PATTERN[origin] = table.concat(pkgs, " ")
end
end
local FILE_LIST = {}
for pkg, files in pairs(CONFLICT_FILES) do
local origin = ORIGIN[pkg]
if origin then
FILE_LIST[origin] = table.concat(table_sort_uniq(files), " ")
end
end
for _, origin in ipairs(table_sorted_keys(RESULT_PATTERN)) do
local pipe = io.popen("make -C /usr/ports/" .. origin .. " -V CONFLICTS -V CONFLICTS_INSTALL 2>/dev/null")
local conflicts_table = {}
local seen = {}
for line in pipe:lines() do
for word in line:gmatch("(%S*)%s?") do
if word ~= "" and not seen[word] then
table.insert(conflicts_table, word)
seen[word] = true
end
end
end
pipe:close()
table.sort(conflicts_table)
conflicts_string = table.concat(conflicts_table, " ")
local conflicts_new = RESULT_PATTERN[origin]
if conflicts_string ~= conflicts_new then
print("< " .. origin, conflicts_string)
print("> " .. origin, conflicts_new .. " # " .. FILE_LIST[origin])
print()
end
end
...@@ -138,10 +138,11 @@ do_led(int fd, unsigned int idx, elm_type_t type, bool onoff, bool setfault) ...@@ -138,10 +138,11 @@ do_led(int fd, unsigned int idx, elm_type_t type, bool onoff, bool setfault)
close(fd); close(fd);
xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT"); xo_err(EXIT_FAILURE, "ENCIOC_GETELMSTAT");
} }
slot = (struct ses_ctrl_dev_slot *) &o.cstat[0]; ses_status_to_ctrl(type, &o.cstat[0]);
switch (type) { switch (type) {
case ELMTYP_DEVICE: case ELMTYP_DEVICE:
case ELMTYP_ARRAY_DEV: case ELMTYP_ARRAY_DEV:
slot = (struct ses_ctrl_dev_slot *) &o.cstat[0];
ses_ctrl_common_set_select(&slot->common, 1); ses_ctrl_common_set_select(&slot->common, 1);
if (setfault) if (setfault)
ses_ctrl_dev_slot_set_rqst_fault(slot, state); ses_ctrl_dev_slot_set_rqst_fault(slot, state);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment