HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux Bradford-Sitios 6.14.0-1017-azure #17~24.04.1-Ubuntu SMP Mon Dec 1 20:10:50 UTC 2025 x86_64
User: www-data (33)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/lib/modules/6.17.0-1013-azure/build/kernel/gen_kheaders.sh
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

# This script generates an archive consisting of kernel headers
# for CONFIG_IKHEADERS.
set -e
tarfile=$1
srclist=$2
objlist=$3
timestamp=$4

dir=$(dirname "${tarfile}")
tmpdir=${dir}/.tmp_dir
depfile=${dir}/.$(basename "${tarfile}").d

# generate dependency list.
{
	echo
	echo "deps_${tarfile} := \\"
	sed 's:\(.*\):  \1 \\:' "${srclist}"
	sed -n '/^include\/generated\/autoconf\.h$/!s:\(.*\):  \1 \\:p' "${objlist}"
	echo
	echo "${tarfile}: \$(deps_${tarfile})"
	echo
	echo "\$(deps_${tarfile}):"

} > "${depfile}"

rm -rf "${tmpdir}"
mkdir "${tmpdir}"

# shellcheck disable=SC2154 # srctree is passed as an env variable
sed "s:^${srctree}/::" "${srclist}" | ${TAR} -c -f - -C "${srctree}" -T - | ${TAR} -xf - -C "${tmpdir}"
${TAR} -c -f - -T "${objlist}" | ${TAR} -xf - -C "${tmpdir}"

# Remove comments except SDPX lines
# Use a temporary file to store directory contents to prevent find/xargs from
# seeing temporary files created by perl.
find "${tmpdir}" -type f -print0 > "${tmpdir}.contents.txt"
xargs -0 -P8 -n1 \
	perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;' \
	< "${tmpdir}.contents.txt"
rm -f "${tmpdir}.contents.txt"

# Create archive and try to normalize metadata for reproducibility.
${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

rm -rf "${tmpdir}"