Initial Commit
- initial default booting image
This commit is contained in:
63
package/shadow/Config.in
Normal file
63
package/shadow/Config.in
Normal file
@@ -0,0 +1,63 @@
|
||||
menuconfig BR2_PACKAGE_SHADOW
|
||||
bool "shadow"
|
||||
depends on !BR2_STATIC_LIBS
|
||||
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
|
||||
select BR2_PACKAGE_LIBXCRYPT if BR2_TOOLCHAIN_USES_GLIBC
|
||||
select BR2_PACKAGE_SHADOW_SHA_CRYPT if \
|
||||
(BR2_TARGET_GENERIC_PASSWD_SHA256 || \
|
||||
BR2_TARGET_GENERIC_PASSWD_SHA512)
|
||||
help
|
||||
Utilities to deal with user accounts.
|
||||
|
||||
https://github.com/shadow-maint/shadow
|
||||
|
||||
if BR2_PACKAGE_SHADOW
|
||||
|
||||
config BR2_PACKAGE_SHADOW_SHADOWGRP
|
||||
bool "shadowgrp"
|
||||
help
|
||||
Enable shadow group support.
|
||||
|
||||
config BR2_PACKAGE_SHADOW_ACCOUNT_TOOLS_SETUID
|
||||
bool "account-tools-setuid"
|
||||
depends on BR2_USE_MMU # linux-pam
|
||||
depends on BR2_ENABLE_LOCALE # linux-pam
|
||||
depends on BR2_USE_WCHAR # linux-pam
|
||||
depends on !BR2_STATIC_LIBS # linux-pam
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # linux-pam
|
||||
select BR2_PACKAGE_LINUX_PAM
|
||||
help
|
||||
Install the user and group management tools (e.g. groupadd)
|
||||
with setuid and authenticate the callers via PAM.
|
||||
|
||||
comment "account-tools-setuid needs a toolchain w/ dynamic library, wchar, locale, gcc >= 4.9"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR || \
|
||||
!BR2_ENABLE_LOCALE || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
|
||||
|
||||
config BR2_PACKAGE_SHADOW_SUBORDINATE_IDS
|
||||
bool "subordinate-ids"
|
||||
help
|
||||
Support subordinate ids. Helpful to use container solution
|
||||
like podman without root.
|
||||
|
||||
config BR2_PACKAGE_SHADOW_SHA_CRYPT
|
||||
bool "sha-crypt"
|
||||
default y
|
||||
help
|
||||
Allow the SHA256 and SHA512 password encryption algorithms.
|
||||
|
||||
config BR2_PACKAGE_SHADOW_BCRYPT
|
||||
bool "bcrypt"
|
||||
help
|
||||
Allow the bcrypt password encryption algorithm.
|
||||
|
||||
config BR2_PACKAGE_SHADOW_YESCRYPT
|
||||
bool "yescrypt"
|
||||
help
|
||||
Allow the yescrypt password encryption algorithm.
|
||||
|
||||
endif # BR2_PACKAGE_SHADOW
|
||||
|
||||
comment "shadow needs a toolchain w/ headers >= 4.14, dynamic library"
|
||||
depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 || BR2_STATIC_LIBS
|
||||
4
package/shadow/shadow.hash
Normal file
4
package/shadow/shadow.hash
Normal file
@@ -0,0 +1,4 @@
|
||||
# Verified from https://github.com/shadow-maint/shadow/releases/download/4.18.0/shadow-4.18.0.tar.xz.asc
|
||||
# with key 66D0387DB85D320F8408166DB175CFA98F192AF2
|
||||
sha256 add4604d3bc410344433122a819ee4154b79dd8316a56298c60417e637c07608 shadow-4.18.0.tar.xz
|
||||
sha256 3d25ab8f43fdc14624296a56ff8dc3e72e499ad35f32ae0c803f4959cfe17c0a COPYING
|
||||
161
package/shadow/shadow.mk
Normal file
161
package/shadow/shadow.mk
Normal file
@@ -0,0 +1,161 @@
|
||||
################################################################################
|
||||
#
|
||||
# shadow
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SHADOW_VERSION = 4.18.0
|
||||
SHADOW_SITE = https://github.com/shadow-maint/shadow/releases/download/$(SHADOW_VERSION)
|
||||
SHADOW_SOURCE = shadow-$(SHADOW_VERSION).tar.xz
|
||||
SHADOW_LICENSE = BSD-3-Clause
|
||||
SHADOW_LICENSE_FILES = COPYING
|
||||
SHADOW_CPE_ID_VENDOR = debian
|
||||
SHADOW_CONF_ENV = LIBS=$(TARGET_NLS_LIBS)
|
||||
|
||||
SHADOW_DEPENDENCIES = \
|
||||
host-pkgconf \
|
||||
$(TARGET_NLS_DEPENDENCIES)
|
||||
|
||||
SHADOW_CONF_OPTS = \
|
||||
--disable-man \
|
||||
--without-btrfs \
|
||||
--without-nscd \
|
||||
--without-skey \
|
||||
--without-sssd \
|
||||
--without-su \
|
||||
--without-tcb
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SHADOW_SHADOWGRP),y)
|
||||
SHADOW_CONF_OPTS += --enable-shadowgrp
|
||||
else
|
||||
SHADOW_CONF_OPTS += --disable-shadowgrp
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SHADOW_ACCOUNT_TOOLS_SETUID),y)
|
||||
SHADOW_CONF_OPTS += --enable-account-tools-setuid
|
||||
define SHADOW_ACCOUNT_TOOLS_SETUID_PERMISSIONS
|
||||
/usr/sbin/chgpasswd f 4755 0 0 - - - - -
|
||||
/usr/sbin/chpasswd f 4755 0 0 - - - - -
|
||||
/usr/sbin/groupadd f 4755 0 0 - - - - -
|
||||
/usr/sbin/groupdel f 4755 0 0 - - - - -
|
||||
/usr/sbin/groupmod f 4755 0 0 - - - - -
|
||||
/usr/sbin/newusers f 4755 0 0 - - - - -
|
||||
/usr/sbin/useradd f 4755 0 0 - - - - -
|
||||
/usr/sbin/userdel f 4755 0 0 - - - - -
|
||||
/usr/sbin/usermod f 4755 0 0 - - - - -
|
||||
endef
|
||||
else
|
||||
SHADOW_CONF_OPTS += --disable-account-tools-setuid
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SHADOW_SUBORDINATE_IDS),y)
|
||||
SHADOW_INSTALL_STAGING = YES
|
||||
SHADOW_CONF_OPTS += --enable-subordinate-ids
|
||||
define SHADOW_SUBORDINATE_IDS_PERMISSIONS
|
||||
/usr/bin/newuidmap f 4755 0 0 - - - - -
|
||||
/usr/bin/newgidmap f 4755 0 0 - - - - -
|
||||
endef
|
||||
else
|
||||
SHADOW_CONF_OPTS += --disable-subordinate-ids
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ACL),y)
|
||||
SHADOW_CONF_OPTS += --with-acl
|
||||
SHADOW_DEPENDENCIES += acl
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-acl
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ATTR),y)
|
||||
SHADOW_CONF_OPTS += --with-attr
|
||||
SHADOW_DEPENDENCIES += attr
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-attr
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_AUDIT),y)
|
||||
SHADOW_CONF_OPTS += --with-audit
|
||||
SHADOW_DEPENDENCIES += audit
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-audit
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_CRACKLIB),y)
|
||||
SHADOW_CONF_OPTS += --with-libcrack
|
||||
SHADOW_DEPENDENCIES += cracklib
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-libcrack
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBSELINUX)$(BR2_PACKAGE_LIBSEMANAGE),yy)
|
||||
SHADOW_CONF_OPTS += --with-selinux
|
||||
SHADOW_DEPENDENCIES += libselinux libsemanage
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-selinux
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
|
||||
SHADOW_DEPENDENCIES += libxcrypt
|
||||
endif
|
||||
|
||||
# linux-pam is also used without account-tools-setuid enabled
|
||||
ifeq ($(BR2_PACKAGE_LINUX_PAM),y)
|
||||
SHADOW_CONF_OPTS += --with-libpam
|
||||
SHADOW_DEPENDENCIES += linux-pam
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-libpam
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SHADOW_SHA_CRYPT),y)
|
||||
SHADOW_CONF_OPTS += --with-sha-crypt
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-sha-crypt
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SHADOW_BCRYPT),y)
|
||||
SHADOW_CONF_OPTS += --with-bcrypt
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-bcrypt
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SHADOW_YESCRYPT),y)
|
||||
SHADOW_CONF_OPTS += --with-yescrypt
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-yescrypt
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_LIBBSD),y)
|
||||
SHADOW_CONF_OPTS += --with-libbsd
|
||||
SHADOW_DEPENDENCIES += libbsd
|
||||
else
|
||||
SHADOW_CONF_OPTS += --without-libbsd
|
||||
endif
|
||||
|
||||
define SHADOW_PERMISSIONS
|
||||
/usr/bin/chage f 4755 0 0 - - - - -
|
||||
/usr/bin/chfn f 4755 0 0 - - - - -
|
||||
/usr/bin/chsh f 4755 0 0 - - - - -
|
||||
/usr/bin/expiry f 4755 0 0 - - - - -
|
||||
/usr/bin/gpasswd f 4755 0 0 - - - - -
|
||||
/usr/bin/newgrp f 4755 0 0 - - - - -
|
||||
/usr/bin/passwd f 4755 0 0 - - - - -
|
||||
$(SHADOW_ACCOUNT_TOOLS_SETUID_PERMISSIONS)
|
||||
$(SHADOW_SUBORDINATE_IDS_PERMISSIONS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_TARGET_GENERIC_PASSWD_SHA256),y)
|
||||
SHADOW_ENCRYPT_METHOD = SHA256
|
||||
else ifeq ($(BR2_TARGET_GENERIC_PASSWD_SHA512),y)
|
||||
SHADOW_ENCRYPT_METHOD = SHA512
|
||||
endif
|
||||
|
||||
ifneq ($(SHADOW_ENCRYPT_METHOD),)
|
||||
define SHADOW_SET_ENCRYPT_METHOD
|
||||
$(SED) 's/^[#]\?ENCRYPT_METHOD .*/ENCRYPT_METHOD $(SHADOW_ENCRYPT_METHOD)/' \
|
||||
$(TARGET_DIR)/etc/login.defs
|
||||
endef
|
||||
|
||||
SHADOW_POST_INSTALL_TARGET_HOOKS += SHADOW_SET_ENCRYPT_METHOD
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user