Ignore:
Timestamp:
May 3, 2009, 1:19:10 AM (16 years ago)
Author:
broder
Message:

In invirt-autoinstaller:

  • Switch the grub config and /etc/fstab to using UUIDs for specifying the boot and swap partitions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-autoinstaller/common/usr/lib/xen-tools/debian.d/93-setup-grub

    r2337 r2339  
    6969
    7070#
     71# Since pv_ops kernels force block device names to xvda, xvdb, etc,
     72# the default root value of root=/dev/hda won't actually help us.
     73#
     74# To work around that, find a UUID for the swap and root partitions
     75# and use that in the grub config (and also in /etc/fstab)
     76#
     77ROOT_DEV="$(perl -e 'print $ENV{"image-dev"}')"
     78SWAP_DEV="$(perl -e 'print $ENV{"swap-dev"}')"
     79ROOT_UUID="$(vol_id --uuid "$ROOT_DEV")"
     80SWAP_UUID="$(vol_id --uuid "$SWAP_DEV")"
     81sed -i -e "s#root=[^ ]*#root=UUID=$ROOT_UUID#" ${prefix}/boot/grub/menu.lst
     82sed -i -e "s#${ROOT_DEV}#${ROOT_UUID}#" ${prefix}/etc/fstab
     83sed -i -e "s#${SWAP_DEV}#${SWAP_UUID}#" ${prefix}/etc/fstab
     84
     85#
    7186# Regenerate automagic kernels list
    7287#
Note: See TracChangeset for help on using the changeset viewer.