Skip to content

Commit

Permalink
Merge pull request #1378 from citrus-it/upstream_merge/2023083101
Browse files Browse the repository at this point in the history
Upstream merge upstream_merge/2023083101
  • Loading branch information
hadfl authored Sep 1, 2023
2 parents 39a8c36 + 76b575d commit b9f6ce3
Show file tree
Hide file tree
Showing 72 changed files with 3,176 additions and 12,410 deletions.
60 changes: 1 addition & 59 deletions usr/src/cmd/boot/bootadm/bootadm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Copyright 2016 Toomas Soome <tsoome@me.com>
* Copyright 2017 Nexenta Systems, Inc.
* Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
* Copyright 2023 Oxide Computer Company
*/

/*
Expand Down Expand Up @@ -74,10 +75,6 @@
#include <libfdisk.h>
#endif

#if !defined(_OBP)
#include <sys/ucode.h>
#endif

#include <pwd.h>
#include <grp.h>
#include <device_info.h>
Expand Down Expand Up @@ -300,10 +297,6 @@ static void append_to_flist(filelist_t *, char *);
static int ufs_add_to_sign_list(char *sign);
static error_t synchronize_BE_menu(void);

#if !defined(_OBP)
static void ucode_install();
#endif

/* Menu related sub commands */
static subcmd_defn_t menu_subcmds[] = {
"set_option", OPT_ABSENT, set_option, 0, /* PUB */
Expand Down Expand Up @@ -1620,10 +1613,6 @@ bam_archive(
if (strcmp(subcmd, "update_all") == 0)
bam_update_all = 1;

#if !defined(_OBP)
ucode_install(bam_root);
#endif

ret = f(bam_root, opt);

bam_update_all = 0;
Expand Down Expand Up @@ -10344,50 +10333,3 @@ append_to_flist(filelist_t *flistp, char *s)
flistp->tail->next = lp;
flistp->tail = lp;
}

#if !defined(_OBP)

UCODE_VENDORS;

/*ARGSUSED*/
static void
ucode_install(char *root)
{
int i;

for (i = 0; ucode_vendors[i].filestr != NULL; i++) {
int cmd_len = PATH_MAX + 256;
char cmd[PATH_MAX + 256];
char file[PATH_MAX];
char timestamp[PATH_MAX];
struct stat fstatus, tstatus;
struct utimbuf u_times;

(void) snprintf(file, PATH_MAX, "%s/%s/%s-ucode.%s",
bam_root, UCODE_INSTALL_PATH, ucode_vendors[i].filestr,
ucode_vendors[i].extstr);

if (stat(file, &fstatus) != 0 || !(S_ISREG(fstatus.st_mode)))
continue;

(void) snprintf(timestamp, PATH_MAX, "%s.ts", file);

if (stat(timestamp, &tstatus) == 0 &&
fstatus.st_mtime <= tstatus.st_mtime)
continue;

(void) snprintf(cmd, cmd_len, "/usr/sbin/ucodeadm -i -R "
"%s/%s/%s %s > /dev/null 2>&1", bam_root,
UCODE_INSTALL_PATH, ucode_vendors[i].vendorstr, file);
if (system(cmd) != 0)
return;

if (creat(timestamp, S_IRUSR | S_IWUSR) == -1)
return;

u_times.actime = fstatus.st_atime;
u_times.modtime = fstatus.st_mtime;
(void) utime(timestamp, &u_times);
}
}
#endif
15 changes: 12 additions & 3 deletions usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* CAUTION: This file is kept in sync with it's uts counterpart:
*
* usr/src/uts/common/fs/nfs/nfs4_xdr.c
* usr/src/uts/common/fs/nfs/nfs4_xdr.c
*
* However, it is not an exact copy. NEVER copy uts's nfs4_xdr.c
* directly over this file. Changes from the uts version must be
Expand Down Expand Up @@ -157,6 +157,15 @@ xdr_pathname4(register XDR *xdrs, pathname4 *objp)
return (TRUE);
}

bool_t
xdr_nfs_lockid4(register XDR *xdrs, nfs_lockid4 *objp)
{

if (!xdr_uint64_t(xdrs, objp))
return (FALSE);
return (TRUE);
}

bool_t
xdr_nfs_cookie4(register XDR *xdrs, nfs_cookie4 *objp)
{
Expand Down Expand Up @@ -913,9 +922,9 @@ bool_t
xdr_clientaddr4(register XDR *xdrs, clientaddr4 *objp)
{

if (!xdr_string(xdrs, &objp->na_r_netid, ~0))
if (!xdr_string(xdrs, &objp->r_netid, ~0))
return (FALSE);
if (!xdr_string(xdrs, &objp->na_r_addr, ~0))
if (!xdr_string(xdrs, &objp->r_addr, ~0))
return (FALSE);
return (TRUE);
}
Expand Down
16 changes: 8 additions & 8 deletions usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_nfs4.c
Original file line number Diff line number Diff line change
Expand Up @@ -2024,8 +2024,8 @@ sumarg_setclid(char *buf, size_t buflen, void *obj)

snprintf(buf, buflen, "Prog=%u ID=%s Addr=%s CBID=%u",
args->callback.cb_program,
args->callback.cb_location.na_r_netid,
args->callback.cb_location.na_r_addr, args->callback_ident);
args->callback.cb_location.r_netid,
args->callback.cb_location.r_addr, args->callback_ident);
}

static void
Expand All @@ -2042,9 +2042,9 @@ dtlarg_setclid(void *obj)
sprintf(get_line(0, 0), "Callback Program = %u",
args->callback.cb_program);
sprintf(get_line(0, 0), "Callback Net ID = %s",
args->callback.cb_location.na_r_netid);
args->callback.cb_location.r_netid);
sprintf(get_line(0, 0), "Callback Addr = %s",
args->callback.cb_location.na_r_addr);
args->callback.cb_location.r_addr);
sprintf(get_line(0, 0), "Callback Ident = %u", args->callback_ident);
}

Expand Down Expand Up @@ -3016,8 +3016,8 @@ sumres_setclid(char *buf, size_t buflen, void *obj)
case NFS4ERR_CLID_INUSE:
bp = buf + strlen(buf);
snprintf(bp, buflen - (bp - buf), " ID=%s Addr=%s",
res->SETCLIENTID4res_u.client_using.na_r_netid,
res->SETCLIENTID4res_u.client_using.na_r_addr);
res->SETCLIENTID4res_u.client_using.r_netid,
res->SETCLIENTID4res_u.client_using.r_addr);
break;
}
}
Expand All @@ -3037,9 +3037,9 @@ dtlres_setclid(void *obj)
break;
case NFS4ERR_CLID_INUSE:
sprintf(get_line(0, 0), "Used by Net ID = %s",
res->SETCLIENTID4res_u.client_using.na_r_netid);
res->SETCLIENTID4res_u.client_using.r_netid);
sprintf(get_line(0, 0), "Used by Addr = %s",
res->SETCLIENTID4res_u.client_using.na_r_addr);
res->SETCLIENTID4res_u.client_using.r_addr);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions usr/src/cmd/ucodeadm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
#
# Copyright 2017 RackTop Systems.
# Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
# Copyright 2023 Oxide Computer Company
#

PROG = ucodeadm

PROG_OBJS = ucodeadm.o ucode_errno.o
COMMON_OBJS = ucode_utils.o
COMMON_OBJS = ucode_utils_intel.o ucode_utils_amd.o
OBJS = $(PROG_OBJS) $(COMMON_OBJS)
COMMON_SRCDIR = ../../common/ucode
ERROR_HEADER = $(COMMON_SRCDIR)/ucode_errno.h
SRCS = $(PROG_OBJS:%.o=%.c) $(COMMON_OBJS:%.o=$(COMMON_SRCDIR)/%.c)

include ../Makefile.cmd
include ../Makefile.ctf
Expand Down
Loading

0 comments on commit b9f6ce3

Please sign in to comment.