Print this page
XXX Remove nawk(1)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/boot/scripts/update_grub.ksh
          +++ new/usr/src/cmd/boot/scripts/update_grub.ksh
↓ open down ↓ 38 lines elided ↑ open up ↑
  39   39  done
  40   40  
  41   41  ARCH=`uname -p`
  42   42  
  43   43  is_pcfs_boot=yes
  44   44  is_zfs_boot=no
  45   45  
  46   46  check_pcfs_boot()
  47   47  {
  48   48          bootdev=`grep -v "^#" "$ALT_ROOT"/etc/vfstab | grep pcfs \
  49      -            | grep "[       ]/stubboot[      ]" | nawk '{print $1}'`
       49 +            | grep "[       ]/stubboot[      ]" | /usr/xpg4/bin/awk '{print $1}'`
  50   50          if [ X"$bootdev" = "X" ]; then
  51   51                  is_pcfs_boot=no
  52   52          fi
  53   53  }
  54   54  
  55   55  check_zfs_boot()
  56   56  {
  57   57          if [ -f "$ALT_ROOT"/etc/lu/GRUB_slice ]; then
  58   58                  dev=`grep '^PHYS_SLICE=' "$ALT_ROOT"/etc/lu/GRUB_slice |
  59   59                      cut -d= -f2`
↓ open down ↓ 24 lines elided ↑ open up ↑
  84   84                          echo "$dev"
  85   85                  fi
  86   86                  return
  87   87          elif [ "$is_zfs_boot" = "yes" ]; then
  88   88                  rootpool=`df -k ${ALT_ROOT:-/} | tail +2 | cut -d/ -f1`
  89   89                  rootdevlist=`LC_ALL=C zpool iostat -v "$rootpool" | tail +5 |
  90   90                      egrep -v "mirror|spare|replacing" |
  91   91                      sed -n -e '/--/q' -e p | awk '{print $1}'`
  92   92          else
  93   93                  metadev=`grep -v "^#" "$ALT_ROOT"/etc/vfstab | \
  94      -                    grep "[      ]/[    ]" | nawk '{print $2}'`
       94 +                    grep "[      ]/[    ]" | /usr/xpg4/bin/awk '{print $2}'`
  95   95                  if [[ $metadev = /dev/rdsk/* ]]; then
  96   96                          rootdevlist=`basename "$metadev"`
  97   97                  elif [[ $metadev = /dev/md/rdsk/* ]]; then
  98   98                          metavol=`basename "$metadev"`
  99   99                          rootdevlist=`metastat -p $metavol |\
 100      -                            grep -v "^$metavol[  ]" | nawk '{print $4}'`
      100 +                            grep -v "^$metavol[  ]" | /usr/xpg4/bin/awk '{print $4}'`
 101  101                  fi
 102  102          fi
 103  103          for rootdev in $rootdevlist
 104  104          do
 105  105                  echo /dev/rdsk/`basename $rootdev`
 106  106          done
 107  107  }
 108  108  
 109  109  #
 110  110  # multiboot: install grub on the boot slice
↓ open down ↓ 4 lines elided ↑ open up ↑
 115  115          STAGE1="$ALT_ROOT"/boot/grub/stage1
 116  116          STAGE2="$ALT_ROOT"/boot/grub/stage2
 117  117  
 118  118          if [ $is_pcfs_boot = yes ]; then
 119  119                  #
 120  120                  # Note: /stubboot/boot/grub/stage2 must stay untouched.
 121  121                  #
 122  122                  mkdir -p "$ALT_ROOT"/stubboot/boot/grub
 123  123                  cp "$ALT_ROOT"/boot/grub/menu.lst "$ALT_ROOT"/stubboot/boot/grub
 124  124                  bootdev=`grep -v "^#" "$ALT_ROOT"/etc/vfstab | grep pcfs | \
 125      -                        grep "[  ]/stubboot[    ]" | nawk '{print $1}'`
      125 +                        grep "[  ]/stubboot[    ]" | /usr/xpg4/bin/awk '{print $1}'`
 126  126                  rpcfsdev=`echo "$bootdev" | sed -e "s/dev\/dsk/dev\/rdsk/"`
 127  127                  if [ X"$rpcfsdev" != X ]; then
 128  128                          print "Installing grub on $rpcfsdev"
 129  129                          "$ALT_ROOT"/sbin/installgrub $STAGE1 $STAGE2 $rpcfsdev
 130  130                  fi
 131  131          fi
 132  132  
 133  133          grubdevlist=`get_rootdev_list`
 134  134          zfsarg=""
 135  135          if [ "$is_zfs_boot" = "yes" ]; then
↓ open down ↓ 26 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX