From 9f427b60af348bb7e9f5789275fd03529eb8a0e0 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Wed, 2 Sep 2015 23:47:19 +0100 Subject: Port the task-based scripts from tests with debian-cd --- common/customise.lib | 23 ++++++++++++++++++++++- common/jessie-amd64-hook.sh | 30 ++++++++++++++++++++++++++++++ common/jessie-amd64.sh | 30 ++++++++++++++++++++++++++++++ common/jessie-arm64-hook.sh | 29 +++++++++++++++++++++++++++++ common/jessie-arm64.sh | 33 +++++++++++++++++++++++++++++++++ 5 files changed, 144 insertions(+), 1 deletion(-) create mode 100755 common/jessie-amd64-hook.sh create mode 100755 common/jessie-amd64.sh create mode 100755 common/jessie-arm64-hook.sh create mode 100755 common/jessie-arm64.sh (limited to 'common') diff --git a/common/customise.lib b/common/customise.lib index d36d78a..a62c64a 100644 --- a/common/customise.lib +++ b/common/customise.lib @@ -13,6 +13,22 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +BASE_OPTS=" + --owner ${WHO} --verbose \ + --sudo \ + --lock-root-password \ + --enable-dhcp \ + --configure-apt \ + --log debian-cd-${SUITE}-${ARCH}.log --log-level debug \ +" + +TASK_PACKAGES="task-laptop task-english" + +# packages which are not (yet) part of a task +EXTRA_PACKAGES="dkms locales whois telnet aptitude lsof host \ + bash-completion firmware-linux-free dnsutils time rsync reportbug w3m \ + ethtool ftp host lsof debian-faq debian-installer-launcher doc-debian \ +" cleanup() { umount ${rootdir}/proc umount ${rootdir}/sys @@ -38,10 +54,11 @@ EOF chmod a+x ${rootdir}/usr/sbin/policy-rc.d } +# FIXME: pass the replacement mirror prepare_apt_source() { # handle the apt source mv ${rootdir}/etc/apt/sources.list.d/base.list ${rootdir}/etc/apt/ - echo "deb http://cdbuilder.debian.org/debian/ jessie main contrib non-free" > ${rootdir}/etc/apt/sources.list + echo "deb http://mirror/debian/ ${SUITE} main contrib non-free" > ${rootdir}/etc/apt/sources.list chroot ${rootdir} apt update } @@ -54,3 +71,7 @@ replace_apt_source() { rm ${rootdir}/etc/apt/sources.list mv ${rootdir}/etc/apt/base.list ${rootdir}/etc/apt/sources.list.d/ } + +blacklist_qemu_bochs() { + echo "blacklist bochs-drm" > ${rootdir}/etc/modprobe.d/qemu-blacklist.conf +} diff --git a/common/jessie-amd64-hook.sh b/common/jessie-amd64-hook.sh new file mode 100755 index 0000000..c6a99fd --- /dev/null +++ b/common/jessie-amd64-hook.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +rootdir=$1 + +# common needs rootdir to already be defined. +. /usr/share/vmdebootstrap/common/customise.lib + +trap cleanup 0 + +mount_support +disable_daemons +# prepare_apt_source + +chroot ${rootdir} apt-get -q -y install ${TASK_PACKAGES} ${EXTRA_PACKAGES} \ + task-xfce-desktop exim4 mutt info rpcbind pciutils \ + task-ssh-server task-print-server plymouth procmail \ + m4 open-vm-tools apt-listchanges at busybox nfs-common \ + wamerican texinfo plymouth-themes plymouth-x11 uuid-runtime \ + open-vm-tools-dkms open-vm-tools-desktop gettext-base mlocate \ + irqbalance memtest86+ user-setup zerofree + +remove_daemon_block +# replace_apt_source + +# particular to efi builds +blacklist_qemu_bochs + +echo "Customisation complete" diff --git a/common/jessie-amd64.sh b/common/jessie-amd64.sh new file mode 100755 index 0000000..6f0971e --- /dev/null +++ b/common/jessie-amd64.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +# define before sourcing common +WHO=`whoami` +USER='user/live' +SUITE='jessie' +SIZE='5G' +ARCH='amd64' +SHARE_PATH='/usr/share/vmdebootstrap/common' +# needs a path for arch and task desktop +IMAGE_PATH='.' + +. ${SHARE_PATH}/customise.lib + +sudo vmdebootstrap \ + ${BASE_OPTS} --user ${USER} \ + --size ${SIZE} \ + --arch ${ARCH} \ + --no-extlinux \ + --grub --use-uefi \ + --distribution ${SUITE} \ + --customize "${SHARE_PATH}/${SUITE}-${ARCH}-hook.sh" \ + --image ${IMAGE_PATH}/${SUITE}.img \ + "$@" + +# report results and check we have something valid. +ls -l ${IMAGE_PATH}/${SUITE}.img +md5sum ${IMAGE_PATH}/${SUITE}.img diff --git a/common/jessie-arm64-hook.sh b/common/jessie-arm64-hook.sh new file mode 100755 index 0000000..c986759 --- /dev/null +++ b/common/jessie-arm64-hook.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -e + +rootdir=$1 + +# common needs rootdir to already be defined. +. /usr/share/vmdebootstrap/common/customise.lib + +trap cleanup 0 + +mount_support +disable_daemons +prepare_apt_source + +chroot ${rootdir} apt-get -q -y install ${TASK_PACKAGES} ${EXTRA_PACKAGES} \ + task-xfce-desktop exim4 mutt info rpcbind pciutils \ + task-ssh-server task-print-server plymouth procmail \ + m4 apt-listchanges at busybox nfs-common \ + wamerican texinfo plymouth-themes plymouth-x11 uuid-runtime \ + gettext-base mlocate irqbalance \ + irqbalance user-setup zerofree + +remove_daemon_block +replace_apt_source +# particular to efi builds +blacklist_qemu_bochs + +echo "Customisation complete" diff --git a/common/jessie-arm64.sh b/common/jessie-arm64.sh new file mode 100755 index 0000000..4ac9f8d --- /dev/null +++ b/common/jessie-arm64.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +# define before sourcing common +WHO=`whoami` +USER='user/live' +SUITE='jessie' +SIZE='5G' +ARCH='arm64' +BINFMT='/usr/bin/qemu-aarch64-static' +SHARE_PATH='/usr/share/vmdebootstrap/common' +# needs a path for arch and task desktop +IMAGE_PATH='.' + +. ${SHARE_PATH}/customise.lib + +sudo vmdebootstrap \ + ${BASE_OPTS} --user ${USER} \ + --size ${SIZE} \ + --arch ${ARCH} \ + --foreign ${BINFMT} \ + --no-extlinux \ + --grub --use-uefi \ + --package dosfstools \ + --distribution ${SUITE} \ + --customize "${SHARE_PATH}/${SUITE}-${ARCH}-hook.sh" \ + --image ${IMAGE_PATH}/${SUITE}-${ARCH}.img \ + "$@" + +# report results and check we have something valid. +ls -l ${IMAGE_PATH}/${SUITE}-${ARCH}.img +md5sum ${IMAGE_PATH}/${SUITE}-${ARCH}.img -- cgit v1.2.1