Merge pull request #23377 from nabijaczleweli/shopt

Fix shopt in 90-loaderentry, don't not lint kernel-install, respect `$TMPDIR`
This commit is contained in:
Yu Watanabe 2022-05-16 18:17:14 +09:00 committed by GitHub
commit 27408ef878
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -36,11 +36,9 @@ jobs:
# Excludes:
# - man/.* - all snippets in man pages (false positives due to
# missing shebangs)
# - kernel-install/.* - false-positives for dropins (and I'm afraid
# to touch kernel-install)
# - .*\.(in|SKELETON) - all template/skeleton files
# - tools/coverity\.sh - external file (with some modifications)
FILTER_REGEX_EXCLUDE: .*/(man/.*|src/kernel-install/.*|.*\.(in|SKELETON)|tools/coverity\.sh)$
FILTER_REGEX_EXCLUDE: .*/(man/.*|.*\.(in|SKELETON)|tools/coverity\.sh)$
VALIDATE_ALL_CODEBASE: false
VALIDATE_BASH: true
VALIDATE_GITHUB_ACTIONS: true

View file

@ -18,8 +18,6 @@
# You should have received a copy of the GNU Lesser General Public License
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
shopt -s nullglob
COMMAND="$1"
KERNEL_VERSION="$2"
ENTRY_DIR_ABS="$3"
@ -36,7 +34,7 @@ BOOT_MNT="$(stat -c %m "$BOOT_ROOT")"
if [ "$BOOT_MNT" = '/' ]; then
ENTRY_DIR="$ENTRY_DIR_ABS"
else
ENTRY_DIR="${ENTRY_DIR_ABS#$BOOT_MNT}"
ENTRY_DIR="${ENTRY_DIR_ABS#"$BOOT_MNT"}"
fi
case "$COMMAND" in
@ -55,8 +53,10 @@ case "$COMMAND" in
esac
if [ -r /etc/os-release ]; then
# shellcheck source=/dev/null
. /etc/os-release
elif [ -r /usr/lib/os-release ]; then
# shellcheck source=/dev/null
. /usr/lib/os-release
fi
@ -105,9 +105,10 @@ install -g root -o root -m 0644 "$KERNEL_IMAGE" "$ENTRY_DIR_ABS/linux" || {
}
shift "$INITRD_OPTIONS_SHIFT"
# All files listed as arguments, and staged files called "initrd*" are installed as initrds.
# All files listed as arguments, and staged files starting with "initrd" are installed as initrds.
for initrd in "$@" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
[ -f "$initrd" ] || {
[ "$initrd" = "${KERNEL_INSTALL_STAGING_AREA}/initrd*" ] && continue
echo "Error: initrd '$initrd' not a file." >&2
exit 1
}
@ -139,6 +140,7 @@ mkdir -p "${LOADER_ENTRY%/*}" || {
have_initrd=
for initrd in "${@}" "${KERNEL_INSTALL_STAGING_AREA}"/initrd*; do
[ -f "$initrd" ] || continue
echo "initrd $ENTRY_DIR/${initrd##*/}"
have_initrd=yes
done

View file

@ -204,7 +204,7 @@ cleanup() {
trap cleanup EXIT
KERNEL_INSTALL_STAGING_AREA="$(mktemp -d -t -p /tmp kernel-install.staging.XXXXXXX)"
KERNEL_INSTALL_STAGING_AREA="$(mktemp -d -t kernel-install.staging.XXXXXXX)"
export KERNEL_INSTALL_MACHINE_ID="$MACHINE_ID"
export KERNEL_INSTALL_ENTRY_TOKEN="$ENTRY_TOKEN"