Last change
on this file since 2440 was
2123,
checked in by broder, 16 years ago
|
Use aptitude in invirt-update-ai-guest, and guarantee that it'll be
installed.
|
-
Property svn:executable set to
*
|
File size:
843 bytes
|
Rev | Line | |
---|
[2018] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | set -e |
---|
| 4 | |
---|
| 5 | export VG=xenvg |
---|
| 6 | export INSTALLLV=s_install_hda |
---|
| 7 | export INSTALLPATH="/dev/$VG/$INSTALLLV" |
---|
| 8 | export UPDATEPATH="/dev/$VG/update_$INSTALLLV" |
---|
| 9 | export MAPPERPATH="/dev/mapper/$VG-update_$INSTALLLV" |
---|
| 10 | export MOUNTDIRS="/dev /proc /sys" |
---|
| 11 | |
---|
| 12 | clean_up() { |
---|
| 13 | set +e |
---|
| 14 | |
---|
| 15 | for i in $MOUNTDIRS; do |
---|
| 16 | umount "/mnt/install$i" |
---|
| 17 | done |
---|
| 18 | |
---|
| 19 | umount /mnt/install |
---|
| 20 | kpartx -d "$UPDATEPATH" |
---|
| 21 | lvchange -a y "$UPDATEPATH" |
---|
| 22 | lvrename "$UPDATEPATH" "$INSTALLPATH" |
---|
| 23 | exit 0 |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | trap clean_up ERR |
---|
| 27 | |
---|
| 28 | lvchange -a n "$INSTALLPATH" |
---|
| 29 | lvrename "$INSTALLPATH" "$UPDATEPATH" |
---|
| 30 | lvchange -a ey "$UPDATEPATH" |
---|
| 31 | kpartx -a "$UPDATEPATH" |
---|
| 32 | |
---|
| 33 | mkdir -p /mnt/install |
---|
| 34 | mount "${MAPPERPATH}1" /mnt/install |
---|
| 35 | |
---|
| 36 | for i in $MOUNTDIRS; do |
---|
| 37 | mount --bind $i "/mnt/install$i" |
---|
| 38 | done |
---|
| 39 | |
---|
[2123] | 40 | chroot /mnt/install aptitude update |
---|
| 41 | chroot /mnt/install aptitude dist-upgrade |
---|
[2018] | 42 | |
---|
| 43 | clean_up |
---|
Note: See
TracBrowser
for help on using the repository browser.