Add various patches for compatibility and improvements across multiple projects

- Introduced BSD tooling compatibility patch for Linux kernel, modifying header dependency handling and export checks in KVM.
- Updated MLIR project to ensure generated headers are correctly located and dependencies are managed for various tools.
- Enhanced ncurses configuration to support wide-character handling, ensuring proper header generation and compatibility.
- Modified GNU parallel to use POSIX compliant shell, ensuring broader compatibility across different environments.
- Fixed capability name handling in procps-ng by replacing echo with printf for better formatting.
- Adjusted util-linux build system to support byacc alongside bison, improving parser generation and flexibility.
This commit is contained in:
2026-07-10 19:15:34 -05:00
parent accdf3d3fb
commit 4f914253b7
9 changed files with 2130 additions and 0 deletions
+997
View File
@@ -0,0 +1,997 @@
diff --git a/configure b/configure
index 142d72b..b7a3d07 100755
--- a/configure
+++ b/configure
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# We don't support srcdir != builddir
echo \#buildapi-variable-no-builddir > /dev/null
@@ -23,9 +23,9 @@ CC="${CC:-cc}"
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
# set configprofile based on ID and ID_LIKE from os-release
-if [[ -f /etc/os-release ]]; then
+if [ -f /etc/os-release ]; then
. /etc/os-release
-elif [[ -f /usr/lib/os-release ]]; then
+elif [ -f /usr/lib/os-release ]; then
. /usr/lib/os-release
fi
@@ -51,19 +51,20 @@ read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
- local rematch='^[^=]*=(.*)$'
- if [[ $2 =~ $rematch ]]; then
- read -r "$1" <<< "${BASH_REMATCH[1]}"
+ if [ "${2#*=}" != "$2" ]; then
+ value=${2#*=}
else
- read -r "$1" <<< "$3"
+ value=$3
# There is no way to shift our callers args, so
# return 1 to indicate they should do it instead.
+ eval "$1=\$value"
return 1
fi
+ eval "$1=\$value"
return 0
}
-while (($# > 0)); do
+while [ "$#" -gt 0 ]; do
case "${1%%=*}" in
--prefix) read_arg prefix "$@" || shift ;;
--libdir) read_arg libdir "$@" || shift ;;
@@ -98,7 +99,7 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
exit 1
fi
-if ! ${CC} -c -o /dev/null /dev/null &> /dev/null; then
+if ! ${CC} -c -o /dev/null /dev/null > /dev/null 2>&1; then
echo "dracut needs a C compiler (${CC} not found)." >&2
exit 1
fi
@@ -200,7 +201,7 @@ ret=$?
rm -f weakdep_test.c a.out
if test $ret -eq 0; then
- KMOD_CFLAGS_EXTRA+=" -DCONFIG_WEAKDEP"
+ KMOD_CFLAGS_EXTRA="${KMOD_CFLAGS_EXTRA-} -DCONFIG_WEAKDEP"
fi
cat > Makefile.inc.$$ << EOF
@@ -225,16 +226,16 @@ SYSTEMD_LIBS ?= $(${PKG_CONFIG} --silence-errors --libs "libsystemd >= 257")
EOF
{
- [[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
- [[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
- [[ $includedir ]] && echo "includedir ?= ${includedir}"
- [[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
- [[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
- [[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
- [[ $infodir ]] && echo "infodir ?= ${infodir}"
- [[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
- [[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
- [[ $configprofile ]] && echo "configprofile ?= ${configprofile}"
+ [ -n "$programprefix" ] && echo "programprefix ?= ${programprefix}"
+ [ -n "$execprefix" ] && echo "execprefix ?= ${execprefix}"
+ [ -n "$includedir" ] && echo "includedir ?= ${includedir}"
+ [ -n "$libexecdir" ] && echo "libexecdir ?= ${libexecdir}"
+ [ -n "$localstatedir" ] && echo "localstatedir ?= ${localstatedir}"
+ [ -n "$sharedstatedir" ] && echo "sharedstatedir ?= ${sharedstatedir}"
+ [ -n "$infodir" ] && echo "infodir ?= ${infodir}"
+ [ -n "$systemdsystemunitdir" ] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
+ [ -n "$bashcompletiondir" ] && echo "bashcompletiondir ?= ${bashcompletiondir}"
+ [ -n "$configprofile" ] && echo "configprofile ?= ${configprofile}"
} >> Makefile.inc.$$
mv Makefile.inc.$$ Makefile.inc
diff --git a/dracut-catimages.sh b/dracut-catimages.sh
index 608fb49..754894c 100755
--- a/dracut-catimages.sh
+++ b/dracut-catimages.sh
@@ -1,4 +1,4 @@
-#!/bin/bash --norc
+#!/bin/sh
#
# Copyright 2009 Red Hat, Inc. All rights reserved.
#
@@ -17,7 +17,7 @@
#
dinfo() {
- [[ $beverbose ]] && echo "$@" >&2
+ [ -n "$beverbose" ] && echo "$@" >&2
}
derror() {
@@ -47,7 +47,7 @@ EOF
imagedir=/var/lib/dracut/images
overlay=/var/lib/dracut/overlay
-while (($# > 0)); do
+while [ "$#" -gt 0 ]; do
case $1 in
-f | --force) force=yes ;;
-i | --imagedir)
@@ -83,7 +83,7 @@ done
outfile=$1
shift
-if [[ -z $outfile ]]; then
+if [ -z "$outfile" ]; then
derror "No output file specified."
usage
exit 1
@@ -92,32 +92,32 @@ fi
baseimage=$1
shift
-if [[ -z $baseimage ]]; then
+if [ -z "$baseimage" ]; then
derror "No base image specified."
usage
exit 1
fi
-if [[ -f $outfile && ! $force ]]; then
+if [ -f "$outfile" ] && [ -z "$force" ]; then
derror "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
-if [[ ! $no_imagedir && ! -d $imagedir ]]; then
+if [ -z "$no_imagedir" ] && [ ! -d "$imagedir" ]; then
derror "Image directory $imagedir is not a directory"
exit 1
fi
-if [[ ! $no_overlay && ! -d $overlay ]]; then
+if [ -z "$no_overlay" ] && [ ! -d "$overlay" ]; then
derror "Overlay $overlay is not a directory"
exit 1
fi
-if [[ ! $no_overlay ]]; then
- if [[ ! $no_imagedir ]]; then
+if [ -z "$no_overlay" ]; then
+ if [ -z "$no_imagedir" ]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
- type pigz &> /dev/null && gzip=pigz || gzip=gzip
+ command -v pigz > /dev/null 2>&1 && gzip=pigz || gzip=gzip
(
cd "$overlay" || return 1
find . | cpio --quiet -H newc -o | $gzip -9 > "$ofile"
@@ -127,18 +127,18 @@ if [[ ! $no_overlay ]]; then
fi
fi
-if [[ ! $no_imagedir ]]; then
+dinfo "Using base image $baseimage"
+cat -- "$baseimage" > "$outfile"
+
+if [ -z "$no_imagedir" ]; then
for i in "$imagedir/"*.img; do
- [[ -f $i ]] && images+=("$i")
+ [ -f "$i" ] || continue
+ dinfo "Appending $i"
+ cat -- "$i" >> "$outfile"
done
fi
-images+=("$@")
-
-dinfo "Using base image $baseimage"
-cat -- "$baseimage" > "$outfile"
-
-for i in "${images[@]}"; do
+for i in "$@"; do
dinfo "Appending $i"
cat -- "$i" >> "$outfile"
done
diff --git a/dracut-initramfs-restore.sh b/dracut-initramfs-restore.sh
index 828edca..1e82422 100755
--- a/dracut-initramfs-restore.sh
+++ b/dracut-initramfs-restore.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
set -e
@@ -13,19 +13,18 @@ trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM
KERNEL_VERSION="$(uname -r)"
-[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
+[ -n "$dracutbasedir" ] || dracutbasedir=/usr/lib/dracut
SKIP="$dracutbasedir/skipcpio"
-[[ -x $SKIP ]] || SKIP="cat"
+[ -x "$SKIP" ] || SKIP="cat"
find_initrd_for_kernel_version() {
- local kernel_version="$1"
- local base_path files initrd machine_id
+ kernel_version=$1
- if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
+ if [ -d /efi/Default ] || [ -d /boot/Default ] || [ -d /boot/efi/Default ]; then
machine_id="Default"
- elif [[ -s /etc/machine-id ]]; then
+ elif [ -s /etc/machine-id ]; then
read -r machine_id < /etc/machine-id
- [[ $machine_id == "uninitialized" ]] && machine_id="Default"
+ [ "$machine_id" = "uninitialized" ] && machine_id="Default"
else
machine_id="Default"
fi
@@ -40,27 +39,26 @@ find_initrd_for_kernel_version() {
done
fi
- if [[ -f /lib/modules/${kernel_version}/initrd ]]; then
+ if [ -f "/lib/modules/${kernel_version}/initrd" ]; then
echo "/lib/modules/${kernel_version}/initrd"
- elif [[ -f /boot/initramfs-${kernel_version}.img ]]; then
+ elif [ -f "/boot/initramfs-${kernel_version}.img" ]; then
echo "/boot/initramfs-${kernel_version}.img"
else
- files=(/boot/initr*"${kernel_version}"*)
- if [ "${#files[@]}" -ge 1 ] && [ -e "${files[0]}" ]; then
- echo "${files[0]}"
- fi
+ for initrd in /boot/initr*"${kernel_version}"*; do
+ [ -e "$initrd" ] && echo "$initrd" && return
+ done
fi
}
-mount -o ro /boot &> /dev/null || true
+mount -o ro /boot > /dev/null 2>&1 || true
IMG=$(find_initrd_for_kernel_version "$KERNEL_VERSION")
if [ -z "$IMG" ]; then
- if [[ -f /boot/initramfs-linux.img ]]; then
+ if [ -f /boot/initramfs-linux.img ]; then
IMG="/boot/initramfs-linux.img"
- elif [[ -f /boot/initrd.img ]]; then
+ elif [ -f /boot/initrd.img ]; then
IMG="/boot/initrd.img"
- elif [[ -f /initrd.img ]]; then
+ elif [ -f /initrd.img ]; then
IMG="/initrd.img"
else
echo "No initramfs image found to restore!"
@@ -85,13 +83,13 @@ else
exit 1
fi
-if [[ -f squashfs-root.img ]]; then
+if [ -f squashfs-root.img ]; then
if ! unsquashfs -no-xattrs -f -d . squashfs-root.img > /dev/null; then
echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2
rm -f -- /run/initramfs/shutdown
exit 1
fi
-elif [[ -f erofs-root.img ]]; then
+elif [ -f erofs-root.img ]; then
if ! fsck.erofs --extract=. --overwrite erofs-root.img > /dev/null; then
echo "Squash module is enabled for this initramfs but failed to unpack erofs-root.img" >&2
rm -f -- /run/initramfs/shutdown
@@ -102,7 +100,7 @@ fi
if grep -qs -w selinux /sys/kernel/security/lsm \
&& [ -e /etc/selinux/config ] && [ -x /usr/sbin/setfiles ]; then
. /etc/selinux/config
- if [[ $SELINUX != "disabled" && -n $SELINUXTYPE ]]; then
+ if [ "$SELINUX" != "disabled" ] && [ -n "$SELINUXTYPE" ]; then
/usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
fi
fi
diff --git a/install.d/50-dracut.install b/install.d/50-dracut.install
index 14f8772..6865ac8 100755
--- a/install.d/50-dracut.install
+++ b/install.d/50-dracut.install
@@ -1,4 +1,6 @@
-#!/bin/bash
+#!/bin/sh
+
+set -f
COMMAND="${1:?}"
KERNEL_VERSION="${2:?}"
@@ -7,16 +9,16 @@ BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
# If the initrd was provided on the kernel command line, we shouldn't generate our own.
-if [[ "$COMMAND" != "add" || "$#" -gt 4 ]]; then
+if [ "$COMMAND" != "add" ] || [ "$#" -gt 4 ]; then
exit 0
fi
# Do not attempt to create initramfs if the supplied image is already a UKI
-if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then
+if [ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]; then
exit 0
fi
-if [[ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" = "dracut" ]]; then
+if [ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" = "dracut" ]; then
# We are the initrd generator
IMAGE="initrd"
UEFI_OPTS="--no-uefi"
@@ -24,16 +26,16 @@ else
exit 0
fi
-if [[ "$KERNEL_INSTALL_UKI_GENERATOR" = "dracut" ]]; then
+if [ "$KERNEL_INSTALL_UKI_GENERATOR" = "dracut" ]; then
# We are chosen to generate the UKI as well as initrd
IMAGE="uki.efi"
UEFI_OPTS="--uefi"
fi
-if [[ -f ${KERNEL_IMAGE%/*}/$IMAGE ]]; then
+if [ -f "${KERNEL_IMAGE%/*}/$IMAGE" ]; then
# we found an initrd or uki.efi at the same place as the kernel
# use this and don't generate a new one
- [[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo \
+ [ "$KERNEL_INSTALL_VERBOSE" = 1 ] && echo \
"There is an $IMAGE image at the same place as the kernel, skipping generating a new one"
cp --reflink=auto "${KERNEL_IMAGE%/*}/$IMAGE" "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" \
&& chown root:root "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" \
@@ -42,38 +44,39 @@ if [[ -f ${KERNEL_IMAGE%/*}/$IMAGE ]]; then
fi
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
- if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
- read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
- fi
-elif [[ -f /etc/kernel/cmdline ]]; then
- read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
-elif [[ -f /usr/lib/kernel/cmdline ]]; then
- read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
+ cmdline="$KERNEL_INSTALL_CONF_ROOT/cmdline"
+elif [ -f /etc/kernel/cmdline ]; then
+ cmdline=/etc/kernel/cmdline
+elif [ -f /usr/lib/kernel/cmdline ]; then
+ cmdline=/usr/lib/kernel/cmdline
else
- declare -a BOOT_OPTIONS
+ cmdline=/proc/cmdline
+fi
- read -r -d '' -a line < /proc/cmdline
- for i in "${line[@]}"; do
- [[ ${i#initrd=*} != "$i" ]] && continue
- BOOT_OPTIONS+=("$i")
+BOOT_OPTIONS=
+if [ -f "$cmdline" ]; then
+ for i in $(cat "$cmdline"); do
+ case $i in
+ initrd=*) ;;
+ *) BOOT_OPTIONS="${BOOT_OPTIONS}${BOOT_OPTIONS:+ }$i" ;;
+ esac
done
fi
unset noimageifnotneeded
-for ((i = 0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
- # shellcheck disable=SC1001
- if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
+for i in $BOOT_OPTIONS; do
+ case $i in
+ root=PARTUUID=*)
noimageifnotneeded="yes"
break
- fi
+ ;;
+ esac
done
-# shellcheck disable=SC2046
-dracut -f \
- ${noimageifnotneeded:+--noimageifnotneeded} \
- $([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
- $([[ -n $KERNEL_IMAGE ]] && echo --kernel-image "$KERNEL_IMAGE") \
- "$UEFI_OPTS" \
- --kver "$KERNEL_VERSION" \
- "$KERNEL_INSTALL_STAGING_AREA/$IMAGE" || exit 1
+set -- dracut -f
+[ -n "$noimageifnotneeded" ] && set -- "$@" --noimageifnotneeded
+[ "$KERNEL_INSTALL_VERBOSE" = 1 ] && set -- "$@" --verbose
+[ -n "$KERNEL_IMAGE" ] && set -- "$@" --kernel-image "$KERNEL_IMAGE"
+set -- "$@" "$UEFI_OPTS" --kver "$KERNEL_VERSION" "$KERNEL_INSTALL_STAGING_AREA/$IMAGE"
+"$@" || exit 1
diff --git a/install.d/51-dracut-rescue.install b/install.d/51-dracut-rescue.install
index f49d7a7..701e5e8 100755
--- a/install.d/51-dracut-rescue.install
+++ b/install.d/51-dracut-rescue.install
@@ -1,6 +1,7 @@
-#!/bin/bash
+#!/bin/sh
export LANG=C
+set -f
COMMAND="${1:?}"
KERNEL_VERSION="${2:?}"
@@ -8,19 +9,19 @@ BOOT_DIR_ABS="${3%/*}/0-rescue"
KERNEL_IMAGE="$4"
# If the initrd was provided on the kernel command line, we shouldn't generate our own.
-if [[ "$COMMAND" = "add" && "$#" -gt 4 ]]; then
+if [ "$COMMAND" = "add" ] && [ "$#" -gt 4 ]; then
exit 0
fi
# Do not attempt to create initramfs if the supplied image is already a UKI
-if [[ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]]; then
+if [ "$KERNEL_INSTALL_IMAGE_TYPE" = "uki" ]; then
exit 0
fi
-if [[ "$KERNEL_INSTALL_UKI_GENERATOR" = "dracut" ]]; then
+if [ "$KERNEL_INSTALL_UKI_GENERATOR" = "dracut" ]; then
# Rescue images currently not compatible with UKIs
exit 0
-elif [[ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]]; then
+elif [ "${KERNEL_INSTALL_INITRD_GENERATOR:-dracut}" != "dracut" ]; then
# We are not the initrd generator
exit 0
fi
@@ -28,19 +29,17 @@ fi
dropindirs_sort() {
suffix=$1
shift
- args=("$@")
files=$(
- while (($# > 0)); do
- for i in "${1}"/*"${suffix}"; do
- [[ -f $i ]] && echo "${i##*/}"
+ for d in "$@"; do
+ for i in "$d"/*"${suffix}"; do
+ [ -f "$i" ] && echo "${i##*/}"
done
- shift
done | sort -Vu
)
for f in $files; do
- for d in "${args[@]}"; do
- if [[ -f "$d/$f" ]]; then
+ for d in "$@"; do
+ if [ -f "$d/$f" ]; then
echo "$d/$f"
continue 2
fi
@@ -48,43 +47,45 @@ dropindirs_sort() {
done
}
-if [[ -f /etc/os-release ]]; then
+if [ -f /etc/os-release ]; then
. /etc/os-release
-elif [[ -f /usr/lib/os-release ]]; then
+elif [ -f /usr/lib/os-release ]; then
. /usr/lib/os-release
fi
-[[ -n $PRETTY_NAME ]] || PRETTY_NAME="Linux $KERNEL_VERSION"
+[ -n "$PRETTY_NAME" ] || PRETTY_NAME="Linux $KERNEL_VERSION"
-if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
+if [ "${KERNEL_INSTALL_MACHINE_ID+x}" ]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
-elif [[ -f /etc/machine-id ]]; then
+elif [ -f /etc/machine-id ]; then
read -r MACHINE_ID < /etc/machine-id
fi
-if ! [[ $MACHINE_ID ]]; then
+if [ -z "$MACHINE_ID" ]; then
exit 0
fi
if [ -n "$KERNEL_INSTALL_CONF_ROOT" ]; then
- if [ -f "$KERNEL_INSTALL_CONF_ROOT/cmdline" ]; then
- read -r -d '' -a BOOT_OPTIONS < "$KERNEL_INSTALL_CONF_ROOT/cmdline"
- fi
-elif [[ -f /etc/kernel/cmdline ]]; then
- read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
-elif [[ -f /usr/lib/kernel/cmdline ]]; then
- read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
+ cmdline="$KERNEL_INSTALL_CONF_ROOT/cmdline"
+elif [ -f /etc/kernel/cmdline ]; then
+ cmdline=/etc/kernel/cmdline
+elif [ -f /usr/lib/kernel/cmdline ]; then
+ cmdline=/usr/lib/kernel/cmdline
else
- declare -a BOOT_OPTIONS
+ cmdline=/proc/cmdline
+fi
- read -r -d '' -a line < /proc/cmdline
- for i in "${line[@]}"; do
- [[ ${i#initrd=*} != "$i" ]] && continue
- BOOT_OPTIONS+=("$i")
+BOOT_OPTIONS=
+if [ -f "$cmdline" ]; then
+ for i in $(cat "$cmdline"); do
+ case $i in
+ initrd=*) ;;
+ *) BOOT_OPTIONS="${BOOT_OPTIONS}${BOOT_OPTIONS:+ }$i" ;;
+ esac
done
fi
-if [[ -d ${BOOT_DIR_ABS%/*} ]]; then
+if [ -d "${BOOT_DIR_ABS%/*}" ]; then
BOOT_DIR="/${MACHINE_ID}/0-rescue"
BOOT_ROOT=${BOOT_DIR_ABS%"$BOOT_DIR"}
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
@@ -102,55 +103,53 @@ ret=0
case "$COMMAND" in
add)
- if [[ -f $LOADER_ENTRY ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
- && [[ -f "$BOOT_DIR_ABS/$INITRD" ]]; then
- [[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
+ if [ -f "$LOADER_ENTRY" ] && [ -f "$BOOT_DIR_ABS/$KERNEL" ] \
+ && [ -f "$BOOT_DIR_ABS/$INITRD" ]; then
+ [ "$KERNEL_INSTALL_VERBOSE" = 1 ] \
&& echo "Skipping, there is already a rescue image generated with the same input parameters"
exit 0
fi
# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d" "/run/initramfs/dracut.conf.d"); do
- if [[ -e $f ]]; then
+ if [ -e "$f" ]; then
# shellcheck disable=SC1090
. "$f"
fi
done
- if [[ $dracut_rescue_image != "yes" ]]; then
- [[ $KERNEL_INSTALL_VERBOSE == 1 ]] \
+ if [ "$dracut_rescue_image" != "yes" ]; then
+ [ "$KERNEL_INSTALL_VERBOSE" = 1 ] \
&& echo "Skipping, 'dracut_rescue_image' not set to 'yes' in any dracut configuration file"
exit 0
fi
- [[ -d $BOOT_DIR_ABS ]] || mkdir -p "$BOOT_DIR_ABS"
+ [ -d "$BOOT_DIR_ABS" ] || mkdir -p "$BOOT_DIR_ABS"
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2
fi
- if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
- # shellcheck disable=SC2046
- dracut -f \
- --add-confdir rescue \
- $([[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo --verbose) \
- --kver "$KERNEL_VERSION" \
- "$BOOT_DIR_ABS/$INITRD"
- ((ret += $?))
+ if [ ! -f "$BOOT_DIR_ABS/$INITRD" ]; then
+ set -- dracut -f --add-confdir rescue
+ [ "$KERNEL_INSTALL_VERBOSE" = 1 ] && set -- "$@" --verbose
+ set -- "$@" --kver "$KERNEL_VERSION" "$BOOT_DIR_ABS/$INITRD"
+ "$@"
+ ret=$((ret + $?))
fi
- [[ $KERNEL_INSTALL_VERBOSE == 1 ]] && echo "Creating $LOADER_ENTRY"
- if [[ ${BOOT_DIR_ABS} != "/boot" ]]; then
+ [ "$KERNEL_INSTALL_VERBOSE" = 1 ] && echo "Creating $LOADER_ENTRY"
+ if [ "$BOOT_DIR_ABS" != "/boot" ]; then
{
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
- echo "options ${BOOT_OPTIONS[*]}"
+ echo "options $BOOT_OPTIONS"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
} > "$LOADER_ENTRY"
else
- if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
+ if [ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]; then
cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" "$LOADER_ENTRY"
else
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" "$LOADER_ENTRY"
@@ -158,7 +157,7 @@ case "$COMMAND" in
sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY"
fi
- ((ret += $?))
+ ret=$((ret + $?))
;;
remove)
diff --git a/modules.d/45net-lib/net-lib.sh b/modules.d/45net-lib/net-lib.sh
index a0b8740..5365c2d 100755
--- a/modules.d/45net-lib/net-lib.sh
+++ b/modules.d/45net-lib/net-lib.sh
@@ -756,7 +756,7 @@ linkup() {
wait_for_if_link "$@" 2> /dev/null && ip link set "$@" up 2> /dev/null && wait_for_if_up "$@" 2> /dev/null
}
-type hostname > /dev/null 2>&1 \
+command -v hostname > /dev/null 2>&1 \
|| hostname() {
cat /proc/sys/kernel/hostname
}
diff --git a/modules.d/45plymouth/plymouth-newroot.sh b/modules.d/45plymouth/plymouth-newroot.sh
index 29c56e9..7409dee 100755
--- a/modules.d/45plymouth/plymouth-newroot.sh
+++ b/modules.d/45plymouth/plymouth-newroot.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-if type plymouth > /dev/null 2>&1 && [ -z "${DRACUT_SYSTEMD-}" ]; then
+if command -v plymouth > /dev/null 2>&1 && [ -z "${DRACUT_SYSTEMD-}" ]; then
plymouth --newroot="$NEWROOT"
fi
diff --git a/modules.d/45plymouth/plymouth-pretrigger.sh b/modules.d/45plymouth/plymouth-pretrigger.sh
index 869a119..b28b4f5 100755
--- a/modules.d/45plymouth/plymouth-pretrigger.sh
+++ b/modules.d/45plymouth/plymouth-pretrigger.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-if type plymouthd > /dev/null 2>&1 && [ -z "${DRACUT_SYSTEMD-}" ]; then
+if command -v plymouthd > /dev/null 2>&1 && [ -z "${DRACUT_SYSTEMD-}" ]; then
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth; then
# first trigger graphics subsystem
udevadm trigger --action=add --attr-match=class=0x030000 > /dev/null 2>&1
diff --git a/modules.d/70crypt-lib/crypt-lib.sh b/modules.d/70crypt-lib/crypt-lib.sh
index 82a672f..c065d7e 100755
--- a/modules.d/70crypt-lib/crypt-lib.sh
+++ b/modules.d/70crypt-lib/crypt-lib.sh
@@ -106,7 +106,7 @@ ask_for_password() {
{
flock -s 9
# Prompt for password with plymouth, if installed and running.
- if type plymouth > /dev/null 2>&1 && plymouth --ping 2> /dev/null; then
+ if command -v plymouth > /dev/null 2>&1 && plymouth --ping 2> /dev/null; then
plymouth ask-for-password \
--prompt "$ply_prompt" --number-of-tries="$ply_tries" \
--command="$ply_cmd"
diff --git a/modules.d/70dmsquash-live/dmsquash-live-root.sh b/modules.d/70dmsquash-live/dmsquash-live-root.sh
index 3702a91..93b6f45 100755
--- a/modules.d/70dmsquash-live/dmsquash-live-root.sh
+++ b/modules.d/70dmsquash-live/dmsquash-live-root.sh
@@ -73,7 +73,7 @@ if [ ! -f "$livedev" ]; then
fi
getarg rd.live.check || check=""
if [ -n "$check" ]; then
- type plymouth > /dev/null 2>&1 && plymouth --hide-splash
+ command -v plymouth > /dev/null 2>&1 && plymouth --hide-splash
if [ -n "${DRACUT_SYSTEMD-}" ]; then
p=$(dev_unit_name "$check_dev")
systemctl start checkisomd5@"${p}".service
@@ -86,7 +86,7 @@ if [ ! -f "$livedev" ]; then
die "Media check failed!"
exit 1
fi
- type plymouth > /dev/null 2>&1 && plymouth --show-splash
+ command -v plymouth > /dev/null 2>&1 && plymouth --show-splash
fi
fi
@@ -234,7 +234,7 @@ do_live_overlay() {
Press [Enter] to continue.'
printf "\n\n\n\n%s\n\n\n" "${m}" > /dev/kmsg
if [ -n "${DRACUT_SYSTEMD-}" ]; then
- if type plymouth > /dev/null 2>&1 && plymouth --ping; then
+ if command -v plymouth > /dev/null 2>&1 && plymouth --ping; then
if getargbool 0 rhgb || getargbool 0 splash; then
m='>>>
>>>
@@ -257,7 +257,7 @@ do_live_overlay() {
systemd-ask-password --timeout=0 "${m}"
fi
else
- type plymouth > /dev/null 2>&1 && plymouth --ping && plymouth --quit
+ command -v plymouth > /dev/null 2>&1 && plymouth --ping && plymouth --quit
printf '\n\n%s' "$m"
read -r _
fi
diff --git a/modules.d/70fs-lib/fs-lib.sh b/modules.d/70fs-lib/fs-lib.sh
index e11f3c1..a450aa5 100755
--- a/modules.d/70fs-lib/fs-lib.sh
+++ b/modules.d/70fs-lib/fs-lib.sh
@@ -43,17 +43,17 @@ fsck_able() {
return 1
;;
ext?)
- type e2fsck > /dev/null 2>&1 \
+ command -v e2fsck > /dev/null 2>&1 \
&& _drv="fsck_drv_com e2fsck" \
&& return 0
;;
f2fs)
- type fsck.f2fs > /dev/null 2>&1 \
+ command -v fsck.f2fs > /dev/null 2>&1 \
&& _drv="fsck_drv_com fsck.f2fs" \
&& return 0
;;
jfs)
- type jfs_fsck > /dev/null 2>&1 \
+ command -v jfs_fsck > /dev/null 2>&1 \
&& _drv="fsck_drv_com jfs_fsck" \
&& return 0
;;
@@ -69,7 +69,7 @@ fsck_able() {
&& return 0
;;
*)
- type fsck > /dev/null 2>&1 \
+ command -v fsck > /dev/null 2>&1 \
&& _drv="fsck_drv_std fsck" \
&& return 0
;;
@@ -250,7 +250,7 @@ write_fs_tab() {
return
fi
- if type systemctl > /dev/null 2> /dev/null; then
+ if command -v systemctl > /dev/null 2> /dev/null; then
systemctl daemon-reload
systemctl --no-block start initrd-root-fs.target
fi
diff --git a/modules.d/70livenet/livenet-generator.sh b/modules.d/70livenet/livenet-generator.sh
index 45a4001..c79321b 100755
--- a/modules.d/70livenet/livenet-generator.sh
+++ b/modules.d/70livenet/livenet-generator.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
command -v getarg > /dev/null || . /lib/dracut-lib.sh
@@ -74,7 +74,7 @@ ROOTFLAGS="$(getarg rootflags)"
else
echo "What=/dev/mapper/live-rw"
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
- _dev=$'dev-mapper-live\\x2drw'
+ _dev='dev-mapper-live\x2drw'
fi
} > "$GENERATOR_DIR"/sysroot.mount
diff --git a/modules.d/70livenet/module-setup.sh b/modules.d/70livenet/module-setup.sh
index 3ec6baf..9465213 100755
--- a/modules.d/70livenet/module-setup.sh
+++ b/modules.d/70livenet/module-setup.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# module-setup.sh for livenet
# called by dracut
@@ -8,7 +8,7 @@ check() {
# called by dracut
depends() {
- echo network url-lib dmsquash-live img-lib bash initqueue
+ echo network url-lib dmsquash-live img-lib initqueue
return 0
}
diff --git a/modules.d/73zipl/install_zipl_cmdline.sh b/modules.d/73zipl/install_zipl_cmdline.sh
index 1a666da..59af087 100755
--- a/modules.d/73zipl/install_zipl_cmdline.sh
+++ b/modules.d/73zipl/install_zipl_cmdline.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
DEV="$1"
MNT=/boot/zipl
@@ -22,7 +22,7 @@ if [ -f ${MNT}/dracut-cmdline.conf ]; then
fi
if [ -f ${MNT}/active_devices.txt ]; then
- while read -r dev _ || [[ $dev ]]; do
+ while read -r dev _ || [ -n "$dev" ]; do
[ "$dev" = "#" ] || [ "$dev" = "" ] && continue
cio_ignore -r "$dev"
done < ${MNT}/active_devices.txt
diff --git a/modules.d/73zipl/module-setup.sh b/modules.d/73zipl/module-setup.sh
index 2772ec6..b1facb3 100755
--- a/modules.d/73zipl/module-setup.sh
+++ b/modules.d/73zipl/module-setup.sh
@@ -1,9 +1,8 @@
-#!/bin/bash
+#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
get_boot_zipl_dev() {
- local _boot_zipl
_boot_zipl=$(sed -n -e '/^[[:space:]]*#/d' -e 's/\(.*\)\w*\/boot\/zipl.*/\1/p' "${dracutsysrootdir-}"/etc/fstab)
printf "%s" "$(trim "$_boot_zipl")"
}
@@ -19,13 +18,11 @@ check() {
# called by dracut
depends() {
- echo bash initqueue
+ echo initqueue
}
# called by dracut
installkernel() {
- local _boot_zipl
-
_boot_zipl=$(get_boot_zipl_dev)
if [ -n "$_boot_zipl" ]; then
eval "$(blkid -s TYPE -o udev "${_boot_zipl}")"
@@ -42,8 +39,6 @@ installkernel() {
# called by dracut
cmdline() {
- local _boot_zipl
-
_boot_zipl=$(get_boot_zipl_dev)
if [ -n "$_boot_zipl" ]; then
printf "%s" " rd.zipl=${_boot_zipl}"
@@ -56,10 +51,9 @@ install() {
inst_hook cmdline 91 "$moddir/parse-zipl.sh"
inst_script "${moddir}/install_zipl_cmdline.sh" /sbin/install_zipl_cmdline.sh
- if [[ $hostonly_cmdline == "yes" ]]; then
- local _zipl
+ if [ "$hostonly_cmdline" = "yes" ]; then
_zipl=$(cmdline)
- [[ $_zipl ]] && printf "%s\n" "$_zipl" > "${initdir}/etc/cmdline.d/19-zipl.conf"
+ [ -n "$_zipl" ] && printf "%s\n" "$_zipl" > "${initdir}/etc/cmdline.d/19-zipl.conf"
fi
}
diff --git a/modules.d/74znet/module-setup.sh b/modules.d/74znet/module-setup.sh
index 6c340a6..59ef3a2 100755
--- a/modules.d/74znet/module-setup.sh
+++ b/modules.d/74znet/module-setup.sh
@@ -11,7 +11,6 @@ check() {
# called by dracut
depends() {
- echo bash
return 0
}
diff --git a/modules.d/74znet/parse-ccw.sh b/modules.d/74znet/parse-ccw.sh
index acdd63e..473e355 100755
--- a/modules.d/74znet/parse-ccw.sh
+++ b/modules.d/74znet/parse-ccw.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
znet_base_args="--no-settle --yes --no-root-update --force"
@@ -48,14 +48,25 @@ for ccw_arg in $(getargs rd.znet); do
done
for ifname in $(getargs rd.znet_ifname); do
- IFS=: read -r ifname_if ifname_subchannels _rest <<< "$ifname"
+ ifname_if=${ifname%%:*}
+ ifname_subchannels=${ifname#*:}
+ if [ "$ifname_subchannels" = "$ifname" ]; then
+ _rest=invalid
+ else
+ _rest=${ifname_subchannels#*:}
+ if [ "$_rest" = "$ifname_subchannels" ]; then
+ _rest=
+ else
+ ifname_subchannels=${ifname_subchannels%%:*}
+ fi
+ fi
if [ -z "$ifname_if" ] || [ -z "$ifname_subchannels" ] || [ -n "$_rest" ]; then
warn "Invalid arguments for rd.znet_ifname="
else
{
- ifname_subchannels="${ifname_subchannels//,/|}"
+ ifname_subchannels=$(printf '%s' "$ifname_subchannels" | tr ',' '|')
# sanitize for use in udev label: replace non-word characters by _
- ifname_if_label="${ifname_if//[^[:word:]]/_}"
+ ifname_if_label=$(printf '%s' "$ifname_if" | sed 's/[^[:alnum:]_]/_/g')
echo "ACTION!=\"add|change\", GOTO=\"ccw_ifname_${ifname_if_label}_end\""
echo "ATTR{type}!=\"1\", GOTO=\"ccw_ifname_${ifname_if_label}_end\""
diff --git a/modules.d/77dracut-systemd/dracut-emergency.sh b/modules.d/77dracut-systemd/dracut-emergency.sh
index a427a8f..65f8232 100755
--- a/modules.d/77dracut-systemd/dracut-emergency.sh
+++ b/modules.d/77dracut-systemd/dracut-emergency.sh
@@ -8,7 +8,7 @@ command -v getarg > /dev/null || . /lib/dracut-lib.sh
source_conf /etc/conf.d
-type plymouth > /dev/null 2>&1 && plymouth quit
+command -v plymouth > /dev/null 2>&1 && plymouth quit
export _rdshell_name="dracut" action="Boot" hook="emergency"
_emergency_action=$(getarg rd.emergency)
diff --git a/modules.d/80base/dracut-dev-lib.sh b/modules.d/80base/dracut-dev-lib.sh
index bc640f7..1f30438 100755
--- a/modules.d/80base/dracut-dev-lib.sh
+++ b/modules.d/80base/dracut-dev-lib.sh
@@ -83,7 +83,7 @@ set_systemd_timeout_for_dev() {
echo "JobTimeoutSec=$_timeout"
echo "JobRunningTimeoutSec=$_timeout"
} > "${PREFIX-}/etc/systemd/system/${_name}.device.d/timeout.conf"
- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf
+ command -v mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf
_needreload=1
fi
@@ -110,7 +110,7 @@ wait_for_dev() {
_name="$(str_replace "$1" '/' '\x2f')"
- type mark_hostonly > /dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh"
+ command -v mark_hostonly > /dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh"
[ -e "${PREFIX-}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
@@ -127,7 +127,7 @@ wait_for_dev() {
if ! [ -L "${PREFIX-}/etc/systemd/system/initrd.target.wants/${_unit}" ]; then
[ -d "${PREFIX-}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX-}"/etc/systemd/system/initrd.target.wants
ln -s ../"${_unit}" "${PREFIX-}/etc/systemd/system/initrd.target.wants/${_unit}"
- type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_unit}"
+ command -v mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_unit}"
_needreload=1
fi
diff --git a/modules.d/86shutdown/shutdown.sh b/modules.d/86shutdown/shutdown.sh
index fd15ab5..cb9828c 100755
--- a/modules.d/86shutdown/shutdown.sh
+++ b/modules.d/86shutdown/shutdown.sh
@@ -35,7 +35,7 @@ if [ "$ACTION" = "kexec" ] && ! command -v kexec > /dev/null 2>&1; then
for p in /usr/sbin /usr/bin /sbin /bin; do
cp -a /oldroot/${p}/kexec $p > /dev/null 2>&1 && break
done
- hash kexec
+ command -v kexec > /dev/null 2>&1
fi
trap "emergency_shell --shutdown shutdown Signal caught!" 0
@@ -152,7 +152,7 @@ while [ $_cnt -le 40 ]; do
done
[ $_cnt -ge 40 ] && _check_shutdown final
-if type plymouth > /dev/null 2>&1; then
+if command -v plymouth > /dev/null 2>&1; then
plymouth --hide-splash
elif [ -x /oldroot/bin/plymouth ]; then
/oldroot/bin/plymouth --hide-splash
diff --git a/tools/release.sh b/tools/release.sh
index 92dad34..f14fc62 100755
--- a/tools/release.sh
+++ b/tools/release.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# clog might be installed in the user home
export PATH="$PATH:~/.cargo/bin"
@@ -31,7 +31,7 @@ cat _CONTRIBUTORS >> CONTRIBUTORS.md
make AUTHORS
# Update the contributors list in NEWS.md
-if ! type -p clog &> /dev/null; then
+if ! command -v clog > /dev/null 2>&1; then
cargo install clog-cli --version 0.9.3
fi
head --lines=2 NEWS.md > NEWS_header.md
@@ -0,0 +1,67 @@
diff --git a/flang-rt/CMakeLists.txt b/flang-rt/CMakeLists.txt
index 50b8e83..319c496 100644
--- a/flang-rt/CMakeLists.txt
+++ b/flang-rt/CMakeLists.txt
@@ -138,6 +138,8 @@ cmake_path(NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_LIB_PATH)
# with this prefix will be forwarded in bootstrap builds.
option(FLANG_RT_INCLUDE_TESTS "Generate build targets for the flang-rt unit and regression-tests." "${LLVM_INCLUDE_TESTS}")
+set(FLANG_RT_BUILTINS_LIBRARY "" CACHE FILEPATH
+ "Path to an existing compiler-rt builtins library to use when Flang-RT needs compiler builtins.")
# Provide an interface to link against the LLVM libc/libc++ projects directly.
set(FLANG_RT_SUPPORTED_PROVIDERS system llvm)
@@ -236,7 +238,9 @@ check_cxx_source_compiles(
# Search for clang_rt.builtins library. Need in addition to msvcrt.
if (WIN32)
- find_compiler_rt_library(builtins FLANG_RT_BUILTINS_LIBRARY)
+ if (NOT FLANG_RT_BUILTINS_LIBRARY)
+ find_compiler_rt_library(builtins FLANG_RT_BUILTINS_LIBRARY)
+ endif ()
endif ()
# Build with _XOPEN_SOURCE on AIX to avoid errors caused by _ALL_SOURCE.
diff --git a/flang-rt/README.md b/flang-rt/README.md
index 4fe66a8..d56fbe1 100644
--- a/flang-rt/README.md
+++ b/flang-rt/README.md
@@ -138,6 +138,12 @@ CMake itself provide.
When `OFF`, does not add any tests and unittests. The `check-flang-rt`
build target will do nothing.
+ * `FLANG_RT_BUILTINS_LIBRARY` (path; default: `""`)
+
+ Path to an existing compiler-rt builtins library. When left empty, Flang-RT
+ uses the compiler to find the builtins library on platforms where one is
+ needed.
+
* `FLANG_RUNTIME_F128_MATH_LIB` (default: `""`)
Determines the implementation of `REAL(16)` math functions. If set to
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index fcbfed4..77e4e41 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -654,11 +654,19 @@ if(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD STREQUAL "all")
set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ${LLVM_ALL_EXPERIMENTAL_TARGETS})
endif()
+option(FLANG_USE_SYSTEM_COMPILER_RT
+ "Use an installed compiler-rt instead of adding compiler-rt to LLVM_ENABLE_RUNTIMES for Flang."
+ OFF)
+
if("flang" IN_LIST LLVM_ENABLE_PROJECTS AND
"AArch64" IN_LIST LLVM_TARGETS_TO_BUILD AND
NOT ("compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES OR "compiler-rt" IN_LIST LLVM_ENABLE_PROJECTS))
- message(STATUS "Enabling compiler-rt as a dependency of Flang")
- list(APPEND LLVM_ENABLE_RUNTIMES "compiler-rt")
+ if(FLANG_USE_SYSTEM_COMPILER_RT)
+ message(STATUS "Using system compiler-rt for Flang")
+ else()
+ message(STATUS "Enabling compiler-rt as a dependency of Flang")
+ list(APPEND LLVM_ENABLE_RUNTIMES "compiler-rt")
+ endif()
endif()
set(LLVM_TARGETS_TO_BUILD
@@ -0,0 +1,266 @@
--- a/tests/unilbrk/test-u8-possible-linebreaks.c
+++ b/tests/unilbrk/test-u8-possible-linebreaks.c
@@ -18,6 +18,19 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# include "unitypes.h"
+# undef u8_possible_linebreaks
+extern void u8_possible_linebreaks (const uint8_t *, size_t, const char *, char *);
+static void
+u8_possible_linebreaks_v1 (const uint8_t *s, size_t n,
+ const char *encoding, char *p)
+{
+ u8_possible_linebreaks (s, n, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -230,8 +243,7 @@
{
test_function (u8_possible_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef u8_possible_linebreaks
- test_function (u8_possible_linebreaks, 1);
+ test_function (u8_possible_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-u8-width-linebreaks.c
+++ b/tests/unilbrk/test-u8-width-linebreaks.c
@@ -18,6 +18,22 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# include "unitypes.h"
+# undef u8_width_linebreaks
+extern int u8_width_linebreaks (const uint8_t *, size_t, int, int, int,
+ const char *, const char *, char *);
+static int
+u8_width_linebreaks_v1 (const uint8_t *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding, char *p)
+{
+ return u8_width_linebreaks (s, n, width, start_column, at_end_columns,
+ o, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -69,8 +85,7 @@
{
test_function (u8_width_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef u8_width_linebreaks
- test_function (u8_width_linebreaks, 1);
+ test_function (u8_width_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-u16-possible-linebreaks.c
+++ b/tests/unilbrk/test-u16-possible-linebreaks.c
@@ -18,6 +18,19 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# include "unitypes.h"
+# undef u16_possible_linebreaks
+extern void u16_possible_linebreaks (const uint16_t *, size_t, const char *, char *);
+static void
+u16_possible_linebreaks_v1 (const uint16_t *s, size_t n,
+ const char *encoding, char *p)
+{
+ u16_possible_linebreaks (s, n, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -245,8 +258,7 @@
{
test_function (u16_possible_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef u16_possible_linebreaks
- test_function (u16_possible_linebreaks, 1);
+ test_function (u16_possible_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-u16-width-linebreaks.c
+++ b/tests/unilbrk/test-u16-width-linebreaks.c
@@ -18,6 +18,22 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# include "unitypes.h"
+# undef u16_width_linebreaks
+extern int u16_width_linebreaks (const uint16_t *, size_t, int, int, int,
+ const char *, const char *, char *);
+static int
+u16_width_linebreaks_v1 (const uint16_t *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding, char *p)
+{
+ return u16_width_linebreaks (s, n, width, start_column, at_end_columns,
+ o, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -75,8 +91,7 @@
{
test_function (u16_width_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef u16_width_linebreaks
- test_function (u16_width_linebreaks, 1);
+ test_function (u16_width_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-u32-possible-linebreaks.c
+++ b/tests/unilbrk/test-u32-possible-linebreaks.c
@@ -18,6 +18,19 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# include "unitypes.h"
+# undef u32_possible_linebreaks
+extern void u32_possible_linebreaks (const uint32_t *, size_t, const char *, char *);
+static void
+u32_possible_linebreaks_v1 (const uint32_t *s, size_t n,
+ const char *encoding, char *p)
+{
+ u32_possible_linebreaks (s, n, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -245,8 +258,7 @@
{
test_function (u32_possible_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef u32_possible_linebreaks
- test_function (u32_possible_linebreaks, 1);
+ test_function (u32_possible_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-u32-width-linebreaks.c
+++ b/tests/unilbrk/test-u32-width-linebreaks.c
@@ -18,6 +18,22 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# include "unitypes.h"
+# undef u32_width_linebreaks
+extern int u32_width_linebreaks (const uint32_t *, size_t, int, int, int,
+ const char *, const char *, char *);
+static int
+u32_width_linebreaks_v1 (const uint32_t *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding, char *p)
+{
+ return u32_width_linebreaks (s, n, width, start_column, at_end_columns,
+ o, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -75,8 +91,7 @@
{
test_function (u32_width_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef u32_width_linebreaks
- test_function (u32_width_linebreaks, 1);
+ test_function (u32_width_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-ulc-possible-linebreaks.c
+++ b/tests/unilbrk/test-ulc-possible-linebreaks.c
@@ -18,6 +18,18 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# undef ulc_possible_linebreaks
+extern void ulc_possible_linebreaks (const char *, size_t, const char *, char *);
+static void
+ulc_possible_linebreaks_v1 (const char *s, size_t n,
+ const char *encoding, char *p)
+{
+ ulc_possible_linebreaks (s, n, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -71,8 +83,7 @@
{
test_function (ulc_possible_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef ulc_possible_linebreaks
- test_function (ulc_possible_linebreaks, 1);
+ test_function (ulc_possible_linebreaks_v1, 1);
#endif
return test_exit_status;
--- a/tests/unilbrk/test-ulc-width-linebreaks.c
+++ b/tests/unilbrk/test-ulc-width-linebreaks.c
@@ -18,6 +18,21 @@
#include <config.h>
+#ifdef IN_LIBUNISTRING_GNULIB_TESTS
+# include <stddef.h>
+# undef ulc_width_linebreaks
+extern int ulc_width_linebreaks (const char *, size_t, int, int, int,
+ const char *, const char *, char *);
+static int
+ulc_width_linebreaks_v1 (const char *s, size_t n,
+ int width, int start_column, int at_end_columns,
+ const char *o, const char *encoding, char *p)
+{
+ return ulc_width_linebreaks (s, n, width, start_column, at_end_columns,
+ o, encoding, p);
+}
+#endif
+
#include "unilbrk.h"
#include <stdlib.h>
@@ -55,8 +70,7 @@
{
test_function (ulc_width_linebreaks, 2);
#ifdef IN_LIBUNISTRING_GNULIB_TESTS
-# undef ulc_width_linebreaks
- test_function (ulc_width_linebreaks, 1);
+ test_function (ulc_width_linebreaks_v1, 1);
#endif
return test_exit_status;
@@ -0,0 +1,169 @@
--- a/Makefile
+++ b/Makefile
@@ -1409,7 +1409,7 @@
PHONY += headerdep
headerdep:
- $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
+ $(Q)find $(srctree)/include/ -name '*.h' | xargs -n 1 \
$(srctree)/scripts/headerdep.pl -I$(srctree)/include
# ---------------------------------------------------------------------------
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -54,28 +54,29 @@
# Only a handful of exports intended for other modules (VFIO, KVMGT) should
# use EXPORT_SYMBOL_GPL, and EXPORT_SYMBOL should never be used.
ifdef CONFIG_KVM_X86
-# Search recursively for whole words and print line numbers. Filter out the
-# allowed set of exports, i.e. those that are intended for external usage.
-exports_grep_trailer := --include='*.[ch]' -nrw $(srctree)/virt/kvm $(srctree)/arch/x86/kvm | \
- grep -v -e kvm_page_track_register_notifier \
- -e kvm_page_track_unregister_notifier \
- -e kvm_write_track_add_gfn \
- -e kvm_write_track_remove_gfn \
- -e kvm_get_kvm \
- -e kvm_get_kvm_safe \
- -e kvm_put_kvm
+# Search C source and headers recursively for whole words and print line
+# numbers. Filter out the allowed set of exports, i.e. those that are intended
+# for external usage.
+exports_grep = find $(srctree)/virt/kvm $(srctree)/arch/x86/kvm \
+ -name '*.[ch]' -type f -exec grep -Hnw "$(1)" {} + | \
+ grep -v -e kvm_page_track_register_notifier \
+ -e kvm_page_track_unregister_notifier \
+ -e kvm_write_track_add_gfn \
+ -e kvm_write_track_remove_gfn \
+ -e kvm_get_kvm \
+ -e kvm_get_kvm_safe \
+ -e kvm_put_kvm
-# Force grep to emit a goofy group separator that can in turn be replaced with
-# the above newline macro (newlines in Make are a nightmare). Note, grep only
-# prints the group separator when N lines of context are requested via -C,
-# a.k.a. --NUM. Simply request zero lines. Print the separator only after
-# filtering out expected exports to avoid extra newlines in the error message.
+# Force a goofy group separator that can in turn be replaced with the above
+# newline macro (newlines in Make are a nightmare). Print the separator only
+# after filtering out expected exports to avoid extra newlines in the error
+# message.
define get_kvm_exports
-$(shell grep "$(1)" -C0 $(exports_grep_trailer) | grep "$(1)" -C0 --group-separator="!SEP!")
+$(shell $(call exports_grep,$(1)) | awk 'NR > 1 { printf "!SEP!" } { printf "%s", $$0 }')
endef
define check_kvm_exports
-nr_kvm_exports := $(shell grep "$(1)" $(exports_grep_trailer) | wc -l)
+nr_kvm_exports := $(shell $(call exports_grep,$(1)) | wc -l)
ifneq (0,$$(nr_kvm_exports))
$$(error ERROR ***\
@@ -94,5 +95,5 @@
undefine check_kvm_exports
undefine get_kvm_exports
-undefine exports_grep_trailer
+undefine exports_grep
endif # CONFIG_KVM_X86
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -201,7 +201,7 @@
# Some files are symlinks. If symlinks are changed, kheaders_data.tar.xz should
# be rebuilt.
-filechk_kheaders_md5sum = xargs -r -a $< stat -c %N | md5sum
+filechk_kheaders_md5sum = while IFS= read -r f; do stat -c %N "$$f"; done < $< | md5sum
$(obj)/kheaders.md5: $(obj)/kheaders-srclist FORCE
$(call filechk,kheaders_md5sum)
--- a/kernel/gen_kheaders.sh
+++ b/kernel/gen_kheaders.sh
@@ -43,8 +43,8 @@
rm -f "${tmpdir}.contents.txt"
# Create archive and try to normalize metadata for reproducibility.
+(cd "${tmpdir}" && find . \( -type f -o -type l \) -print | LC_ALL=C sort) | \
${TAR} "${timestamp:+--mtime=$timestamp}" \
- --owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
- -I "${XZ}" -cf "${tarfile}" -C "${tmpdir}/" . > /dev/null
+ -J -cf "${tarfile}" -C "${tmpdir}/" -T - > /dev/null
rm -rf "${tmpdir}"
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -165,13 +165,13 @@
$(Q)$(MAKE) -f $(srctree)/Makefile
+$(Q)$(srctree)/scripts/package/buildtar $@
-compress-tar.gz = -I "$(KGZIP)"
-compress-tar.bz2 = -I "$(KBZIP2)"
-compress-tar.xz = -I "$(XZ)"
-compress-tar.zst = -I "$(ZSTD)"
+compress-tar.gz = -z
+compress-tar.bz2 = -j
+compress-tar.xz = -J
+compress-tar.zst = --zstd
quiet_cmd_tar = TAR $@
- cmd_tar = cd $<; tar cf ../$@ $(compress-tar$(suffix $@)) --owner=root --group=root --sort=name *
+ cmd_tar = cd $<; find * -prune -print | LC_ALL=C sort | tar cf ../$@ $(compress-tar$(suffix $@)) -T -
dir-tarballs := $(addprefix linux-$(KERNELRELEASE)-$(ARCH), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst)
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -80,7 +80,7 @@
%{__arch_install_post} \
%{__os_install_post} \
find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \\\
- | xargs --no-run-if-empty chmod u-x
+ | while read -r mod; do chmod u-x "$${mod}"; done
%else
%define __spec_install_post /usr/lib/rpm/brp-compress || :
%endif
@@ -126,7 +126,8 @@
done
if [ -d "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" ];then
- find "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" -printf "%%%ghost /boot/dtb-%{KERNELRELEASE}/%%P\n"
+ (cd "%{buildroot}/lib/modules/%{KERNELRELEASE}/dtb" && find . ! -name . -print) | \
+ sed 's#^\./#%%ghost /boot/dtb-%{KERNELRELEASE}/#'
fi
echo "%exclude /lib/modules/%{KERNELRELEASE}/build"
@@ -143,7 +144,7 @@
# make modules executable so that find-debuginfo.sh strips them. this
# will be undone later in %%__spec_install_post
find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \
- | xargs --no-run-if-empty chmod u+x
+ | while read -r mod; do chmod u+x "$${mod}"; done
%endif
%if %{with_debuginfo_manual}
--- a/scripts/kconfig/parser.y
+++ b/scripts/kconfig/parser.y
@@ -21,6 +21,10 @@
#define PRINTD 0x0001
#define DEBUG_PARSE 0x0002
+#ifndef YYDEBUGSTR
+#define YYDEBUGSTR "yydebug"
+#endif
+
int cdebug = PRINTD;
static void yyerror(const char *err);
@@ -97,13 +101,6 @@
%type <string> assign_val
%type <flavor> assign_op
-%destructor {
- fprintf(stderr, "%s:%d: missing end statement for this entry\n",
- $$->filename, $$->lineno);
- if (current_menu == $$)
- menu_end_menu();
-} if_entry menu_entry choice_entry
-
%%
input: mainmenu_stmt stmt_list | stmt_list;
@@ -0,0 +1,96 @@
diff --git a/mlir/cmake/modules/CMakeLists.txt b/mlir/cmake/modules/CMakeLists.txt
index 47349f0..bdbc960 100644
--- a/mlir/cmake/modules/CMakeLists.txt
+++ b/mlir/cmake/modules/CMakeLists.txt
@@ -101,6 +101,7 @@ find_prefix_from_config(MLIR_CONFIG_CODE MLIR_INSTALL_PREFIX "${MLIR_INSTALL_PAC
# variable 'MLIR_INSTALL_PREFIX'.
extend_path(MLIR_CONFIG_CMAKE_DIR "\${MLIR_INSTALL_PREFIX}" "${MLIR_INSTALL_PACKAGE_DIR}")
extend_path(MLIR_CONFIG_LLVM_CMAKE_DIR "\${MLIR_INSTALL_PREFIX}" "${LLVM_INSTALL_PACKAGE_DIR}")
+extend_path(MLIR_CONFIG_TOOLS_DIR "\${MLIR_INSTALL_PREFIX}" "${MLIR_TOOLS_INSTALL_DIR}")
get_config_exports_includes(MLIR MLIR_CONFIG_INCLUDE_EXPORTS)
extend_path(base_includedir "\${MLIR_INSTALL_PREFIX}" "${CMAKE_INSTALL_INCLUDEDIR}")
set(MLIR_CONFIG_INCLUDE_DIRS
@@ -108,11 +109,11 @@ set(MLIR_CONFIG_INCLUDE_DIRS
)
# Ensure that we are using the installed mlir-tblgen. This might not be MLIR_TABLEGEN_EXE
# if we're building with a host-optimized mlir-tblgen (with LLVM_OPTIMIZED_TABLEGEN).
-set(MLIR_CONFIG_TABLEGEN_EXE mlir-tblgen)
-set(MLIR_CONFIG_PDLL_TABLEGEN_EXE mlir-pdll)
-set(MLIR_CONFIG_SRC_SHARDER_TABLEGEN_EXE mlir-src-sharder)
+set(MLIR_CONFIG_TABLEGEN_EXE "${MLIR_CONFIG_TOOLS_DIR}/mlir-tblgen")
+set(MLIR_CONFIG_PDLL_TABLEGEN_EXE "${MLIR_CONFIG_TOOLS_DIR}/mlir-pdll")
+set(MLIR_CONFIG_SRC_SHARDER_TABLEGEN_EXE "${MLIR_CONFIG_TOOLS_DIR}/mlir-src-sharder")
-set(MLIR_CONFIG_IRDL_TO_CPP_EXE mlir-irdl-to-cpp)
+set(MLIR_CONFIG_IRDL_TO_CPP_EXE "${MLIR_CONFIG_TOOLS_DIR}/mlir-irdl-to-cpp")
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/MLIRConfig.cmake.in
@@ -125,6 +126,7 @@ configure_file(
set(MLIR_CONFIG_CODE)
set(MLIR_CONFIG_CMAKE_DIR)
set(MLIR_CONFIG_LLVM_CMAKE_DIR)
+set(MLIR_CONFIG_TOOLS_DIR)
set(MLIR_CONFIG_INCLUDE_DIRS)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
diff --git a/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt b/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
index 27a7e22..216b88f 100644
--- a/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
+++ b/mlir/tools/mlir-irdl-to-cpp/CMakeLists.txt
@@ -1,6 +1,7 @@
add_llvm_executable(mlir-irdl-to-cpp
mlir-irdl-to-cpp.cpp
)
+add_dependencies(mlir-irdl-to-cpp mlir-generic-headers)
mlir_target_link_libraries(mlir-irdl-to-cpp
PRIVATE
MLIRTargetIRDLToCpp
diff --git a/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt b/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
index ef5ce88..2bca6f6 100644
--- a/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
+++ b/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
@@ -7,6 +7,7 @@ set(LLVM_LINK_COMPONENTS
add_mlir_tool(mlir-linalg-ods-yaml-gen
mlir-linalg-ods-yaml-gen.cpp
)
+add_dependencies(mlir-linalg-ods-yaml-gen mlir-generic-headers)
llvm_update_compile_flags(mlir-linalg-ods-yaml-gen)
target_link_libraries(mlir-linalg-ods-yaml-gen PRIVATE
MLIRIR
diff --git a/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt b/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
index e17b158..5723bdc 100644
--- a/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
+++ b/mlir/tools/mlir-parser-fuzzer/bytecode/CMakeLists.txt
@@ -6,6 +6,7 @@ add_llvm_fuzzer(mlir-bytecode-parser-fuzzer
mlir-bytecode-parser-fuzzer.cpp
DUMMY_MAIN DummyParserFuzzer.cpp
)
+add_dependencies(mlir-bytecode-parser-fuzzer mlir-generic-headers)
mlir_target_link_libraries(mlir-bytecode-parser-fuzzer
PUBLIC
MLIRIR
diff --git a/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt b/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
index b4a2bac..6ba670f 100644
--- a/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
+++ b/mlir/tools/mlir-parser-fuzzer/text/CMakeLists.txt
@@ -6,6 +6,7 @@ add_llvm_fuzzer(mlir-text-parser-fuzzer
mlir-text-parser-fuzzer.cpp
DUMMY_MAIN DummyParserFuzzer.cpp
)
+add_dependencies(mlir-text-parser-fuzzer mlir-generic-headers)
mlir_target_link_libraries(mlir-text-parser-fuzzer
PUBLIC
MLIRIR
diff --git a/mlir/tools/mlir-pdll/CMakeLists.txt b/mlir/tools/mlir-pdll/CMakeLists.txt
index 35b8870..a1dcd02 100644
--- a/mlir/tools/mlir-pdll/CMakeLists.txt
+++ b/mlir/tools/mlir-pdll/CMakeLists.txt
@@ -21,6 +21,7 @@ add_tablegen(mlir-pdll MLIR_PDLL
${LIBS}
)
+add_dependencies(mlir-pdll mlir-generic-headers)
target_link_libraries(mlir-pdll PRIVATE ${LIBS})
mlir_check_all_link_libraries(mlir-pdll)
@@ -0,0 +1,185 @@
diff -ruN a/configure b/configure
--- a/configure 2026-06-06 04:54:35.000000000 -0500
+++ b/configure 2026-06-08 21:43:31.051165555 -0500
@@ -12623,6 +12623,7 @@
### use option --enable-widec to turn on use of wide-character support
NCURSES_CH_T=chtype
NCURSES_LIBUTF8=0
+NCURSES_WIDECHAR=0
NEED_WCHAR_H=0
NCURSES_MBSTATE_T=0
@@ -12862,6 +12863,7 @@
#define NCURSES_WIDECHAR 1
EOF
+ NCURSES_WIDECHAR=1
case "$CPPFLAGS" in
(*_XOPEN_SOURCE=*)
;;
@@ -30784,6 +30786,7 @@
s,@NCURSES_WCWIDTH_GRAPHICS@,$NCURSES_WCWIDTH_GRAPHICS,;t t
s,@NCURSES_CH_T@,$NCURSES_CH_T,;t t
s,@NCURSES_LIBUTF8@,$NCURSES_LIBUTF8,;t t
+s,@NCURSES_WIDECHAR@,$NCURSES_WIDECHAR,;t t
s,@NEED_WCHAR_H@,$NEED_WCHAR_H,;t t
s,@NCURSES_MBSTATE_T@,$NCURSES_MBSTATE_T,;t t
s,@NCURSES_WCHAR_T@,$NCURSES_WCHAR_T,;t t
diff -ruN a/configure.in b/configure.in
--- a/configure.in 2026-05-30 14:20:26.000000000 -0500
+++ b/configure.in 2026-06-08 21:43:31.043165313 -0500
@@ -880,6 +880,7 @@
### use option --enable-widec to turn on use of wide-character support
NCURSES_CH_T=chtype
NCURSES_LIBUTF8=0
+NCURSES_WIDECHAR=0
NEED_WCHAR_H=0
NCURSES_MBSTATE_T=0
@@ -912,6 +913,7 @@
fi
AC_DEFINE(USE_WIDEC_SUPPORT,1,[Define to 1 to compile with wide character and UTF-8 support])
AC_DEFINE(NCURSES_WIDECHAR,1,[Define to 1 to compile with wide character and UTF-8 support])
+ NCURSES_WIDECHAR=1
case "$CPPFLAGS" in
(*_XOPEN_SOURCE=*)
;;
@@ -945,6 +947,7 @@
fi
AC_SUBST(NCURSES_CH_T)
AC_SUBST(NCURSES_LIBUTF8)
+AC_SUBST(NCURSES_WIDECHAR)
AC_SUBST(NEED_WCHAR_H)
AC_SUBST(NCURSES_MBSTATE_T)
diff -ruN a/include/MKterm.h.awk.in b/include/MKterm.h.awk.in
--- a/include/MKterm.h.awk.in 2025-12-26 17:33:14.000000000 -0600
+++ b/include/MKterm.h.awk.in 2026-06-08 21:54:26.409799414 -0500
@@ -126,14 +126,14 @@
print "#undef SET_TTY"
print "#undef GET_TTY"
print ""
- print "#if @HAVE_TERMIOS_H@ && @HAVE_TCGETATTR@ /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
+ print "#if HAVE_TERMIOS_H && HAVE_TCGETATTR /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */"
print ""
print "#undef TERMIOS"
print "#define TERMIOS 1"
print "#include <termios.h>"
print "#define TTY struct termios"
print ""
- print "#elif @HAVE_TERMIO_H@ /* HAVE_TERMIO_H */"
+ print "#elif HAVE_TERMIO_H /* HAVE_TERMIO_H */"
print ""
print "#undef TERMIOS"
print "#define TERMIOS 1"
@@ -145,7 +145,7 @@
print "#include <nc_win32.h>"
print "#define TTY ConsoleMode"
print ""
- print "#elif @HAVE_SGTTY_H@ /* HAVE_SGTTY_H */"
+ print "#elif HAVE_SGTTY_H /* HAVE_SGTTY_H */"
print ""
print "#undef TERMIOS"
print "#include <sgtty.h>"
@@ -165,7 +165,7 @@
print "#elif defined(_WIN32) || defined(_WIN64)"
print "#define GET_TTY(fd, buf) _nc_console_getmode(_nc_console_fd2handle(fd),buf)"
print "#define SET_TTY(fd, buf) _nc_console_setmode(_nc_console_fd2handle(fd),buf)"
- print "#elif @HAVE_SGTTY_H@ /* HAVE_SGTTY_H */"
+ print "#elif HAVE_SGTTY_H /* HAVE_SGTTY_H */"
print "#define GET_TTY(fd, buf) gtty(fd, buf)"
print "#define SET_TTY(fd, buf) stty(fd, buf)"
print "#endif"
diff -ruN a/include/curses.h.in b/include/curses.h.in
--- a/include/curses.h.in 2026-05-30 14:13:55.000000000 -0500
+++ b/include/curses.h.in 2026-06-08 21:43:31.051165555 -0500
@@ -254,10 +254,14 @@
* conflicting) when _XOPEN_SOURCE is 500 or greater. If NCURSES_WIDECHAR is
* not already defined, e.g., if the platform relies upon nonstandard feature
* test macros, define it at this point if the standard feature test macros
- * indicate that it should be defined.
+ * indicate that it should be defined. Prefer the configure-time result when
+ * generating the ncurses headers, so building a wide-character library does
+ * not depend on the host's feature-test macro policy.
*/
#ifndef NCURSES_WIDECHAR
-#if defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500))
+#if @NCURSES_WIDECHAR@ /* NCURSES_WIDECHAR */
+#define NCURSES_WIDECHAR 1
+#elif defined(_XOPEN_SOURCE_EXTENDED) || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0 >= 500))
#define NCURSES_WIDECHAR 1
#else
#define NCURSES_WIDECHAR 0
diff -ruN a/include/ncurses_cfg.hin b/include/ncurses_cfg.hin
--- a/include/ncurses_cfg.hin 2024-06-08 09:04:14.000000000 -0500
+++ b/include/ncurses_cfg.hin 2026-06-08 21:59:39.717239025 -0500
@@ -50,6 +50,55 @@
#define NC_CONFIG_H
@DEFS@
+/*
+ * Vertex builds ncurses as a Linux wide-character library. Keep the private
+ * generated headers coherent when cross/sysroot feature probes are cached or
+ * skipped by the package manager.
+ */
+#ifndef SIG_ATOMIC_T
+#define SIG_ATOMIC_T volatile sig_atomic_t
+#endif
+
+#ifndef HAVE_TERMIOS_H
+#define HAVE_TERMIOS_H 1
+#endif
+
+#ifndef HAVE_TCGETATTR
+#define HAVE_TCGETATTR 1
+#endif
+
+#ifndef HAVE_LIMITS_H
+#define HAVE_LIMITS_H 1
+#endif
+
+#ifndef HAVE_UNISTD_H
+#define HAVE_UNISTD_H 1
+#endif
+
+#ifndef HAVE_MBLEN
+#define HAVE_MBLEN 1
+#endif
+
+#ifndef HAVE_MBTOWC
+#define HAVE_MBTOWC 1
+#endif
+
+#ifndef HAVE_MBRLEN
+#define HAVE_MBRLEN 1
+#endif
+
+#ifndef HAVE_MBRTOWC
+#define HAVE_MBRTOWC 1
+#endif
+
+#ifndef USE_WIDEC_SUPPORT
+#define USE_WIDEC_SUPPORT 1
+#endif
+
+#ifndef NCURSES_WIDECHAR
+#define NCURSES_WIDECHAR 1
+#endif
+
#include <ncurses_def.h>
/* The C compiler may not treat these properly but C++ has to */
diff -ruN a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c
--- a/ncurses/base/lib_pad.c 2024-12-07 11:44:59.000000000 -0600
+++ b/ncurses/base/lib_pad.c 2026-06-08 22:02:50.246305708 -0500
@@ -257,8 +257,8 @@
register struct ldat *pline = &CurScreen(sp)->_line[nind];
for (j = 0; j <= my_len; j++) {
int k = NewScreen(sp)->_maxx - j;
- if (pline->text[j] != nline->text[j]
- || pline->text[k] != nline->text[k]) {
+ if (!CharEq(pline->text[j], nline->text[j])
+ || !CharEq(pline->text[k], nline->text[k])) {
nind = _NEWINDEX;
break;
}
+268
View File
@@ -0,0 +1,268 @@
diff --git a/Makefile.am b/Makefile.am
index 7d1f8d5..d989866 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,7 @@
AUTOMAKE_OPTIONS = -Wno-portability
SUBDIRS = src
-SHELL = /bin/bash
+SHELL = /bin/sh
BUILDHOST ?= $(shell [ -f .env ] && . ./.env 2>/dev/null && printf '%s' "$$BUILDHOST")
TOR_BUILDHOST ?= $(shell [ -f .env ] && . ./.env 2>/dev/null && printf '%s' "$$TOR_BUILDHOST")
@@ -61,7 +61,7 @@ sig:
perl -i -pe "s/20\d\d\d\d\d\d/$(YYYYMMDD)/" parallel-latest.tar.*directive
gpg --clearsign --yes parallel-latest.tar.bz2.directive
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
@@ -75,7 +75,7 @@ sig:
) > parallel-$(YYYYMMDD).tar.bz2.sig
chmod +x parallel-$(YYYYMMDD).tar.bz2.sig
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
@@ -126,7 +126,7 @@ alphaupload:
perl -i -pe "s/20\d\d\d\d\d\d/$(YYYYMMDD)/" parallel-latest.tar.*directive
gpg --clearsign --yes parallel-latest.tar.bz2.directive
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
@@ -139,7 +139,7 @@ alphaupload:
gpg -ab -o - parallel-$(YYYYMMDD).tar.bz2; \
) > parallel-$(YYYYMMDD).tar.bz2.sig
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
diff --git a/Makefile.in b/Makefile.in
index eeb280a..0436c23 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -241,7 +241,7 @@ PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
-SHELL = /bin/bash
+SHELL = /bin/sh
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
@@ -842,7 +842,7 @@ sig:
perl -i -pe "s/20\d\d\d\d\d\d/$(YYYYMMDD)/" parallel-latest.tar.*directive
gpg --clearsign --yes parallel-latest.tar.bz2.directive
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
@@ -856,7 +856,7 @@ sig:
) > parallel-$(YYYYMMDD).tar.bz2.sig
chmod +x parallel-$(YYYYMMDD).tar.bz2.sig
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
@@ -907,7 +907,7 @@ alphaupload:
perl -i -pe "s/20\d\d\d\d\d\d/$(YYYYMMDD)/" parallel-latest.tar.*directive
gpg --clearsign --yes parallel-latest.tar.bz2.directive
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
@@ -920,7 +920,7 @@ alphaupload:
gpg -ab -o - parallel-$(YYYYMMDD).tar.bz2; \
) > parallel-$(YYYYMMDD).tar.bz2.sig
- (echo '#!/bin/bash'; \
+ (echo '#!/bin/sh'; \
echo; \
echo "# To check the signature run:"; \
echo "# echo | gpg"; \
diff --git a/src/env_parallel b/src/env_parallel
index 9c946ca..7c24987 100755
--- a/src/env_parallel
+++ b/src/env_parallel
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Copyright (C) 2016-2026 Ole Tange, http://ole.tange.dk and Free
# Software Foundation, Inc.
@@ -23,17 +23,19 @@
grepq() {
# grep -q for systems without -q
- grep >/dev/null 2>/dev/null "$@"
+ grep "$@" >/dev/null 2>&1
}
installer() {
- source="$1"
- script="$2"
- into="$3"
- if grepq $script "$into"; then
- true already installed
+ source_command=$1
+ script=$2
+ into=$3
+
+ if grepq "$script" "$into"; then
+ : already installed
else
- echo $source \`which $script\` >> "$into"
+ script_path=$(command -v "$script" 2>/dev/null) || script_path=$script
+ printf '%s %s\n' "$source_command" "$script_path" >> "$into"
fi
}
@@ -47,11 +49,11 @@ while test $# -gt 0; do
installer . env_parallel.zsh "$HOME"/.zshenv
installer source env_parallel.ksh "$HOME"/.kshrc
installer source env_parallel.mksh "$HOME"/.mkshrc
- echo $SHELL | grepq /pdksh &&
+ printf '%s\n' "${SHELL-}" | grepq /pdksh &&
installer . env_parallel.pdksh "$HOME"/.profile
- echo $SHELL | grepq /ash &&
+ printf '%s\n' "${SHELL-}" | grepq /ash &&
installer . env_parallel.ash "$HOME"/.profile
- echo $SHELL | grepq /dash &&
+ printf '%s\n' "${SHELL-}" | grepq /dash &&
installer . env_parallel.dash "$HOME"/.profile
installer source env_parallel.csh "$HOME"/.cshrc
installer source env_parallel.tcsh "$HOME"/.tcshrc
@@ -71,7 +73,7 @@ while test $# -gt 0; do
exit
;;
*)
- echo "Unknown option: $key"
+ printf '%s\n' "Unknown option: $key"
;;
esac
shift # past argument or value
@@ -91,7 +93,7 @@ bash: Put this in $HOME/.bashrc: . env_parallel.bash
fish: Put this in $HOME/.config/fish/config.fish: . (which env_parallel.fish)
E.g. by doing:
- echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish
+ printf '%s\n' '. (which env_parallel.fish)' >> "$HOME/.config/fish/config.fish"
Supports: variables, aliases, functions, arrays
ksh: Put this in $HOME/.kshrc: source env_parallel.ksh
diff --git a/src/parset b/src/parset
index e3c36f1..df1ec3d 100755
--- a/src/parset
+++ b/src/parset
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Copyright (C) 2016-2026 Ole Tange, http://ole.tange.dk and Free
# Software Foundation, Inc.
@@ -23,17 +23,19 @@
grepq() {
# grep -q for systems without -q
- grep >/dev/null 2>/dev/null "$@"
+ grep "$@" >/dev/null 2>&1
}
installer() {
- source="$1"
- script="$2"
- into="$3"
- if grepq $script $into; then
- true already installed
+ source_command=$1
+ script=$2
+ into=$3
+
+ if grepq "$script" "$into"; then
+ : already installed
else
- echo $source \`which $script\` >> $into
+ script_path=$(command -v "$script" 2>/dev/null) || script_path=$script
+ printf '%s %s\n' "$source_command" "$script_path" >> "$into"
fi
}
@@ -42,36 +44,36 @@ while test $# -gt 0; do
case $key in
-i|--install)
- installer . env_parallel.bash $HOME/.bashrc
- installer . env_parallel.sh $HOME/.shrc
- installer . env_parallel.zsh $HOME/.zshenv
- installer source env_parallel.ksh $HOME/.kshrc
- installer source env_parallel.mksh $HOME/.kshrc
- echo $SHELL | grepq /pdksh &&
- installer . env_parallel.pdksh $HOME/.profile
- echo $SHELL | grepq /ash &&
- installer . env_parallel.ash $HOME/.profile
- echo $SHELL | grepq /dash &&
- installer . env_parallel.dash $HOME/.profile
- installer source env_parallel.csh $HOME/.cshrc
- installer source env_parallel.tcsh $HOME/.tcshrc
- mkdir -p $HOME/.config/fish
- grepq env_parallel.fish $HOME/.config/fish/config.fish ||
- echo '. (which env_parallel.fish)' >> $HOME/.config/fish/config.fish
+ installer . env_parallel.bash "$HOME/.bashrc"
+ installer . env_parallel.sh "$HOME/.shrc"
+ installer . env_parallel.zsh "$HOME/.zshenv"
+ installer source env_parallel.ksh "$HOME/.kshrc"
+ installer source env_parallel.mksh "$HOME/.kshrc"
+ printf '%s\n' "${SHELL-}" | grepq /pdksh &&
+ installer . env_parallel.pdksh "$HOME/.profile"
+ printf '%s\n' "${SHELL-}" | grepq /ash &&
+ installer . env_parallel.ash "$HOME/.profile"
+ printf '%s\n' "${SHELL-}" | grepq /dash &&
+ installer . env_parallel.dash "$HOME/.profile"
+ installer source env_parallel.csh "$HOME/.cshrc"
+ installer source env_parallel.tcsh "$HOME/.tcshrc"
+ mkdir -p "$HOME/.config/fish"
+ grepq env_parallel.fish "$HOME/.config/fish/config.fish" ||
+ printf '%s\n' '. (which env_parallel.fish)' >> "$HOME/.config/fish/config.fish"
echo 'Installed env_parallel in:'
- echo " " $HOME/.bashrc
- echo " " $HOME/.shrc
- echo " " $HOME/.zshenv
- echo " " $HOME/.config/fish/config.fish
- echo " " $HOME/.kshrc
- echo " " $HOME/.mkshrc
- echo " " $HOME/.profile
- echo " " $HOME/.cshrc
- echo " " $HOME/.tcshrc
+ echo " " "$HOME/.bashrc"
+ echo " " "$HOME/.shrc"
+ echo " " "$HOME/.zshenv"
+ echo " " "$HOME/.config/fish/config.fish"
+ echo " " "$HOME/.kshrc"
+ echo " " "$HOME/.mkshrc"
+ echo " " "$HOME/.profile"
+ echo " " "$HOME/.cshrc"
+ echo " " "$HOME/.tcshrc"
exit
;;
*)
- echo "Unknown option: $key"
+ printf '%s\n' "Unknown option: $key"
;;
esac
shift # past argument or value
@@ -0,0 +1,22 @@
--- a/Makefile.am 2026-07-06 19:57:41.644939943 +0000
+++ b/Makefile.am 2026-07-06 19:57:42.970765965 +0000
@@ -494,7 +494,7 @@
last_capname=`sed -n -e 's/^#define\s*CAP_LAST_CAP\s*\([A-Z_]*\)$$/\1/p' $(LNX_CAP_HEADER)`; \
capability_count=`sed -n -e "s/^#define\s*$$last_capname\s*\([0-9]*\)$$/\1/p" $(LNX_CAP_HEADER)`; \
sed -n -e 's/^#define\s*CAP_\([A-Z_]*\)\s*\([0-9]*\)$$/ [\2] = \"\L\1\",/p' $(LNX_CAP_HEADER) >> $@; \
- echo -e "};\n\n" >> $@; \
+ printf '};\n\n' >> $@; \
echo "#define CAPABILITY_COUNT $$capability_count" >> $@; \
echo "$$capnames_footer" >> $@; \
echo ""; \
--- a/Makefile.in 2026-07-06 19:57:41.751349466 +0000
+++ b/Makefile.in 2026-07-06 19:57:42.972186513 +0000
@@ -3390,7 +3390,7 @@
last_capname=`sed -n -e 's/^#define\s*CAP_LAST_CAP\s*\([A-Z_]*\)$$/\1/p' $(LNX_CAP_HEADER)`; \
capability_count=`sed -n -e "s/^#define\s*$$last_capname\s*\([0-9]*\)$$/\1/p" $(LNX_CAP_HEADER)`; \
sed -n -e 's/^#define\s*CAP_\([A-Z_]*\)\s*\([0-9]*\)$$/ [\2] = \"\L\1\",/p' $(LNX_CAP_HEADER) >> $@; \
- echo -e "};\n\n" >> $@; \
+ printf '};\n\n' >> $@; \
echo "#define CAPABILITY_COUNT $$capability_count" >> $@; \
echo "$$capnames_footer" >> $@; \
echo ""; \
+60
View File
@@ -0,0 +1,60 @@
diff -Naur a/libsmartcols/meson.build b/libsmartcols/meson.build
--- a/libsmartcols/meson.build 2026-06-16 04:34:39.314348277 -0500
+++ b/libsmartcols/meson.build 2026-07-08 18:27:43.133267018 -0500
@@ -14,7 +14,7 @@
scols_bison = generator(
bison,
output : ['@BASENAME@.c', '@BASENAME@.h'],
- arguments : ['@INPUT@', '--output=@OUTPUT0@', '--defines=@OUTPUT1@'])
+ arguments : ['-o@OUTPUT0@', '-H@OUTPUT1@', '@INPUT@'])
scols_parser_c = scols_bison.process('src/filter-parser.y')
scols_flex = generator(
diff -Naur a/libsmartcols/src/filter-parser.y b/libsmartcols/src/filter-parser.y
--- a/libsmartcols/src/filter-parser.y 2026-06-09 04:39:48.958828649 -0500
+++ b/libsmartcols/src/filter-parser.y 2026-07-08 18:25:46.288175609 -0500
@@ -24,7 +24,7 @@
%lex-param {void *scanner}
%parse-param {void *scanner}{struct libscols_filter *fltr}
-%define parse.error verbose
+%error-verbose
%code requires
{
@@ -60,14 +60,6 @@
%token T_INVALID_NUMBER
-%destructor {
- /* This destruct is called on error. The root node will be deallocated
- * by scols_unref_filter().
- */
- if (fltr->root != $$)
- filter_unref_node($$);
- } <param>
-
%%
%start filter;
diff -Naur a/meson.build b/meson.build
--- a/meson.build 2026-06-16 07:01:17.105953806 -0500
+++ b/meson.build 2026-07-08 18:27:39.359167044 -0500
@@ -976,7 +976,7 @@
have = get_option('use-tty-group')
conf.set('USE_TTY_GROUP', have ? 1 : false)
-bison = find_program('bison')
+bison = find_program('bison', 'byacc', 'yacc')
flex = find_program('flex')
sed = find_program('sed')
@@ -984,7 +984,7 @@
bison_gen = generator(
bison,
output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'],
- arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@'])
+ arguments : ['-H@OUTPUT1@', '-o@OUTPUT0@', '@INPUT@'])
python_program = find_program('python3', 'python', native : true)