Changeset 527


Ignore:
Timestamp:
May 12, 2008, 8:04:13 PM (16 years ago)
Author:
neboat
Message:

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

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
    12#http://www.debian.org/releases/stable/i386/apds03.html.en
    23
    3 SRC=/root/debootstrap.d
    4 SRCHOSTNAME=moo17
     4#SRC=/root/debootstrap.d
     5#SRCHOSTNAME=moo17
    56#HOSTNAME=debootstrap-test
    67#pick a hostname!
    78
     9HOSTNAME=moo19
    810DIST=etch
     11IP=18.181.0.186
    912
    10 PARTITIONS=/root/price/partitions/testpart
     13PARTITIONS=/root/neboat/testpart
    1114
    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/
     15VOLUME=/dev/mapper/xenvg-d_${HOSTNAME}_hda
    1616
    1717###
    1818###  Create the device for SIPB-Xen purposes
    1919###
    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 )))
     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 )))
    2524# mkfs.ext3 -b 1024 $IMAGEDEV $(( 7903917 / 2 ))
    2625
    27 # mkdir -p $DEST
    28 # mount $LODEV $DEST
     26#CREATE_IMAGE_CONFIG=./paravm-create.conf
    2927
    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
    3130
    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
    3432
    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 --cache
     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
    3634
    37 losetup -d $SWAPDEV
    38 losetup -d $IMAGEDEV
     35kpartx -d $VOLUME
     36#losetup -d $SWAPDEV
     37#losetup -d $IMAGEDEV
    3938
    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
    6641
    6742
    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
    7344
    74 mkdir /boot/grub
    75 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
    8051
    81 rm /root/update-grub.diff
    82 ENDCHROOT
     52# mount -t proc proc $DEST/proc
    8353
    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.