diff options
author | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-06-16 01:44:25 +0100 |
---|---|---|
committer | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-06-16 01:44:25 +0100 |
commit | db0cb1e0971201ff81a595247b24db874e5bc1fb (patch) | |
tree | 7149c2d3a948e5e13c244c36697b3bf4a9bb7257 | |
parent | Minimal configuration has to be larger, fixed a network setup error too (diff) | |
download | gentoaster-db0cb1e0971201ff81a595247b24db874e5bc1fb.tar.gz gentoaster-db0cb1e0971201ff81a595247b24db874e5bc1fb.tar.bz2 gentoaster-db0cb1e0971201ff81a595247b24db874e5bc1fb.zip |
Bugfixes and tidy up
-rw-r--r-- | configs/fluxbox.ini | 2 | ||||
-rwxr-xr-x | create_image.sh | 43 | ||||
-rwxr-xr-x | parse_config.sh | 1 |
3 files changed, 30 insertions, 16 deletions
diff --git a/configs/fluxbox.ini b/configs/fluxbox.ini index cdc2e1f..596d0c7 100644 --- a/configs/fluxbox.ini +++ b/configs/fluxbox.ini @@ -8,7 +8,7 @@ TIMEZONE='Europe/London' HOSTNAME='gentoo' ROOT_PASSWORD='g3nt00' DEFAULT_USERNAME='gentoo' -DEEFAULT_PASSWORD='g3nt00' +DEFAULT_PASSWORD='g3nt00' USE_FLAGS='-qt4 kde X dbus gtk gnome xorg udev truetype nls imlib' PACKAGE_USE='media-libs/imlib2 X' FEATURES='parallel-fetch userfetch userpriv getbinpkg' diff --git a/create_image.sh b/create_image.sh index 27d439b..1f58e83 100755 --- a/create_image.sh +++ b/create_image.sh @@ -18,10 +18,11 @@ IMAGE_WORK_PATH="/root/gentoo/${BUILD_ID}" LOG_FILE="${IMAGE_WORK_PATH}/log.txt" TOOL_RES_PATH=`pwd`/res -CPU_CORES=`grep -c processor /proc/cpuinfo` +NUM_JOBS=$(( `grep -c processor /proc/cpuinfo`+1 )) STAGE3_URL="http://distfiles.gentoo.org/releases/x86/current-stage3/stage3-i486-20110607.tar.bz2" PORTAGE_URL="http://distfiles.gentoo.org/snapshots/portage-latest.tar.bz2" BINHOST_URL="http://tinderbox.dev.gentoo.org/default-linux/x86" +EMERGE_PROXY="http://127.0.0.1:3128" echo "Creating build working directory" mkdir -p ${IMAGE_WORK_PATH} @@ -121,16 +122,21 @@ cp -L /etc/resolv.conf etc/resolv.conf echo "Setting up make.conf" mkdir -p usr/portage/packages -echo 'PORTAGE_BINHOST="${BINHOST_URL}"' >> etc/make.conf -echo 'PKGDIR="/usr/portage/packages"' >> etc/make.conf -echo 'FEATURES="${FEATURES}"' >> etc/make.conf -echo 'USE="${USE_FLAGS}"' >> etc/make.conf -if [[ ${OUTPUT_FORMAT} = "vbox" ]] -then +echo "PORTAGE_BINHOST=\"${BINHOST_URL}\"" >> etc/make.conf +echo "PKGDIR=\"/usr/portage/packages\"" >> etc/make.conf +echo "FEATURES=\"${FEATURES}\"" >> etc/make.conf +echo "USE=\"${USE_FLAGS}\"" >> etc/make.conf + +if [[ ${OUTPUT_FORMAT} = "vbox" ]]; then echo 'INPUT_DEVICES="virtualbox evdev"' >> etc/make.conf echo 'VIDEO_CARDS="virtualbox"' >> etc/make.conf fi +if [ -n $EMERGE_PROXY ]; then + echo "Enabling HTTP proxy" + echo "http_proxy=\"${EMERGE_PROXY}\"" >> etc/make.conf +fi + echo "Setting up package.use" mkdir -p etc/portage echo ${PACKAGE_USE} >> etc/portage/package.use @@ -156,7 +162,7 @@ cp ${TOOL_RES_PATH}/fstab etc/fstab &>> ${LOG_FILE} echo "Setting up networking" echo 'config_eth0=( "dhcp" )' > etc/conf.d/net cp etc/init.d/net.lo etc/init.d/net.eth0 -linux32 chroot . rc-update add net.eth0 default +linux32 chroot . rc-update add net.eth0 default &>> ${LOG_FILE} echo "Downloading/installing kernel sources" linux32 chroot . emerge gentoo-sources &>> ${LOG_FILE} @@ -165,7 +171,7 @@ echo "Copying kernel configuration" cp ${TOOL_RES_PATH}/kernelconfig usr/src/linux/.config echo "Building kernel" -linux32 chroot . make -C /usr/src/linux -j$(( ${CPU_CORES}+1 )) &>> ${LOG_FILE} +linux32 chroot . make -C /usr/src/linux -j${NUM_JOBS} &>> ${LOG_FILE} echo "Installing kernel" linux32 chroot . make -C /usr/src/linux modules_install &>> ${LOG_FILE} @@ -174,8 +180,11 @@ linux32 chroot . cp /usr/src/linux/arch/i386/boot/bzImage /boot/kernel &>> ${LOG echo "Setting root password" linux32 chroot . /bin/bash -c "echo 'root:${ROOT_PASSWORD}' | chpasswd" &>> ${LOG_FILE} -echo "Installing packages list" -linux32 chroot . emerge ${PACKAGES_LIST} &>> ${LOG_FILE} +echo "Processing packages list" +for PACKAGE in ${PACKAGES_LIST}; do + echo "Installing ${PACKAGE}" + linux32 chroot . emerge --jobs=${NUM_JOBS} ${PACKAGE} &>> ${LOG_FILE} +done echo "Adding default user" linux32 chroot . useradd -g users -G lp,wheel,audio,cdrom,portage -m ${DEFAULT_USERNAME} @@ -186,10 +195,14 @@ then echo "Installing VirtualBox additions/drivers" linux32 chroot . emerge xf86-video-virtualbox xf86-input-virtualbox virtualbox-guest-additions &>> ${LOG_FILE} linux32 chroot . rc-update add virtualbox-guest-additions default &>> ${LOG_FILE} - linux32 chroot . mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak &>> ${LOG_FILE} + mv etc/X11/xorg.conf etc/X11/xorg.conf.bak &>> ${LOG_FILE} linux32 chroot . usermod -a vboxguest ${DEFAULT_USERNAME} fi +if [ -n ${EMERGE_PROXY} ]; then + sed -i '/http_proxy/ d' etc/make.conf +fi + echo "Installing extlinux" extlinux --heads 255 --sectors 63 --install boot dd if=/usr/lib/extlinux/mbr.bin of=../${IMAGE_NAME} conv=notrunc @@ -200,19 +213,19 @@ cleanup_mounts case "${OUTPUT_FORMAT}" in "raw" ) echo "Already in raw format, not converting" - IMAGE_OUT="${IMAGE_NAME}.image" + IMAGE_OUT="${BUILD_ID}.image" ;; "vbox" ) echo "Converting image from RAW to VDI" qemu-img convert -O vdi ${IMAGE_NAME} ${BUILD_ID}.vdi rm -rf ${IMAGE_NAME} - IMAGE_OUT="${IMAGE_NAME}.vdi" + IMAGE_OUT="${BUILD_ID}.vdi" ;; "vmware" ) echo "Converting image from RAW to VMDK" qemu-img convert -O vmdk ${IMAGE_NAME} ${BUILD_ID}.vmdk rm -rf ${IMAGE_NAME} - IMAGE_OUT="${IMAGE_NAME}.vmdk" + IMAGE_OUT="${BUILD_ID}.vmdk" ;; esac mv ${IMAGE_OUT} ${IMAGES_OUTPUT_PATH}/${IMAGE_OUT} diff --git a/parse_config.sh b/parse_config.sh index 24aba14..090954a 100755 --- a/parse_config.sh +++ b/parse_config.sh @@ -23,6 +23,7 @@ cfg_parser () ini[0]="" # remove first element ini[${#ini[*]} + 1]='}' # add the last brace eval "$(echo "${ini[*]}")" # eval the result + IFS=" " } |