From 5611951aefba515a994b1600ff4dd21e5a601cff Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Tue, 11 Oct 2011 19:39:34 -0500 Subject: [PATCH 1/6] Move utility scripts to tools/ --- build_nfs.sh => tools/build_nfs.sh | 0 build_pxe_boot.sh => tools/build_pxe_boot.sh | 2 +- build_pxe_ramdisk.sh => tools/build_ramdisk.sh | 1 + make_image.sh => tools/make_image.sh | 0 upload_image.sh => tools/upload_image.sh | 0 5 files changed, 2 insertions(+), 1 deletion(-) rename build_nfs.sh => tools/build_nfs.sh (100%) rename build_pxe_boot.sh => tools/build_pxe_boot.sh (97%) rename build_pxe_ramdisk.sh => tools/build_ramdisk.sh (98%) rename make_image.sh => tools/make_image.sh (100%) rename upload_image.sh => tools/upload_image.sh (100%) diff --git a/build_nfs.sh b/tools/build_nfs.sh similarity index 100% rename from build_nfs.sh rename to tools/build_nfs.sh diff --git a/build_pxe_boot.sh b/tools/build_pxe_boot.sh similarity index 97% rename from build_pxe_boot.sh rename to tools/build_pxe_boot.sh index 4feb14d..84aa43b 100755 --- a/build_pxe_boot.sh +++ b/tools/build_pxe_boot.sh @@ -56,7 +56,7 @@ fi cp -p $PXEDIR/vmlinuz-${KVER} $DEST_DIR/ubuntu if [ ! -r $PXEDIR/stack-initrd.gz ]; then cd $OPWD - sudo $PROGDIR/build_pxe_ramdisk.sh $PXEDIR/stack-initrd.gz + sudo $PROGDIR/build_ramdisk.sh $PXEDIR/stack-initrd.gz fi cp -p $PXEDIR/stack-initrd.gz $DEST_DIR/ubuntu cat >>$DEFAULT < Date: Tue, 11 Oct 2011 20:28:39 -0500 Subject: [PATCH 2/6] Cleanup PXE boot config --- tools/build_pxe_boot.sh | 46 ++++++----------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/tools/build_pxe_boot.sh b/tools/build_pxe_boot.sh index 84aa43b..0653664 100755 --- a/tools/build_pxe_boot.sh +++ b/tools/build_pxe_boot.sh @@ -4,15 +4,8 @@ # build_pxe_boot.sh [-k kernel-version] destdir # # Assumes syslinux is installed -# Assumes devstack files are in `pwd`/pxe # Only needs to run as root if the destdir permissions require it -UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64 - -MEMTEST_VER=4.10 -MEMTEST_BIN=memtest86+-${MEMTEST_VER}.bin -MEMTEST_URL=http://www.memtest.org/download/${MEMTEST_VER}/ - KVER=`uname -r` if [ "$1" = "-k" ]; then KVER=$2 @@ -30,8 +23,8 @@ for i in memdisk menu.c32 pxelinux.0; do cp -p /usr/lib/syslinux/$i $DEST_DIR done -DEFAULT=$DEST_DIR/pxelinux.cfg/default -cat >$DEFAULT <$CFG <>$DEFAULT <>$CFG <>$DEFAULT <>$CFG <>$DEFAULT <>$DEFAULT <>$DEFAULT <>$CFG < Date: Tue, 11 Oct 2011 20:32:07 -0500 Subject: [PATCH 3/6] Add build_usb_boot.sh --- tools/build_usb_boot.sh | 105 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 tools/build_usb_boot.sh diff --git a/tools/build_usb_boot.sh b/tools/build_usb_boot.sh new file mode 100755 index 0000000..b4205b7 --- /dev/null +++ b/tools/build_usb_boot.sh @@ -0,0 +1,105 @@ +#!/bin/bash -e +# build_usb_boot.sh - Create a syslinux boot environment +# +# build_usb_boot.sh [-k kernel-version] destdev +# +# Assumes syslinux is installed +# Assumes devstack files are in `pwd`/pxe +# Needs to run as root + +KVER=`uname -r` +if [ "$1" = "-k" ]; then + KVER=$2 + shift;shift +fi + +DEST_DIR=${1:-/tmp/syslinux-boot} +PXEDIR=${PXEDIR:-/var/cache/devstack/pxe} +OPWD=`pwd` +PROGDIR=`dirname $0` + +if [ -b $DEST_DIR ]; then + # We have a block device, install syslinux and mount it + DEST_DEV=$DEST_DIR + DEST_DIR=`mktemp -d mntXXXXXX` + + # Install syslinux on the device + syslinux --install --directory syslinux $DEST_DEV + + mount $DEST_DEV $DEST_DIR +else + # We have a directory (for sanity checking output) + DEST_DEV="" + if [ ! -d $DEST_DIR/syslinux ]; then + mkdir -p $DEST_DIR/syslinux + fi +fi + +# Get some more stuff from syslinux +for i in memdisk menu.c32; do + cp -p /usr/lib/syslinux/$i $DEST_DIR/syslinux +done + +CFG=$DEST_DIR/syslinux/syslinux.cfg +cat >$CFG <>$CFG <>$CFG <>$CFG < Date: Tue, 11 Oct 2011 20:34:07 -0500 Subject: [PATCH 4/6] Cleanups --- tools/build_usb_boot.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/build_usb_boot.sh b/tools/build_usb_boot.sh index b4205b7..ac49848 100755 --- a/tools/build_usb_boot.sh +++ b/tools/build_usb_boot.sh @@ -4,7 +4,6 @@ # build_usb_boot.sh [-k kernel-version] destdev # # Assumes syslinux is installed -# Assumes devstack files are in `pwd`/pxe # Needs to run as root KVER=`uname -r` @@ -95,7 +94,6 @@ cat >>$CFG < Date: Thu, 13 Oct 2011 18:45:42 +0100 Subject: [PATCH 5/6] Set sensible default for mysql client Using $HOME/.my.cnf to make easier for user to connect to mysql client. --- stack.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/stack.sh b/stack.sh index 38560e6..8c5b7ee 100755 --- a/stack.sh +++ b/stack.sh @@ -318,6 +318,16 @@ mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS mysql-server-5.1 mysql-server/start_on_boot boolean true MYSQL_PRESEED + if [[ ! -e $HOME/.my.cnf ]]; then + cat <$HOME/.my.cnf +[client] +user=$MYSQL_USER +password=$MYSQL_PASS +host=$MYSQL_HOST +EOF + chmod 0600 $HOME/.my.cnf + fi + # Install and start mysql-server sudo apt-get -y -q install mysql-server # Update the DB to give user ‘$MYSQL_USER’@’%’ full control of the all databases: From 2e536a3faf3d699ef255b74793b4591779738624 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Thu, 13 Oct 2011 11:40:16 -0700 Subject: [PATCH 6/6] add some docs --- stack.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stack.sh b/stack.sh index 8c5b7ee..0b34790 100755 --- a/stack.sh +++ b/stack.sh @@ -318,6 +318,9 @@ mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS mysql-server-5.1 mysql-server/start_on_boot boolean true MYSQL_PRESEED + # while ``.my.cnf`` is not needed for openstack to function, it is useful + # as it allows you to access the mysql databases via ``mysql nova`` instead + # of having to specify the username/password each time. if [[ ! -e $HOME/.my.cnf ]]; then cat <$HOME/.my.cnf [client]