Changeset 527
- Timestamp:
- May 12, 2008, 8:04:13 PM (17 years ago)
- Location:
- trunk/packages/sipb-xen-guest-installer/partial
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-guest-installer/partial/debootstrap-commands
r495 r527 1 #!/bin/sh 1 2 #http://www.debian.org/releases/stable/i386/apds03.html.en 2 3 3 SRC=/root/debootstrap.d4 SRCHOSTNAME=moo174 #SRC=/root/debootstrap.d 5 #SRCHOSTNAME=moo17 5 6 #HOSTNAME=debootstrap-test 6 7 #pick a hostname! 7 8 9 HOSTNAME=moo19 8 10 DIST=etch 11 IP=18.181.0.186 9 12 10 PARTITIONS=/root/ price/partitions/testpart13 PARTITIONS=/root/neboat/testpart 11 14 12 #losetup is crazy. pick a free loop device. see /usr/sbin/s-x-lvcopy for code. 13 14 VOLUME=/dev/xenvg/d_$HOSTNAME_hda 15 #DEST=/srv/$HOSTNAME/ 15 VOLUME=/dev/mapper/xenvg-d_${HOSTNAME}_hda 16 16 17 17 ### 18 18 ### Create the device for SIPB-Xen purposes 19 19 ### 20 sfdisk -f $VOLUME <$PARTITIONS 21 SWAPDEV=$(sipb-xen-losetup $VOLUME $(( 7903980 * 512 ))) 22 #mkswap $SWAPDEV 23 #losetup -d $LODEV 24 IMAGEDEV=$(sipb-xen-losetup $VOLUME $(( 63 * 512 ))) 20 sfdisk -H 255 -S 63 $VOLUME <$PARTITIONS 21 kpartx -a $VOLUME 22 #SWAPDEV=$(sipb-xen-losetup $VOLUME $(( 7903980 * 512 ))) 23 #IMAGEDEV=$(sipb-xen-losetup $VOLUME $(( 63 * 512 ))) 25 24 # mkfs.ext3 -b 1024 $IMAGEDEV $(( 7903917 / 2 )) 26 25 27 # mkdir -p $DEST 28 # mount $LODEV $DEST 26 #CREATE_IMAGE_CONFIG=./paravm-create.conf 29 27 30 CREATE_IMAGE_CONFIG=./paravm-create.conf 28 #xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --config $CREATE_IMAGE_CONFIG \ 29 # --dist $DIST --hostname $HOSTNAME 31 30 32 xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --config $CREATE_IMAGE_CONFIG \ 33 --dist $DIST --hostname $HOSTNAME 31 # xen-create-image --partitions sipb-xen --memory=256MB --ide --arch amd64 --dist etch --hostname moo19 --mirror http://debian.lcs.mit.edu/debian --ip=18.181.0.186 --netmask=255.255.0.0 --gateway=18.181.0.1 --cache 34 32 35 # xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --ide --arch amd64 --dist etch --hostname moo19 --mirror http://debian.lcs.mit.edu/debian --ip=18.181.0.186--netmask=255.255.0.0 --gateway=18.181.0.1 --cache33 xen-create-image --image-dev ${VOLUME}1 --swap-dev ${VOLUME}2 --fs ext3 --ide --memory 256M --arch amd64 --dist etch --hostname $HOSTNAME --mirror http://debian.lcs.mit.edu/debian --ip=$IP --netmask=255.255.0.0 --gateway=18.181.0.1 --cache 36 34 37 losetup -d $SWAPDEV 38 losetup -d $IMAGEDEV 35 kpartx -d $VOLUME 36 #losetup -d $SWAPDEV 37 #losetup -d $IMAGEDEV 39 38 40 time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian 41 42 cp -a $SRC/fstab $DEST/etc/fstab 43 cp -a $SRC/interfaces $DEST/etc/network/interfaces 44 cp -a $SRC/sources.list $DEST/etc/apt/sources.list 45 cp -a $SRC/update-grub.diff $DEST/root/update-grub.diff 46 echo $HOSTNAME > $DEST/etc/hostname 47 sed s/$SRCHOSTNAME/$HOSTNAME/g $SRC/hosts > $DEST/etc/hosts 48 49 mount -t proc proc $DEST/proc 50 51 LANG=C chroot "$DEST" <<ENDCHROOT 52 53 export TERM=xterm-color 54 mount -a 55 56 cd /media 57 mkdir cdrom0 58 ln -s cdrom0 cdrom 59 cd / 60 ln -s media/cdrom 61 62 echo $'y\n3\nEastern' | tzconfig 63 export DEBIAN_FRONTEND=noninteractive 64 65 echo 'locales locales/locales_to_be_generated multiselect en_US ISO-8859-1' | debconf-set-selections 39 ### This should be the end of the script 40 ### The material past this point is solely for reference purposes 66 41 67 42 68 aptitude update 69 aptitude -y install locales linux-image-xen-amd64 70 aptitude --without-recommends -y install ~pstandard ~prequired ~pimportant 71 #strace tasksel install standard 2>&1 | less 72 aptitude clean 43 # time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian 73 44 74 mkdir /boot/grub75 aptitude install grub 76 patch /usr/sbin/update-grub </root/update-grub.diff 77 update-grub 78 patch /boot/grub/menu.lst </root/menu.lst.diff 79 patch /etc/inittab </root/inittab.diff 45 # cp -a $SRC/fstab $DEST/etc/fstab 46 # cp -a $SRC/interfaces $DEST/etc/network/interfaces 47 # cp -a $SRC/sources.list $DEST/etc/apt/sources.list 48 # cp -a $SRC/update-grub.diff $DEST/root/update-grub.diff 49 # echo $HOSTNAME > $DEST/etc/hostname 50 # sed s/$SRCHOSTNAME/$HOSTNAME/g $SRC/hosts > $DEST/etc/hosts 80 51 81 rm /root/update-grub.diff 82 ENDCHROOT 52 # mount -t proc proc $DEST/proc 83 53 84 ## kill atd and rpc.statd that are using $DEST 85 umount $DEST/proc 86 umount $DEST 87 losetup -d $LODEV 54 # LANG=C chroot "$DEST" <<ENDCHROOT 55 56 # export TERM=xterm-color 57 # mount -a 58 59 # cd /media 60 # mkdir cdrom0 61 # ln -s cdrom0 cdrom 62 # cd / 63 # ln -s media/cdrom 64 65 # echo $'y\n3\nEastern' | tzconfig 66 # export DEBIAN_FRONTEND=noninteractive 67 68 # echo 'locales locales/locales_to_be_generated multiselect en_US ISO-8859-1' | debconf-set-selections 69 70 71 # aptitude update 72 # aptitude -y install locales linux-image-xen-amd64 73 # aptitude --without-recommends -y install ~pstandard ~prequired ~pimportant 74 # #strace tasksel install standard 2>&1 | less 75 # aptitude clean 76 77 # mkdir /boot/grub 78 # aptitude install grub 79 # patch /usr/sbin/update-grub </root/update-grub.diff 80 # update-grub 81 # patch /boot/grub/menu.lst </root/menu.lst.diff 82 # patch /etc/inittab </root/inittab.diff 83 84 # rm /root/update-grub.diff 85 # ENDCHROOT 86 87 # ## kill atd and rpc.statd that are using $DEST 88 # umount $DEST/proc 89 # umount $DEST 90 # losetup -d $LODEV
Note: See TracChangeset
for help on using the changeset viewer.