18c2ecf20Sopenharmony_ci#!/bin/sh 28c2ecf20Sopenharmony_ci# SPDX-License-Identifier: LGPL-2.1 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/linux/ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ciprintf "static const char *mount_flags[] = {\n" 78c2ecf20Sopenharmony_ciregex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MS_([[:alnum:]_]+)[[:space:]]+([[:digit:]]+)[[:space:]]*.*' 88c2ecf20Sopenharmony_ciegrep $regex ${header_dir}/mount.h | egrep -v '(MSK|VERBOSE|MGC_VAL)\>' | \ 98c2ecf20Sopenharmony_ci sed -r "s/$regex/\2 \2 \1/g" | sort -n | \ 108c2ecf20Sopenharmony_ci xargs printf "\t[%s ? (ilog2(%s) + 1) : 0] = \"%s\",\n" 118c2ecf20Sopenharmony_ciregex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MS_([[:alnum:]_]+)[[:space:]]+\(1<<([[:digit:]]+)\)[[:space:]]*.*' 128c2ecf20Sopenharmony_ciegrep $regex ${header_dir}/mount.h | \ 138c2ecf20Sopenharmony_ci sed -r "s/$regex/\2 \1/g" | \ 148c2ecf20Sopenharmony_ci xargs printf "\t[%s + 1] = \"%s\",\n" 158c2ecf20Sopenharmony_ciprintf "};\n" 16