Merge pull request #5453 from antonlacon/le11-passwd

buildsystem: cleanup password hashing; drop busybox:host
This commit is contained in:
CvH 2021-10-03 08:00:41 +02:00 committed by GitHub
commit 8d6e4ac9a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1193 deletions

View File

@ -1496,6 +1496,8 @@ add_user() {
PASSWORD="$2"
if [ "$PASSWORD" = "x" ]; then
PASSWORD="*"
else
PASSWORD=$(python -c "import crypt; print(crypt.crypt('$PASSWORD', crypt.mksalt(crypt.METHOD_SHA512)))")
fi
if ! grep -q "^$1:" ${INSTALL}/usr/cache/shadow; then
echo "$1:$PASSWORD:::::::" >> ${INSTALL}/usr/cache/shadow

File diff suppressed because it is too large Load Diff

View File

@ -8,8 +8,7 @@ PKG_SHA256="9d57c4bd33974140fd4111260468af22856f12f5b5ef7c70c8d9b75c712a0dee"
PKG_LICENSE="GPL"
PKG_SITE="http://www.busybox.net"
PKG_URL="https://busybox.net/downloads/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
PKG_DEPENDS_HOST="toolchain:host"
PKG_DEPENDS_TARGET="toolchain busybox:host hdparm dosfstools e2fsprogs zip usbutils parted procps-ng gptfdisk libtirpc"
PKG_DEPENDS_TARGET="toolchain hdparm dosfstools e2fsprogs zip usbutils parted procps-ng gptfdisk libtirpc"
PKG_DEPENDS_INIT="toolchain libtirpc"
PKG_LONGDESC="BusyBox combines tiny versions of many common UNIX utilities into a single small executable."
# busybox fails to build with GOLD support enabled with binutils-2.25
@ -40,13 +39,6 @@ pre_build_target() {
cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${TARGET_NAME}
}
pre_build_host() {
PKG_MAKE_OPTS_HOST="ARCH=${TARGET_ARCH} CROSS_COMPILE= KBUILD_VERBOSE=1 install"
mkdir -p ${PKG_BUILD}/.${HOST_NAME}
cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${HOST_NAME}
}
pre_build_init() {
PKG_MAKE_OPTS_INIT="ARCH=${TARGET_ARCH} \
HOSTCC=${HOST_CC} \
@ -58,16 +50,6 @@ pre_build_init() {
cp -RP ${PKG_BUILD}/* ${PKG_BUILD}/.${TARGET_NAME}-init
}
configure_host() {
cd ${PKG_BUILD}/.${HOST_NAME}
cp ${PKG_DIR}/config/busybox-host.conf .config
# set install dir
sed -i -e "s|^CONFIG_PREFIX=.*$|CONFIG_PREFIX=\"${PKG_BUILD}/.install_host\"|" .config
make oldconfig
}
configure_target() {
cd ${PKG_BUILD}/.${TARGET_NAME}
find_file_path config/busybox-target.conf
@ -115,11 +97,6 @@ configure_init() {
make oldconfig
}
makeinstall_host() {
mkdir -p ${TOOLCHAIN}/bin
cp -R ${PKG_BUILD}/.install_host/bin/* ${TOOLCHAIN}/bin
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
if [ ${TARGET_ARCH} = x86_64 ]; then
@ -180,12 +157,10 @@ makeinstall_target() {
}
post_install() {
ROOT_PWD="$(${TOOLCHAIN}/bin/cryptpw -m sha512 ${ROOT_PASSWORD})"
echo "chmod 4755 ${INSTALL}/usr/bin/busybox" >> ${FAKEROOT_SCRIPT}
echo "chmod 000 ${INSTALL}/usr/cache/shadow" >> ${FAKEROOT_SCRIPT}
add_user root "${ROOT_PWD}" 0 0 "Root User" "/storage" "/bin/sh"
add_user root "${ROOT_PASSWORD}" 0 0 "Root User" "/storage" "/bin/sh"
add_group root 0
add_group users 100