From 002b08478b665c77c1b1805220eb08ed72067169 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 1 Dec 2010 15:41:10 -0500 Subject: [PATCH] additional tune ups for VM images -- still hostname debian --- vm/d-i/squeeze/preseed.cfg | 5 +++-- vm/d-i/tools/initial_setup | 8 ++++++++ vm/tools/nd_createappliance | 19 ++++++++++++------- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/vm/d-i/squeeze/preseed.cfg b/vm/d-i/squeeze/preseed.cfg index d40af09..db13fc7 100644 --- a/vm/d-i/squeeze/preseed.cfg +++ b/vm/d-i/squeeze/preseed.cfg @@ -45,12 +45,13 @@ d-i netcfg/choose_interface select auto # values set here. However, setting the values still prevents the questions # from being shown, even if values come from dhcp. d-i netcfg/get_hostname string neurodebian +d-i netcfg/invalid_hostname string neurodebian # d-i netcfg/get_domain string unassigned-domain # Disable that annoying WEP key dialog. # d-i netcfg/wireless_wep string # The wacky dhcp hostname that some ISPs use as a password of sorts. -#d-i netcfg/dhcp_hostname string radish +# d-i netcfg/dhcp_hostname string neurodebian # If non-free firmware is needed for the network or other hardware, you can # configure the installer to always try to load it, without prompting. Or @@ -183,7 +184,7 @@ d-i passwd/user-uid string 1000 # The user account will be added to some standard initial groups. To # override that, use this. -d-i passwd/user-default-groups string audio cdrom video plugdev dip sudo +d-i passwd/user-default-groups string audio cdrom floppy video plugdev dip sudo ### Apt setup # You can choose to install non-free and contrib software. diff --git a/vm/d-i/tools/initial_setup b/vm/d-i/tools/initial_setup index 96fffcd..da4cb1b 100755 --- a/vm/d-i/tools/initial_setup +++ b/vm/d-i/tools/initial_setup @@ -15,6 +15,10 @@ set -u # hostname: neurodebian # domain: '' +# Needs to be assured since it got reset to debian +hostname neurodebian +sed -i -e 's/^127\.0\.1\.1.*/127.0.1.1\tneurodebian/g' /etc/hosts + # all file in one partition # root: not there @@ -95,3 +99,7 @@ sed -i -e "s/10.0.0.1:9999/$(dpkg --print-architecture)-geomirror.debian.net/" \ -e "s/^deb-src/#deb-src/" /etc/apt/sources.list etckeeper commit "Initial VM setup done" + +# Create a link to automatically mounted Shared folder +# Created by the Welcome Wizard +#sudo -u brain ln -s /mnt/host /home/brain/ diff --git a/vm/tools/nd_createappliance b/vm/tools/nd_createappliance index 10bec95..7905d68 100755 --- a/vm/tools/nd_createappliance +++ b/vm/tools/nd_createappliance @@ -6,7 +6,7 @@ set -eu # TODO: arguments later on to become cmdline args #iso=debian-squeeze-di-beta1-amd64-businesscard.iso -iso=debian-testing-i386-businesscard.iso +iso=debian-testing-${ARCH:=amd64}-businesscard.iso di_cd=$(readlink -f $PWD/../../../neurodebian-images/$iso) di_host=hydra # where to look for di preseed @@ -15,6 +15,8 @@ dist_dir=$PWD/dist vendor="NeuroDebian" vm_version="6.0.1" vm_ostype=Debian +vendor_url="http://neuro.debian.net" +product_url="${vendor_url}/vm.html" # Generic definitions eula="This virtual appliance contains Free and Open Source Software (FOSS) released under licenses compliant with the Debian Free Software Guidelines (DFSG, see http://www.debian.org/social_contract), such as, GPL, BSD, MIT, etc. Such software is free to be used or customized for any purpose. @@ -35,9 +37,11 @@ if file $di_cd | grep -q ' amd64 '; then vm_arch_name=" (64bit)" fi -vm_disk="$build_dir/nd-${vm_version}_${vm_arch}.vdi" -vm_name="${vendor} VirtualMachine${vm_arch_name}" -vm_ovf="${dist_dir}/${vendor}_${vm_version}_${vm_arch}.ovf" +vm_fprefix="${vendor}_${vm_version}_${vm_arch}" # common prefix for files +#vm_disk="$build_dir/nd-${vm_version}_${vm_arch}.vdi" +vm_disk="$build_dir/${vm_fprefix}.vdi" +vm_name="${vendor} ${vm_version} ${vm_arch_name}" +vm_ovf="${dist_dir}/${vm_fprefix}.ovf" product_name="${vendor} VirtualMachine (${vm_arch})" _info() { @@ -58,6 +62,7 @@ rm -f ${vm_disk} clean_buildvm # clean things up +#exit # Check that no previous VM was left (can happen if previous failures # were "valid") if VBoxManage list vms | grep -q "^\"${vm_name}\".*"; then @@ -70,7 +75,7 @@ mkdir -p $build_dir _info Create HardDisk for the VM VBoxManage createhd --filename $vm_disk \ - --size 20000 --format VDI + --size 20480 --format VDI # documented but not implemented: # --comment "Drive for NeuroDebian VM installer" @@ -154,8 +159,8 @@ _info Exporting the appliance VBoxManage export "${vm_name}" -o "$vm_ovf" \ --vsys 0 \ - --product "${vendor} VirtualMachine (${vm_arch})" \ - --producturl "http://neuro.debian.net/vm.html" \ + --product "${product_name}" \ + --producturl "${product_url}" \ --vendor "${vendor}" \ --vendorurl "http://neuro.debian.net" \ --version "$vm_version" \ -- 2.39.2