Index: ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
===================================================================
--- ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c	(revision 15837)
+++ ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c	(working copy)
@@ -1,6 +1,7 @@
 /** @file
   Main file for devices shell Driver1 function.
 
+  (C) Copyright 2012-2014, Hewlett-Packard Development Company, L.P.
   Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
@@ -114,6 +115,7 @@
 }
 
 STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
+  {L"-sfo", TypeFlag},
   {L"-l", TypeValue},
   {NULL, TypeMax}
   };
@@ -146,9 +148,11 @@
   UINTN               Children;
   CHAR16              *Name;
   CONST CHAR16        *Lang;
+  BOOLEAN             SfoFlag;
 
   ShellStatus         = SHELL_SUCCESS;
   Language            = NULL;
+  SfoFlag             = FALSE;
 
   //
   // initialize the shell lib (we must be in non-auto-init...)
@@ -203,10 +207,13 @@
 
       //
       // Print Header
-      // only in non SFO mode.
+
       //
-      if (!ShellCommandLineGetFlag(Package, L"-sfo")){
-        ShellPrintHiiEx(-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
+      if (ShellCommandLineGetFlag (Package, L"-sfo")) {
+        ShellPrintHiiEx (-1, -1, Language, STRING_TOKEN (STR_GEN_SFO_HEADER), gShellDriver1HiiHandle, L"devices");
+        SfoFlag = TRUE;
+      } else {
+        ShellPrintHiiEx (-1, -1, Language, STRING_TOKEN (STR_DEVICES_HEADER_LINES), gShellDriver1HiiHandle);
       }
 
       //
@@ -225,37 +232,20 @@
         Name = NULL;
         Status = GetDeviceHandleInfo(*HandleListWalker, &Type, &Cfg, &Diag, &Parents, &Devices, &Children, &Name, Language);
         if (Name != NULL && (Parents != 0 || Devices != 0 || Children != 0)) {
-          if (!ShellCommandLineGetFlag(Package, L"-sfo")){
-            ShellPrintHiiEx(
-              -1,
-              -1,
-              Language,
-              STRING_TOKEN(STR_DEVICES_ITEM_LINE),
-              gShellDriver1HiiHandle,
-              ConvertHandleToHandleIndex(*HandleListWalker),
-              Type,
-              Cfg?L'X':L'-',
-              Diag?L'X':L'-',
-              Parents,
-              Devices,
-              Children,
-              Name != NULL ? Name : L"<UNKNOWN>");
-          } else {
-            ShellPrintHiiEx(
-              -1,
-              -1,
-              Language,
-              STRING_TOKEN(STR_DEVICES_ITEM_LINE_SFO),
-              gShellDriver1HiiHandle,
-              ConvertHandleToHandleIndex(*HandleListWalker),
-              Type,
-              Cfg?L'Y':L'N',
-              Diag?L'Y':L'N',
-              Parents,
-              Devices,
-              Children,
-              Name != NULL ? Name : L"<UNKNOWN>");
-          }
+          ShellPrintHiiEx (
+            -1,
+            -1,
+            Language,
+            SfoFlag?STRING_TOKEN (STR_DEVICES_ITEM_LINE_SFO):STRING_TOKEN (STR_DEVICES_ITEM_LINE),
+            gShellDriver1HiiHandle,
+            ConvertHandleToHandleIndex (*HandleListWalker),
+            Type,
+            Cfg?L'Y':L'N',
+            Diag?L'Y':L'N',
+            Parents,
+            Devices,
+            Children,
+            Name!=NULL?Name:L"<UNKNOWN>");
         }
         if (Name != NULL) {
           FreePool(Name);
Index: ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni
===================================================================
--- ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni	(revision 15837)
+++ ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.uni	(working copy)
@@ -2,6 +2,8 @@
  
  / /   
+ / /   ( C )   C o p y r i g h t   2 0 1 2 - 2 0 1 4 ,   H e w l e t t - P a c k a r d   D e v e l o p m e n t   C o m p a n y ,   L . P . + 
  / /   C o p y r i g h t   ( c )   2 0 1 0   -   2 0 1 4 ,   I n t e l   C o r p o r a t i o n .   A l l   r i g h t s   r e s e r v e d . < B R >   
  / /   T h i s   p r o g r a m   a n d   t h e   a c c o m p a n y i n g   m a t e r i a l s @@ -84,6 +86,8 @@
  
  # s t r i n g   S T R _ G E N _ U E F I _ F U N C _ E R R O R       # l a n g u a g e   e n - U S   " % E E r r o r .   % N U E F I   f u n c t i o n   ' % B % s % N '   r e t u r n e d :   % r . \ r \ n "   
+ # s t r i n g   S T R _ G E N _ S F O _ H E A D E R                 # l a n g u a g e   e n - U S   " S h e l l C o m m a n d , " % s " \ r \ n " + 
    
  # s t r i n g   S T R _ D R V D I A G _ H E A D E R                 # l a n g u a g e   e n - U S   " % E A v a i l a b l e   D i a g n o s t i c s % N . \ r \ n " @@ -152,12 +156,24 @@
  
    
- # s t r i n g   S T R _ D E V I C E S _ H E A D E R _ L I N E S     # l a n g u a g e   e n - U S   " % N     C     T       D \ r \ n     T     Y   C   I \ r \ n     R     P   F   A \ r \ n     L     E   G   G   # P   # D   # C   D e v i c e   N a m e % N \ r \ n     = =   =   =   =   = =   = =   = =   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ r \ n " + # s t r i n g   S T R _ D E V I C E S _ H E A D E R _ L I N E S     # l a n g u a g e   e n - U S   " % N "   
- # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E           # l a n g u a g e   e n - U S   "   % H % 0 2 x % N   % 1 c   % 1 c   % 1 c   %   2 d   %   2 d   %   2 d   % s \ r \ n " + "           T       D \ r \ n "   
- # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E _ S F O   # l a n g u a g e   e n - U S   " D e v i c e s I n f o ,   % H % 0 2 x % N ,   % 1 c ,   % 1 c ,   % 1 c ,   % 2 d ,   % 2 d ,   % 2 d ,   % s \ r \ n " + "           Y   C   I \ r \ n "   
+ "           P   F   A \ r \ n " + 
+ " C T R L   E   G   G   # P   # D   # C     D e v i c e   N a m e \ r \ n " + 
+ " = = = =   =   =   =   = =   = =   = = =   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ r \ n " + 
+ # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E           # l a n g u a g e   e n - U S   " % H % 4 x % N   % 1 c   % 1 c   % 1 c   % 2 d   % 2 d   % 3 d   % s \ r \ n " + 
+ # s t r i n g   S T R _ D E V I C E S _ I T E M _ L I N E _ S F O   # l a n g u a g e   e n - U S   " D e v i c e s I n f o , " % x " , " % c " , " % c " , " % c " , " % d " , " % d " , " % d " , " % s " \ r \ n " + 
+ + 
  # s t r i n g   S T R _ D R I V E R S _ H E A D E R _ L I N E S     # l a n g u a g e   e n - U S   " % N                         T       D \ r \ n D                       Y   C   I \ r \ n R                       P   F   A \ r \ n V     V E R S I O N     E   G   G   # D   # C   D R I V E R   N A M E                                                   I M A G E   N A M E \ r \ n = = =   = = = = = = =   =   =   =   = =   = =   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   = = = = = = = = = = \ r \ n "   
  # s t r i n g   S T R _ D R I V E R S _ I T E M _ L I N E           # l a n g u a g e   e n - U S   " % H % 3 x % N   % 0 8 x   % 1 c   % 1 c   % 1 c   % - 2 d   % - 2 d   %   3 5 s   % s \ r \ n " @@ -798,64 +814,68 @@
  
  " . S H   S Y N O P S I S \ r \ n "   
- " d e v i c e s   [ - b ]   [ - l   X X X ]   \ r \ n " + "   \ r \ n "   
+ " D E V I C E S   [ - b ]   [ - l   X X X ]   [ - s f o ]   \ r \ n " + 
  " . S H   O P T I O N S \ r \ n "   
- " - b                       -   D i s p l a y   o n e   s c r e e n   a t   a   t i m e \ r \ n " + "   \ r \ n "   
- " - l   X X X               -   D i s p l a y   d e v i c e s   u s i n g   t h e   s p e c i f i e d   I S O   6 3 9 - 2   l a n g u a g e \ r \ n " + "     - b           -   D i s p l a y   o n e   s c r e e n   a t   a   t i m e \ r \ n "   
+ "     - l   X X X   -   D i s p l a y   d e v i c e s   u s i n g   t h e   s p e c i f i e d   I S O   6 3 9 - 2   l a n g u a g e \ r \ n " + 
+ "     - s f o       -   D i s p l a y s   i n f o r m a t i o n   a s   d e s c r i b e d   i n   S t a n d a r d - F o r m a t   O u t p u t . \ r \ n " + 
  " . S H   D E S C R I P T I O N \ r \ n "   
- " T h e   c o m m a n d   p r i n t s   a   l i s t   o f   d e v i c e s   t h a t   a r e   b e i n g   m a n a g e d   b y   d r i v e r s   t h a t   f o l l o w   t h e   U E F I   D r i v e r   M o d e l . \ r \ n " + "   \ r \ n "   
- " . S H   E X A M P L E S \ r \ n " + " N O T E S : \ r \ n "   
- "         T o   d i s p l a y   a l l   d e v i c e s   c o m p l i a n t   w i t h   t h e   E F I   D r i v e r   M o d e l \ r \ n " + "     1 .   T h e   c o m m a n d   p r i n t s   a   l i s t   o f   d e v i c e s   t h a t   a r e   b e i n g   m a n a g e d   b y   d r i v e r s \ r \ n "   
- "     S h e l l >   d e v i c e s \ r \ n " + "           t h a t   f o l l o w   t h e   U E F I   D r i v e r   M o d e l . \ r \ n "   
- "     C     T       D \ r \ n " + "     2 .   D i s p l a y   F o r m a t : \ r \ n "   
- "     T     Y   C   I \ r \ n " + "               C T R L                   -   T h e   h a n d l e   n u m b e r   o f   t h e   U E F I   d e v i c e \ r \ n "   
- "     R     P   F   A \ r \ n " + "               T Y P E                   -   T h e   d e v i c e   t y p e : \ r \ n "   
- "     L     E   G   G   # P   # D   # C   D e v i c e   N a m e \ r \ n " + "                                                 [ R ]   -   R o o t   C o n t r o l l e r \ r \ n "   
- "     = =   =   =   =   = =   = =   = =   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \ r \ n " + "                                                 [ B ]   -   B u s   C o n t r o l l e r \ r \ n "     
- "     2 0   R   -   -     -     1   1 3   V e n H w ( 5 8 C 5 1 8 B 1 - 7 6 F 3 - 1 1 D 4 - B C E A - 0 0 8 0 C 7 3 C 8 8 8 1 ) \ r \ n " + "                                                 [ D ]   -   D e v i c e   C o n t r o l l e r \ r \ n "   
- "     3 D   D   -   -     3     -     -   P r i m a r y   C o n s o l e   I n p u t   D e v i c e \ r \ n " + "               C F G                     -   A   m a n a g i n g   d r i v e r   s u p p o r t s   t h e   D r i v e r   C o n f i g u r a t i o n \ r \ n "   
- "     3 E   D   -   -     3     -     -   P r i m a r y   C o n s o l e   O u t p u t   D e v i c e \ r \ n " + "                                             P r o t o c o l \ r \ n "   
- "     6 4   B   -   -     1     6     2   " U G A   W i n d o w   1 \ r \ n " + "               D I A G                   -   A   m a n a g i n g   d r i v e r   s u p p o r t s   t h e   D r i v e r   D i a g n o s t i c s   P r o t o c o l \ r \ n "   
- "     6 5   B   -   -     1     6     2   U G A   W i n d o w   2 " \ r \ n " + "               # P                       -   T h e   n u m b e r   o f   p a r e n t   c o n t r o l l e r s   f o r   t h i s   d e v i c e \ r \ n "   
- "     6 6   B   -   -     1     1     1   E F I _ W I N _ N T _ S E R I A L _ P O R T = C O M 1 \ r \ n " + "               # D                       -   T h e   n u m b e r   o f   d r i v e r s   m a n a g i n g   t h e   d e v i c e \ r \ n "   
- "     6 7   B   -   -     1     1     1   C O M 1 \ r \ n " + "               # C                       -   T h e   n u m b e r   o f   c h i l d   c o n t r o l l e r s   p r o d u c e d   b y   t h i s   d e v i c e \ r \ n "   
- "     6 8   B   -   -     1     4     2   P C - A N S I   S e r i a l   C o n s o l e \ r \ n " + "               D E V I C E   N A M E     -   T h e   n a m e   o f   t h e   d e v i c e   f r o m   t h e   C o m p o n e n t   N a m e   P r o t o c o l \ r \ n "   
- "     6 9   D   -   -     1     -     -   E F I _ W I N _ N T _ S E R I A L _ P O R T = C O M 2 \ r \ n " + " . S H   E X A M P L E S \ r \ n "   
- "     6 E   D   -   -     1     -     -   E F I _ W I N _ N T _ P H Y S I C A L _ D I S K S = e : R W ; 2 6 2 1 4 4 ; 5 1 2 \ r \ n " + "   \ r \ n "   
- "     6 F   D   -   -     1     -     -   E F I _ W I N _ N T _ C P U _ M O D E L = I n t e l ( R )   P r o c e s s o r   M o d e l \ r \ n " + " E X A M P L E S : \ r \ n "   
- "     7 0   D   -   -     1     -     -   E F I _ W I N _ N T _ C P U _ S P E E D = 3 0 0 0 \ r \ n " + "     *   T o   d i s p l a y   a l l   d e v i c e s   c o m p l i a n t   w i t h   t h e   U E F I   D r i v e r   M o d e l : \ r \ n "   
- "     7 1   D   -   -     1     -     -   E F I _ M E M O R Y _ S I Z E = 6 4 \ r \ n " + "         S h e l l >   d e v i c e s \ r \ n "   
- "     7 2   D   -   -     1     -     -   E F I _ M E M O R Y _ S I Z E = 6 4 \ r \ n " + "   \ r \ n "   
- " \ r \ n " - 
    
  # s t r i n g   S T R _ G E T _ H E L P _ C O N N E C T             # l a n g u a g e   e n - U S   " " 