source: trunk/packages/sipb-xen-guest-installer/partial/debootstrap-commands @ 738

Last change on this file since 738 was 527, checked in by neboat, 16 years ago

More work on debootstrap-commands. Now can successfully create moo19 with execution.

File size: 2.6 KB
RevLine 
[527]1#!/bin/sh
[494]2#http://www.debian.org/releases/stable/i386/apds03.html.en
3
[527]4#SRC=/root/debootstrap.d
5#SRCHOSTNAME=moo17
[494]6#HOSTNAME=debootstrap-test
7#pick a hostname!
8
[527]9HOSTNAME=moo19
[495]10DIST=etch
[527]11IP=18.181.0.186
[495]12
[527]13PARTITIONS=/root/neboat/testpart
[494]14
[527]15VOLUME=/dev/mapper/xenvg-d_${HOSTNAME}_hda
[494]16
[495]17###
18###  Create the device for SIPB-Xen purposes
19###
[527]20sfdisk -H 255 -S 63 $VOLUME <$PARTITIONS
21kpartx -a $VOLUME
22#SWAPDEV=$(sipb-xen-losetup $VOLUME $(( 7903980 * 512 )))
23#IMAGEDEV=$(sipb-xen-losetup $VOLUME $(( 63 * 512 )))
[495]24# mkfs.ext3 -b 1024 $IMAGEDEV $(( 7903917 / 2 ))
[494]25
[527]26#CREATE_IMAGE_CONFIG=./paravm-create.conf
[494]27
[527]28#xen-create-image --image-dev $IMAGEDEV --swap-dev $SWAPDEV --fs ext3 --config $CREATE_IMAGE_CONFIG \
29#       --dist $DIST --hostname $HOSTNAME
[495]30
[527]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
[495]32
[527]33xen-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
[495]34
[527]35kpartx -d $VOLUME
36#losetup -d $SWAPDEV
37#losetup -d $IMAGEDEV
[495]38
[527]39### This should be the end of the script
40### The material past this point is solely for reference purposes
[494]41
42
[527]43# time debootstrap --arch amd64 etch "$DEST" http://debian.lcs.mit.edu/debian
[494]44
[527]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
[494]51
[527]52# mount -t proc proc $DEST/proc
[494]53
[527]54# LANG=C chroot "$DEST" <<ENDCHROOT
[494]55
[527]56# export TERM=xterm-color
57# mount -a
[494]58
[527]59# cd /media
60# mkdir cdrom0
61# ln -s cdrom0 cdrom
62# cd /
63# ln -s media/cdrom
[494]64
[527]65# echo $'y\n3\nEastern' | tzconfig
66# export DEBIAN_FRONTEND=noninteractive
[494]67
[527]68# echo 'locales locales/locales_to_be_generated multiselect     en_US ISO-8859-1' | debconf-set-selections
[494]69
70
[527]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
[494]76
[527]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 TracBrowser for help on using the repository browser.