Last change
on this file since 2018 was
2018,
checked in by broder, 16 years ago
|
Add a script to automate updating the autoinstaller guest.
|
-
Property svn:executable set to
*
|
File size:
841 bytes
|
Line | |
---|
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 | |
---|
40 | chroot /mnt/install apt-get update |
---|
41 | chroot /mnt/install apt-get dist-upgrade |
---|
42 | |
---|
43 | clean_up |
---|
Note: See
TracBrowser
for help on using the repository browser.