Unbreak BeagleBone Black boot by collapsing 29 SYSINITs in to 1

Reported by:	ilya at bakulin.de
This commit is contained in:
mmacy 2018-05-19 07:31:35 +00:00
parent 36a5772d1a
commit d365279c38

View File

@ -53,38 +53,73 @@ __FBSDID("$FreeBSD$");
#ifdef _KERNEL
#define assert(exp) KASSERT((exp), ("%s:%u", __func__, __LINE__))
CAP_RIGHTS_DEFINE1(cap_accept_rights, CAP_ACCEPT);
CAP_RIGHTS_DEFINE1(cap_bind_rights, CAP_BIND);
CAP_RIGHTS_DEFINE1(cap_connect_rights, CAP_CONNECT);
CAP_RIGHTS_DEFINE1(cap_event_rights, CAP_EVENT);
CAP_RIGHTS_DEFINE1(cap_fchdir_rights, CAP_FCHDIR);
CAP_RIGHTS_DEFINE1(cap_fcntl_rights, CAP_FCNTL);
CAP_RIGHTS_DEFINE1(cap_fexecve_rights, CAP_FEXECVE);
CAP_RIGHTS_DEFINE1(cap_flock_rights, CAP_FLOCK);
CAP_RIGHTS_DEFINE1(cap_fpathconf_rights, CAP_FPATHCONF);
CAP_RIGHTS_DEFINE1(cap_fstat_rights, CAP_FSTAT);
CAP_RIGHTS_DEFINE1(cap_fsync_rights, CAP_FSYNC);
CAP_RIGHTS_DEFINE1(cap_ftruncate_rights, CAP_FTRUNCATE);
CAP_RIGHTS_DEFINE1(cap_getpeername_rights, CAP_GETPEERNAME);
CAP_RIGHTS_DEFINE1(cap_getsockname_rights, CAP_GETSOCKNAME);
CAP_RIGHTS_DEFINE1(cap_getsockopt_rights, CAP_GETSOCKOPT);
CAP_RIGHTS_DEFINE1(cap_ioctl_rights, CAP_IOCTL);
CAP_RIGHTS_DEFINE1(cap_listen_rights, CAP_LISTEN);
CAP_RIGHTS_DEFINE1(cap_mmap_rights, CAP_MMAP);
CAP_RIGHTS_DEFINE1(cap_pdgetpid_rights, CAP_PDGETPID);
CAP_RIGHTS_DEFINE1(cap_pdkill_rights, CAP_PDKILL);
CAP_RIGHTS_DEFINE1(cap_pread_rights, CAP_PREAD);
CAP_RIGHTS_DEFINE1(cap_pwrite_rights, CAP_PWRITE);
CAP_RIGHTS_DEFINE1(cap_read_rights, CAP_READ);
CAP_RIGHTS_DEFINE1(cap_recv_rights, CAP_RECV);
CAP_RIGHTS_DEFINE1(cap_send_rights, CAP_SEND);
CAP_RIGHTS_DEFINE1(cap_setsockopt_rights, CAP_SETSOCKOPT);
CAP_RIGHTS_DEFINE1(cap_shutdown_rights, CAP_SHUTDOWN);
CAP_RIGHTS_DEFINE1(cap_write_rights, CAP_WRITE);
__read_mostly cap_rights_t cap_accept_rights;
__read_mostly cap_rights_t cap_bind_rights;
__read_mostly cap_rights_t cap_connect_rights;
__read_mostly cap_rights_t cap_event_rights;
__read_mostly cap_rights_t cap_fchdir_rights;
__read_mostly cap_rights_t cap_fcntl_rights;
__read_mostly cap_rights_t cap_fexecve_rights;
__read_mostly cap_rights_t cap_flock_rights;
__read_mostly cap_rights_t cap_fpathconf_rights;
__read_mostly cap_rights_t cap_fstat_rights;
__read_mostly cap_rights_t cap_ftruncate_rights;
__read_mostly cap_rights_t cap_getpeername_rights;
__read_mostly cap_rights_t cap_getsockopt_rights;
__read_mostly cap_rights_t cap_getsockname_rights;
__read_mostly cap_rights_t cap_ioctl_rights;
__read_mostly cap_rights_t cap_listen_rights;
__read_mostly cap_rights_t cap_mmap_rights;
__read_mostly cap_rights_t cap_no_rights;
CAP_RIGHTS_SYSINIT0(cap_no_rights, cap_no_rights);
__read_mostly cap_rights_t cap_fsync_rights;
__read_mostly cap_rights_t cap_pdgetpid_rights;
__read_mostly cap_rights_t cap_pdkill_rights;
__read_mostly cap_rights_t cap_pread_rights;
__read_mostly cap_rights_t cap_pwrite_rights;
__read_mostly cap_rights_t cap_read_rights;
__read_mostly cap_rights_t cap_recv_rights;
__read_mostly cap_rights_t cap_send_rights;
__read_mostly cap_rights_t cap_setsockopt_rights;
__read_mostly cap_rights_t cap_shutdown_rights;
__read_mostly cap_rights_t cap_write_rights;
__read_mostly cap_rights_t cap_no_rights;
static void
__cap_rights_sysinit1(void *arg)
{
cap_rights_init(&cap_accept_rights, CAP_ACCEPT);
cap_rights_init(&cap_bind_rights, CAP_BIND);
cap_rights_init(&cap_connect_rights, CAP_CONNECT);
cap_rights_init(&cap_event_rights, CAP_EVENT);
cap_rights_init(&cap_fchdir_rights, CAP_FCHDIR);
cap_rights_init(&cap_fcntl_rights, CAP_FCNTL);
cap_rights_init(&cap_fexecve_rights, CAP_FEXECVE);
cap_rights_init(&cap_flock_rights, CAP_FLOCK);
cap_rights_init(&cap_fpathconf_rights, CAP_FPATHCONF);
cap_rights_init(&cap_fstat_rights, CAP_FSTAT);
cap_rights_init(&cap_fsync_rights, CAP_FSYNC);
cap_rights_init(&cap_ftruncate_rights, CAP_FTRUNCATE);
cap_rights_init(&cap_getpeername_rights, CAP_GETPEERNAME);
cap_rights_init(&cap_getsockname_rights, CAP_GETSOCKNAME);
cap_rights_init(&cap_getsockopt_rights, CAP_GETSOCKOPT);
cap_rights_init(&cap_ioctl_rights, CAP_IOCTL);
cap_rights_init(&cap_listen_rights, CAP_LISTEN);
cap_rights_init(&cap_mmap_rights, CAP_MMAP);
cap_rights_init(&cap_pdgetpid_rights, CAP_PDGETPID);
cap_rights_init(&cap_pdkill_rights, CAP_PDKILL);
cap_rights_init(&cap_pread_rights, CAP_PREAD);
cap_rights_init(&cap_pwrite_rights, CAP_PWRITE);
cap_rights_init(&cap_read_rights, CAP_READ);
cap_rights_init(&cap_recv_rights, CAP_RECV);
cap_rights_init(&cap_send_rights, CAP_SEND);
cap_rights_init(&cap_setsockopt_rights, CAP_SETSOCKOPT);
cap_rights_init(&cap_shutdown_rights, CAP_SHUTDOWN);
cap_rights_init(&cap_write_rights, CAP_WRITE);
cap_rights_init(&cap_no_rights);
}
SYSINIT(cap_rights1_sysinit, SI_SUB_COPYRIGHT, SI_ORDER_ANY, \
__cap_rights_sysinit1, NULL);
#endif
#define CAPARSIZE_MIN (CAP_RIGHTS_VERSION_00 + 2)