From 32d0e916d35088b666707409afe5eeee9b18a59d Mon Sep 17 00:00:00 2001 From: Emmet Hikory Date: Tue, 9 Feb 2010 11:34:20 +0900 Subject: [PATCH] mk-sbuild: conditionally install lvm2 only for lv-snapshot schroots --- debian/changelog | 3 ++- mk-sbuild | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2c8d468..1f79ad6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ ubuntu-dev-tools (0.93) UNRELEASED; urgency=low [ Emmet Hikory ] * Support qemu-arm-static -> qemu-kvm-extras-static transition + * mk-sbuild: conditionally install lvm2 only for lv-snapshot schroots [ Loïc Minier ] * Demote qemu-kvm-extras-static to a Suggests since most people don't build @@ -14,7 +15,7 @@ ubuntu-dev-tools (0.93) UNRELEASED; urgency=low * requestsync: add -C to allow manually adding changelog when missing (LP: #518574). - -- Kees Cook Mon, 08 Feb 2010 10:12:23 -0800 + -- Emmet Hikory Tue, 09 Feb 2010 11:32:02 +0900 ubuntu-dev-tools (0.92) lucid; urgency=low diff --git a/mk-sbuild b/mk-sbuild index e646540..2bd6b18 100755 --- a/mk-sbuild +++ b/mk-sbuild @@ -1,4 +1,4 @@ -#!/bin/bash +# !/bin/bash # # Copyright 2006-2009 (C) Canonical Ltd. # Author: Kees Cook @@ -36,10 +36,10 @@ if [ -w /etc/passwd ]; then exit 1 fi -# Perform once-only things to initially set up for using sbuild+schroot+lvm +# Perform once-only things to initially set up for using sbuild+schroot if [ ! -w /var/lib/sbuild ]; then # Load all the packages you'll need to do work - sudo apt-get install sbuild schroot debootstrap lvm2 + sudo apt-get install sbuild schroot debootstrap # Add self to the sbuild group sudo adduser "$USER" sbuild @@ -340,6 +340,9 @@ fi case "$SRC_TYPE" in "lvm") + # Install lvm2 if missing + dpkg -l lvm2 > /dev/null || sudo apt-get install lvm2 + # Allocate the "golden" chroot LV sudo lvcreate -n "$CHROOT_LV" -L "$LV_SIZE" "$VG" sudo mkfs -t ext4 "$CHROOT_PATH"