Skip to content

Commit 73adf09

Browse files
committed
add sync script for updating the code
Add script for syncing contents with the kernel. Compared to YNL C we only need to copy over the specs and deps. YNL CPP has the generator (unlike YNL C which generates in the kernel tree and copies over the outputs). Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 0269756 commit 73adf09

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

update-from-kernel.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
if [ $# -ne 1 ]; then
4+
echo "Usage: $0 PATH_TO_KERNEL"
5+
exit 1
6+
fi
7+
if [ $(dirname $0) != "." ]; then
8+
echo "Script must be run directly in the ynl-c directory"
9+
exit 1
10+
fi
11+
12+
KSRC=$1
13+
14+
cp -v ${KSRC}/tools/net/ynl/Makefile.deps ./
15+
sed -i 's@^UAPI_PATH:=.*@UAPI_PATH:=../@' Makefile.deps
16+
17+
mkdir -p include/linux/
18+
for hdr in $(cat Makefile.deps | sed -n 's/.*,\([^,]*\.h\))/\1/p'); do
19+
cp -v ${KSRC}/include/uapi/linux/$hdr ./linux/
20+
done
21+
22+
cp -rv ${KSRC}/Documentation/netlink Documentation/

0 commit comments

Comments
 (0)