kernel/scripts/orc_hash.sh
sevki c9e1dba412 chore(ci): setup github actions and workflows
setup CI/CD for kernel development
- added CodeQL for code scanning
- every pr is built as an image and is available for
  30days on https://oklinux.dev
- tagged and released on github for now

Signed-off-by: sevki <s@sevki.io>
2024-03-15 21:46:24 +00:00

17 lines
316 B
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) Meta Platforms, Inc. and affiliates.
set -e
printf '%s' '#define ORC_HASH '
awk '
/^#define ORC_(REG|TYPE)_/ { print }
/^struct orc_entry {$/ { p=1 }
p { print }
/^}/ { p=0 }' |
sha1sum |
cut -d " " -f 1 |
sed 's/\([0-9a-f]\{2\}\)/0x\1,/g'