• Bug#250232: hdparm: 2 stage call at boot time (2/2)

    From =?iso-8859-1?Q?J=F6rg?= Sommer@1:229/2 to Stephen Gran on Wed Aug 11 00:50:05 2004
    [continued from previous message]

    set_option -E$VALUE
    ;;
    mult_sect_io)
    set_option -m$VALUE
    ;;
    prefetch_sect)
    set_option -P$VALUE
    ;;
    read_only)
    eval_value $VALUE -r
    ;;
    spindown_time)
    set_option -S$VALUE
    ;;
    interrupt_unmask)
    eval_value $VALUE -u
    ;;
    write_cache)
    eval_value $VALUE -W
    ;;
    transfer_mode)
    set_option -X$VALUE
    ;;
    acoustic_management)
    set_option -M$VALUE
    ;;
    keep_settings_over_reset)
    eval_value $VALUE -k
    ;;
    keep_features_over_reset)
    eval_value $VALUE -K
    ;;

    *)
    echo "unknown option $KEY"
    exit 1
    ;;
    esac
    ;;
    "")
    case $KEY in
    })
    if [ -z "$DISC" ]; then
    echo "No disk enabled. Exiting"
    exit 1
    fi
    if [ -n "$OPTIONS" ]; then
    # Flush the drive's internal write cache to the disk.
    echo /sbin/hdparm -q -f $DISC

    echo /sbin/hdparm $OPTIONS $DISC
    echo -n " $DISC,"
    fi
    ;;
    quiet)
    if [ -n "$DISC" ]; then
    OPT_QUIET=-q
    else
    DEF_QUIET=-q
    fi
    ;;
    standby)
    set_option -y
    ;;
    sleep)
    set_option -Y
    ;;
    disable_seagate)
    set_option -Z
    ;;
    *)
    echo "unknown option $KEY"
    exit 1
    ;;
    esac
    ;;
    *)
    echo "unknown separator $SEP"
    exit 1
    ;;
    esac
    done

    printf "\b.\n"

    exit 0

    --EeQfGwPcQSOJBaQU--

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)

    iD8DBQFBGUrAOyr72Bm2GZcRAuZFAJ924TcNFqKe889xEfVgANp+j6/gsQCZAUvG RgHPWV5n8Q1snKy7kJ8lWJ4=
    =2X9l
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Stephen Gran@1:229/2 to All on Thu Aug 12 06:30:11 2004
    [continued from previous message]

    + egrep -v '^[[:space:]]*(#|$)' /etc/hdparm.conf
    + read KEY SEP VALUE
    + '[' '' '!=' go ']'
    + case $SEP in
    + case $KEY in
    + '[' -n '' ']'
    + DEF_QUIET=-q
    + read KEY SEP VALUE
    + echo ' done.'
    done.

    steve@gashuffer:~$ sh -x /etc/rcS.d/S29hdparm start
    + set -e
    + case $1 in
    + grep -w -q nohdparm /proc/cmdline
    + raidstat=OK
    + '[' -e /proc/mdstat ']'
    + '[' -e /proc/rd/status ']'
    + '[' OK = OK ']'
    ++ /bin/mount
    ++ find_root_dev
    ++ read dev on dir junk
    ++ '[' -e /dev/hda1 -a / = / ']'
    +++ readlink --canonicalize /dev/hda1
    ++ ROOT_DEV=/dev/hda1
    ++ echo /dev/hda1
    ++ break
    + ROOT_DEV=/dev/hda1
    + case $0 in
    + case $ROOT_DEV in
    + ROOT_DEV=/dev/hda
    + echo -n 'Setting disc parameters:'
    Setting disc parameters:+ DISC=
    + DEFAULT=
    + OPTIONS=
    + DEF_QUIET=
    + OPT_QUIET=
    + /bin/sync
    + egrep -v '^[[:space:]]*(#|$)' /etc/hdparm.conf
    + read KEY SEP VALUE
    + '[' '' '!=' go ']'
    + case $SEP in
    + case $KEY in
    + '[' -n '' ']'
    + DEF_QUIET=-q
    + read KEY SEP VALUE
    + echo ' done.'
    done.

    steve@gashuffer:~$ sh -x /etc/rcS.d/S29hdparm start
    + set -e
    + case $1 in
    + grep -w -q nohdparm /proc/cmdline
    + raidstat=OK
    + '[' -e /proc/mdstat ']'
    + '[' -e /proc/rd/status ']'
    + '[' OK = OK ']'
    ++ /bin/mount
    ++ find_root_dev
    ++ read dev on dir junk
    ++ '[' -e /dev/hda1 -a / = / ']'
    +++ readlink --canonicalize /dev/hda1
    ++ ROOT_DEV=/dev/hda1
    ++ echo /dev/hda1
    ++ break
    + ROOT_DEV=/dev/hda1
    + case $0 in
    + case $ROOT_DEV in
    + ROOT_DEV=/dev/hda
    + echo -n 'Setting disc parameters:'
    Setting disc parameters:+ DISC=
    + DEFAULT=
    + OPTIONS=
    + DEF_QUIET=
    + OPT_QUIET=
    + /bin/sync
    + egrep -v '^[[:space:]]*(#|$)' /etc/hdparm.conf
    + read KEY SEP VALUE
    + '[' '' '!=' go ']'
    + case $SEP in
    + case $KEY in
    + '[' -n '' ']'
    + DEF_QUIET=-q
    + read KEY SEP VALUE
    + echo ' done.'
    done.

    At least here, it gets the $ROOT_DEV right both times, and when I put in testing stanzas, it does the right thing (your logic for that is
    unchanged).

    Thanks again,
    --
    -----------------------------------------------------------------
    | ,''`. Stephen Gran |
    | : :' : [email protected] |
    | `. `' Debian user, admin, and developer |
    | `- http://www.debian.org |
    -----------------------------------------------------------------

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.4 (GNU/Linux)

    iD8DBQFBGuwmSYIMHOpZA44RAn7tAKC9UzJkjHGDAb8PnYTYvSZO/L05XQCgmch0 4xqc1fw0c5s3swDCpc5rbFE=
    =hAUF
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)