~ubuntu-branches/ubuntu/dapper/grub-installer/dapper

« back to all changes in this revision

Viewing changes to grub-installer

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2006-02-13 12:18:02 UTC
  • Revision ID: james.westby@ubuntu.com-20060213121802-dpzuuklyoyxc0q7h
Tags: 1.12ubuntu6
Only mount /proc if it isn't already mounted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
 
174
174
# Run update-grub in $ROOT.
175
175
update_grub () {
176
 
        $chroot $ROOT mount /proc
 
176
        umountproc=false
 
177
        if [ ! -e $ROOT/proc/cmdline ]; then
 
178
                $chroot $ROOT mount /proc
 
179
                umountproc=:
 
180
        fi
177
181
        if ! log-output -t grub-installer $chroot $ROOT /sbin/update-grub -y ; then
178
182
                error "Running 'update-grub -y' failed." 1>&2
179
183
                db_input critical grub-installer/update-grub-failed || [ $? -eq 30 ]
180
184
                db_go || true
181
185
                db_progress STOP
182
 
                $chroot $ROOT umount /proc
 
186
                if $umountproc; then
 
187
                        $chroot $ROOT umount /proc
 
188
                fi
183
189
                exit 1
184
190
        fi
185
 
        $chroot $ROOT umount /proc
 
191
        if $umountproc; then
 
192
                $chroot $ROOT umount /proc
 
193
        fi
186
194
}
187
195
 
188
196
findfstype () {