Blame scripts/config-uname.sh

Packit 6c4009
#!/bin/sh
Packit 6c4009
Packit 6c4009
config_os=$1
Packit 6c4009
config_release=$2
Packit 6c4009
uname_machine=$3
Packit 6c4009
Packit 6c4009
uname_sysname=`echo $config_os | sed 's/[0-9.]*$//'`
Packit 6c4009
if test $uname_sysname != $config_os; then
Packit 6c4009
  config_release=`echo $config_os | sed s/$uname_sysname//`
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
if test -r /vmunix; then
Packit 6c4009
  kernel_id=`strings /vmunix | grep UNIX`
Packit 6c4009
elif test -r /dynix; then
Packit 6c4009
  kernel_id=`strings /dynix | grep DYNIX`
Packit 6c4009
else
Packit 6c4009
  kernel_id=
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
Packit 6c4009
if test x`echo "$config_release" | sed "s/^$kernel_release//"` \
Packit 6c4009
       != x$config_release; then
Packit 6c4009
  # The configuration release is a substring of the kernel release.
Packit 6c4009
  uname_release=$kernel_release
Packit 6c4009
elif test x$config_release != x; then
Packit 6c4009
  uname_release=$config_release
Packit 6c4009
elif test x$kernel_release != x; then
Packit 6c4009
  uname_release=$kernel_release
Packit 6c4009
else
Packit 6c4009
  uname_release=unknown
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
Packit 6c4009
if test -n "$kernel_version"; then
Packit 6c4009
  uname_version="$kernel_version"
Packit 6c4009
else
Packit 6c4009
  uname_version=unknown
Packit 6c4009
fi
Packit 6c4009
Packit 6c4009
cat <
Packit 6c4009
/* This file is generated by $0.  DO NOT EDIT.
Packit 6c4009
Packit 6c4009
   This is used only by the generic uname function for systems with no real
Packit 6c4009
   uname call.  If this data is not correct, it does not matter much.  */
Packit 6c4009
Packit 6c4009
#define UNAME_SYSNAME "$uname_sysname"
Packit 6c4009
#define UNAME_RELEASE "$uname_release"
Packit 6c4009
#define UNAME_VERSION "$uname_version"
Packit 6c4009
#define UNAME_MACHINE "$uname_machine"
Packit 6c4009
EOF