3 # AMANDA_CHECK_DEVICE_PREFIXES
7 # Check for the prefixes used for particular devices. If the prefixes
8 # are broken on this system (Sinix and HPUX), suggest how to fix them.
10 # Substitutes CLIENT_SCRIPTS_OPT with the name of the script used to fix
13 # Defines DEV_PREFIX and RDEV_PREFIX to the appropriate prefixes.
15 AC_DEFUN([AMANDA_CHECK_DEVICE_PREFIXES],
17 # disk device prefixes
18 AC_MSG_CHECKING(disk device prefixes)
20 # Use df to find the mount point for the root filesystem. Use
21 # the positional parameters to find the particular line from df
22 # that contains the root paritition. We put it in a subshell so
23 # that the original positional parameters are not messed with.
25 df / | while read line; do
27 dnl @S|@ means $ to m4
28 while test @S|@# -gt 0; do
29 if test "x@S|@1" = "x/"; then
36 ) | sed 's/(//' | sed 's/)//' `
38 # Search for the mount point by using expr to find the parameter
42 dnl @S|@ means $ to m4
43 while test @S|@# -gt 0; do
44 if expr "@S|@1" : '.*dev' >/dev/null 2>&1; then
52 # get any system-specific configuration information
55 CLIENT_SCRIPTS_OPT=amhpfixdevs
58 AMANDA_MSG_WARN([Run amhpfixdevs on HP-UX systems using /dev/vg??.])
64 RDEV_PREFIX=/dev/rdsk/
65 CLIENT_SCRIPTS_OPT=amsinixfixdevs
66 if ! test -d /dev/dsk; then
67 AMANDA_MSG_WARN([Run amsinixfixdevs on Sinix systems using VxFS.])
79 if test "$DEV_PREFIX" && test "$RDEV_PREFIX"; then
80 AC_MSG_RESULT((predefined) $DEV_PREFIX - $RDEV_PREFIX)
82 if test -d /dev/dsk; then
84 if test -d /dev/rdsk; then
85 RDEV_PREFIX=/dev/rdsk/
89 elif test -d /dev; then
92 # Some systems, notably Linux, do not have raw disk devices
93 # names. Check this by trying to see if a raw disk device name
94 # exists using the normal raw device path prepended to the
95 # mount point of the root filesystem.
96 if test "$mount"; then
97 dev_name="/dev/r`basename $mount`"
98 if test -b $dev_name -o -c $dev_name; then
111 AC_MSG_RESULT($DEV_PREFIX - $RDEV_PREFIX)
114 AC_DEFINE_UNQUOTED(DEV_PREFIX,"${DEV_PREFIX}",
115 [Define as the prefix for disk devices, commonly /dev/ or /dev/dsk/ ])
116 AC_DEFINE_UNQUOTED(RDEV_PREFIX,"${RDEV_PREFIX}",
117 [Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ ])
118 AC_SUBST(CLIENT_SCRIPTS_OPT)