fspick.sh (0898782247ae533d1f4e47a06bc5d4870931b284) fspick.sh (818448e9cf92e5c6b3c10320372eefcbe4174e4f)
1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1
3
4if [ $# -ne 1 ] ; then
5 linux_header_dir=tools/include/uapi/linux
6else
7 linux_header_dir=$1
8fi
9
10linux_mount=${linux_header_dir}/mount.h
11
12printf "static const char *fspick_flags[] = {\n"
13regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+FSPICK_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1
3
4if [ $# -ne 1 ] ; then
5 linux_header_dir=tools/include/uapi/linux
6else
7 linux_header_dir=$1
8fi
9
10linux_mount=${linux_header_dir}/mount.h
11
12printf "static const char *fspick_flags[] = {\n"
13regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+FSPICK_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
14egrep $regex ${linux_mount} | \
14grep -E $regex ${linux_mount} | \
15 sed -r "s/$regex/\2 \1/g" | \
16 xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
17printf "};\n"
15 sed -r "s/$regex/\2 \1/g" | \
16 xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
17printf "};\n"