mirror of
https://github.com/systemd/systemd.git
synced 2026-07-12 02:24:15 +00:00
This also - merges basic/linux and shared/linux, - moves BPF_JUMP_A() to basic/missing_bpf.h, - copies from usrspace kernel headers directory generated by 'make headers', rather than copying from kernel tree, - copies const.h into our tree to reduce change in ethtool.h, - copies auto_fs.h into our tree to reduce change in auto_dev-ioctl.h.
34 lines
1001 B
Bash
Executable File
34 lines
1001 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
# The directory must be userspace kernel header directory:
|
|
# git clone git@github.com:torvalds/linux.git
|
|
# make -C linux headers
|
|
# ./update.sh linux
|
|
SRCDIR=${1?}
|
|
|
|
for i in *.h */*.h; do
|
|
if [[ "$i" == bpf_insn.h ]]; then
|
|
cp "$SRCDIR/samples/bpf/$i" "$i"
|
|
else
|
|
cp "$SRCDIR/usr/include/linux/$i" "$i"
|
|
fi
|
|
|
|
case "$i" in
|
|
auto_dev-ioctl.h)
|
|
sed -r -i '/^#define[[:space:]]+AUTOFS_DEV_IOCTL_VERSION_MINOR/ s/[0-9]+/0/' "$i"
|
|
;;
|
|
btrfs.h)
|
|
sed -r -i 's/^(#include <linux\/fs\.h>)/#if WANT_LINUX_FS_H\n\1\n#endif/' "$i"
|
|
;;
|
|
ethtool.h)
|
|
sed -r -i '/return (ep->speed_hi << 16) | ep->speed;/ s/return .*;/return ((__u32) ep->speed_hi << 16) | (__u32) ep->speed;/' "$i"
|
|
;;
|
|
dm-ioctl.h)
|
|
sed -r -i '/^#define[[:space:]]+DM_VERSION_MINOR/ s/[0-9]+/27/' "$i"
|
|
;;
|
|
esac
|
|
done
|