#!/bin/bash if hash busybox; then # copy busybox to NEWROOT unless one exists at the expected path. bb_target_path="/opt/openslx/bin/busybox" bb_source_path="$(type -p busybox)" if [ -n "$bb_source_path" ] && [ ! -x "${NEWROOT}${bb_target_path}" ]; then mkdir -p "${NEWROOT}"/opt/openslx/{s,}bin cp -f "$bb_source_path" "${NEWROOT}${bb_target_path}" # --list-full gives {s,}bin prefixes for app in $(busybox --list-full); do ln -s "$bb_target_path" "${NEWROOT}/opt/openslx/$app" done fi # compat: /bin/ash if not exists if [ ! -e "${NEWROOT}/bin/ash" ]; then # either dead symlink or nothing there. ln -sf "$bb_target_path" "${NEWROOT}/bin/ash" else # either valid symlink or binary, log it and ignore. type -p warn &>/dev/null || . /lib/dracut-lib.sh warn "'/bin/ash' is a valid symlink or binary, ignoring." fi fi true