mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Add better uname replacement.
Supports faking kernel release and supports ARM.
This commit is contained in:
32
src/scripts/uname
Normal file
32
src/scripts/uname
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
uname=
|
||||
for i in /bin/uname.bak /tools/bin/uname.bak; do
|
||||
if [ -x "$i" ]; then
|
||||
uname=${i}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${uname}" ]; then
|
||||
exit 127
|
||||
fi
|
||||
|
||||
machine=$(${uname} -m)
|
||||
kernel=$(${uname} -r)
|
||||
output=$(${uname} $@)
|
||||
|
||||
# Overwrite kernel version to hack kernel 3.x versions.
|
||||
output=$(sed -e "s/${kernel}/${KVER}/g" <<<${output})
|
||||
|
||||
case "${machine}" in
|
||||
arm*)
|
||||
echo "${output}" | \
|
||||
sed -e "s/armv.tej?l?/${MACHINE}/g"
|
||||
;;
|
||||
|
||||
i?86)
|
||||
echo "${output}" | \
|
||||
sed -e "s/i.86/${MACHINE}/g"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user