~josvaz/ubuntu-on-ec2/ec2-publishing-scripts-lp1613470-udev-cdrom

« back to all changes in this revision

Viewing changes to ec2-image2ebs

  • Committer: Robert C Jennings
  • Date: 2016-05-27 14:25:36 UTC
  • Revision ID: robert.jennings@canonical.com-20160527142536-3tha5e2ibwcoaiw5
Append grub options as root
      
Previously the script attempted to append to the grub config file
as the current user.  This patch changes this to properly use sudo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
                -e 's,^#GRUB_TERMINAL=console,GRUB_TERMINAL=console,' \
150
150
                "${mnt}/etc/default/grub"
151
151
        if [ -f "${mnt}/etc/default/grub.d/50-cloudimg-settings.cfg" ] ; then
152
 
                sudo echo GRUB_HIDDEN_TIMEOUT=0.1 >> \
153
 
                        "${mnt}/etc/default/grub.d/50-cloudimg-settings.cfg"
 
152
                echo GRUB_HIDDEN_TIMEOUT=0.1 | \
 
153
                        sudo tee --append \
 
154
                                "${mnt}/etc/default/grub.d/50-cloudimg-settings.cfg" > /dev/null
154
155
        fi
155
156
        for m in sys proc dev; do sudo mount --bind "/${m}" "${mnt}/${m}"; done
156
157
        sudo chroot "${mnt}" update-grub