[Rear-users] SF.net SVN: rear:[577] trunk/usr/share/rear

Schlomo Schapiro schlomo at schapiro.org
Tue Jun 7 17:09:07 CEST 2011


hi,

cool! Could you please modify the code to adhere to the tri-state
variable definition?

Thanks,
Schlomo

Am 07.06.2011 17:02, schrieb dag- at users.sourceforge.net:
> Revision: 577
>           http://rear.svn.sourceforge.net/rear/?rev=577&view=rev
> Author:   dag-
> Date:     2011-06-07 15:02:35 +0000 (Tue, 07 Jun 2011)
> 
> Log Message:
> -----------
> Implement UID LED support in udev workflow
> 
> Modified Paths:
> --------------
>     trunk/usr/share/rear/conf/default.conf
>     trunk/usr/share/rear/lib/udev-workflow.sh
> 
> Modified: trunk/usr/share/rear/conf/default.conf
> ===================================================================
> --- trunk/usr/share/rear/conf/default.conf	2011-06-07 14:32:34 UTC (rev 576)
> +++ trunk/usr/share/rear/conf/default.conf	2011-06-07 15:02:35 UTC (rev 577)
> @@ -145,12 +145,15 @@
>  # Define the default WORKFLOW for the udev handler (empty to disable)
>  UDEV_WORKFLOW=mkrescue
>  
> -# Beep when udev handler has finished ?
> +# Beep when udev handler has finished
>  UDEV_BEEP=y
>  
>  # Suspend the (USB) device when udev handler has finished ?
>  UDEV_SUSPEND=y
>  
> +# Turn the UID led on during udev workflow
> +UDEV_UID_LED=y
> +
>  ##
>  # PXE stuff
>  ##
> 
> Modified: trunk/usr/share/rear/lib/udev-workflow.sh
> ===================================================================
> --- trunk/usr/share/rear/lib/udev-workflow.sh	2011-06-07 14:32:34 UTC (rev 576)
> +++ trunk/usr/share/rear/lib/udev-workflow.sh	2011-06-07 15:02:35 UTC (rev 577)
> @@ -47,9 +47,23 @@
>      type -t WORKFLOW_$WORKFLOW >/dev/null
>      StopIfError "Udev workflow '$UDEV_WORKFLOW' does not exist"
>  
> +    # Turn the UID led on
> +    if type -p hpasmcli &>/dev/null && [[ "$UDEV_UID_LED" =~ ^[yY1] ]]; then
> +        hpasmcli -s "set uid on" >&8
> +    fi
> +
>      # Run udev workflow
>      WORKFLOW_$UDEV_WORKFLOW "${ARGS[@]}"
>  
> +    # Blink the UID led and turn it off
> +    if type -p hpasmcli &>/dev/null && [[ "$UDEV_UID_LED" =~ ^[yY1] ]]; then
> +        hpasmcli -s "set uid off" >&8; sleep 0.5
> +        hpasmcli -s "set uid on" >&8; sleep 0.5
> +        hpasmcli -s "set uid off" >&8; sleep 0.5
> +        hpasmcli -s "set uid on" >&8; sleep 0.5
> +        hpasmcli -s "set uid off" >&8
> +    fi
> +
>      # Suspend USB port (works fine on RHEL6, fails on RHEL5 and older)
>      if [[ "$DEVPATH" && "$UDEV_SUSPEND" =~ ^[yY1] ]]; then
>          path="/sys$DEVPATH"
> @@ -69,12 +83,12 @@
>          if grep -q pcpskr /proc/modules || modprobe pcspkr; then
>              Log "Beep through PC speaker."
>              if type -p beep &>/dev/null; then
> -                # After testing in a loud datacenter, this seems the best
> +                # After testing in a noisy datacenter, this seems the best
>                  # (although it takes up 4 seconds)
> -                beep -f 2000 -l 1000 -d 500 -r 3
> +                beep -f 2000 -l 1000 -d 500 -r 3 >&8
>              else
>                  for i in $(seq 1 15); do
> -                    echo -e "\007" >/dev/tty0
> +                    echo -en "\a" >/dev/tty0
>                      sleep 0.05
>                  done
>              fi
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
> 
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Rear-users mailing list
> Rear-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rear-users




More information about the rear-users mailing list