(eval . (c-set-offset 'arglist-close 0))))
(nxml-mode . ((nxml-child-indent . 2)
(fill-column . 119)))
- (meson-mode . ((meson-indent-basic . 8))))
+ (meson-mode . ((meson-indent-basic . 8)))
+ (sh-mode . ((sh-basic-offset . 8)
+ (sh-indentation . 8)))
+ (awk-mode . ((c-basic-offset . 8))))
-BEGIN{ print "static const char* const af_names[] = { "}
+BEGIN{
+ print "static const char* const af_names[] = { "
+}
!/AF_FILE/ && !/AF_ROUTE/ && !/AF_LOCAL/ {
- printf " [%s] = \"%s\",\n", $1, $1
+ printf " [%s] = \"%s\",\n", $1, $1
+}
+END{
+ print "};"
}
-END{print "};"}
-BEGIN{ print "static const char* const arphrd_names[] = { "}
+BEGIN{
+ print "static const char* const arphrd_names[] = { "
+}
!/CISCO/ {
- printf " [ARPHRD_%s] = \"%s\",\n", $1, $1
+ printf " [ARPHRD_%s] = \"%s\",\n", $1, $1
+}
+END{
+ print "};"
}
-END{print "};"}
-BEGIN{ print "static const char* const capability_names[] = { "}
+BEGIN{
+ print "static const char* const capability_names[] = { "
+}
{
- printf " [%s] = \"%s\",\n", $1, tolower($1)
+ printf " [%s] = \"%s\",\n", $1, tolower($1)
+}
+END{
+ print "};"
}
-END{print "};"}
-BEGIN{ print "static const char* const errno_names[] = { " }
+BEGIN{
+ print "static const char* const errno_names[] = { "
+}
!/EDEADLOCK/ && !/EWOULDBLOCK/ && !/ENOTSUP/ {
- printf " [%s] = \"%s\",\n", $1, $1 }
-END{ print "};" }
+ printf " [%s] = \"%s\",\n", $1, $1
+}
+END{
+ print "};"
+}
#!/bin/sh -eu
$1 -E -dM -include sys/socket.h - </dev/null | \
- grep -Ev 'AF_UNSPEC|AF_MAX' | \
- awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
+ grep -Ev 'AF_UNSPEC|AF_MAX' | \
+ awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
#!/bin/sh -eu
$1 -dM -include net/if_arp.h - </dev/null | \
- awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
- sed -e 's/ARPHRD_//'
+ awk '/^#define[ \t]+ARPHRD_[^ \t]+[ \t]+[^ \t]/ { print $2; }' | \
+ sed -e 's/ARPHRD_//'
#!/bin/sh -eu
$1 -dM -include linux/capability.h -include "$2" -include "$3" - </dev/null | \
- awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
- grep -v CAP_LAST_CAP
+ awk '/^#define[ \t]+CAP_[A-Z_]+[ \t]+/ { print $2; }' | \
+ grep -v CAP_LAST_CAP
#!/bin/sh -eu
$1 -dM -include errno.h - </dev/null | \
- awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
+ awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
#!/bin/sh -eu
if nm -D -u "$1" | grep ' U '; then
- echo "Undefined symbols detected!"
- exit 1
+ echo "Undefined symbols detected!"
+ exit 1
fi
BEGIN{
- keywords=0 ; FS="," ;
- print "extern const char load_fragment_gperf_nulstr[];" ;
- print "const char load_fragment_gperf_nulstr[] ="
+ keywords=0 ; FS="," ;
+ print "extern const char load_fragment_gperf_nulstr[];" ;
+ print "const char load_fragment_gperf_nulstr[] ="
}
keyword==1 {
- print "\"" $$1 "\\0\""
+ print "\"" $$1 "\\0\""
}
/%%/ {
- keyword=1
+ keyword=1
+}
+END {
+ print ";"
}
-END { print ";" }
-BEGIN{ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {" }
+BEGIN{
+ print "const char *audit_type_to_string(int type) {\n\tswitch(type) {"
+}
{
printf " case AUDIT_%s: return \"%s\";\n", $1, $1
}
-END{ print " default: return NULL;\n\t}\n}\n" }
+END{
+ print " default: return NULL;\n\t}\n}\n"
+}
includes=""
for i in "$@"; do
- includes="$includes -include $i"
+ includes="$includes -include $i"
done
$cpp -dM $includes - </dev/null | \
- grep -vE 'AUDIT_.*(FIRST|LAST)_' | \
- sed -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | \
- sort -k2
+ grep -vE 'AUDIT_.*(FIRST|LAST)_' | \
+ sed -r -n 's/^#define\s+AUDIT_(\w+)\s+([0-9]{4})\s*$$/\1\t\2/p' | \
+ sort -k2
-BEGIN{ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {" }
+BEGIN{
+ print "const char *dns_type_to_string(int type) {\n\tswitch(type) {"
+}
{
- printf " case DNS_TYPE_%s: return ", $1;
- sub(/_/, "-");
- printf "\"%s\";\n", $1
+ printf " case DNS_TYPE_%s: return ", $1;
+ sub(/_/, "-");
+ printf "\"%s\";\n", $1
+}
+END{
+ print " default: return NULL;\n\t}\n}\n"
}
-END{ print " default: return NULL;\n\t}\n}\n" }
BEGIN {
- print "/* GENERATED FILE */";
- print "#define ORDERED"
+ print "/* GENERATED FILE */";
+ print "#define ORDERED"
}
{
- if (!match($0, "^#include"))
- gsub(/hashmap/, "ordered_hashmap");
- gsub(/HASHMAP/, "ORDERED_HASHMAP");
- gsub(/Hashmap/, "OrderedHashmap");
- print
+ if (!match($0, "^#include"))
+ gsub(/hashmap/, "ordered_hashmap");
+ gsub(/HASHMAP/, "ORDERED_HASHMAP");
+ gsub(/Hashmap/, "OrderedHashmap");
+ print
}
#!/bin/sh -eu
$1 -dM -include linux/input.h - </dev/null | \
- awk '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($2 != "KEY_MAX") { print $2 } }'
+ awk '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9K]/ { if ($2 != "KEY_MAX") { print $2 } }'
boot_stub="$3"
splash_bmp="$4"
if [ -z "$out" -o -z "$systemd_efi" -o -z "$boot_stub" -o -z "$splash_bmp" ]; then
- exit 1
+ exit 1
fi
# create GPT table with EFI System Partition
mkdir mnt/EFI/Linux
echo -n "foo=yes bar=no root=/dev/fakeroot debug rd.break=initqueue" >mnt/cmdline.txt
objcopy \
- --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
- --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
- --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \
- --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \
- --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \
- "$boot_stub" mnt/EFI/Linux/linux-test.efi
+ --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x20000 \
+ --add-section .cmdline=mnt/cmdline.txt --change-section-vma .cmdline=0x30000 \
+ --add-section .splash="$splash_bmp" --change-section-vma .splash=0x40000 \
+ --add-section .linux=/boot/$(cat /etc/machine-id)/$(uname -r)/linux --change-section-vma .linux=0x2000000 \
+ --add-section .initrd=/boot/$(cat /etc/machine-id)/$(uname -r)/initrd --change-section-vma .initrd=0x3000000 \
+ "$boot_stub" mnt/EFI/Linux/linux-test.efi
# install entries
mkdir -p mnt/loader/entries
# output width
if "$1" --help | grep -v 'default:' | grep -E -q '.{80}.'; then
- echo "$(basename "$1") --help output is too wide:"
- "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
- exit 1
+ echo "$(basename "$1") --help output is too wide:"
+ "$1" --help | awk 'length > 80' | grep -E --color=yes '.{80}'
+ exit 1
fi
# no --help output to stdout
if "$1" --help 2>&1 1>/dev/null | grep .; then
- echo "$(basename "$1") --help prints to stderr"
- exit 2
+ echo "$(basename "$1") --help prints to stderr"
+ exit 2
fi
# error output to stderr
if ! "$1" --no-such-parameter 2>&1 1>/dev/null | grep -q .; then
- echo "$(basename "$1") with an unknown parameter does not print to stderr"
- exit 3
+ echo "$(basename "$1") with an unknown parameter does not print to stderr"
+ exit 3
fi
#!/bin/sh -eu
git shortlog -s `git describe --abbrev=0`.. | \
- cut -c8- | \
- sed 's/ / /g' | \
- awk '{ print $$0 "," }' | \
- sort -u
+ cut -c8- | \
+ sed 's/ / /g' | \
+ awk '{ print $$0 "," }' | \
+ sort -u
mkdir -vp "$(dirname "${DESTDIR:-}$2")"
if [ "$(dirname $1)" = . ]; then
- ln -vfs -T "$1" "${DESTDIR:-}$2"
+ ln -vfs -T "$1" "${DESTDIR:-}$2"
else
- ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
+ ln -vfs -T --relative "${DESTDIR:-}$1" "${DESTDIR:-}$2"
fi
unit="$3"
case "$target" in
- */?*) # a path, but not just a slash at the end
- dir="${DESTDIR:-}${target}"
- ;;
- *)
- dir="${DESTDIR:-}${unitdir}/${target}"
- ;;
+ */?*) # a path, but not just a slash at the end
+ dir="${DESTDIR:-}${target}"
+ ;;
+ *)
+ dir="${DESTDIR:-}${unitdir}/${target}"
+ ;;
esac
unitpath="${DESTDIR:-}${unitdir}/${unit}"
case "$target" in
- */)
- mkdir -p -m 0755 "$dir"
- ;;
- *)
- mkdir -p -m 0755 "$(basename "$dir")"
- ;;
+ */)
+ mkdir -p -m 0755 "$dir"
+ ;;
+ *)
+ mkdir -p -m 0755 "$(basename "$dir")"
+ ;;
esac
ln -vfs --relative "$unitpath" "$dir"