]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
build_debian_image: fixes
authorSage Weil <sage.weil@dreamhost.com>
Mon, 7 Feb 2011 18:07:51 +0000 (10:07 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Mon, 7 Feb 2011 18:07:51 +0000 (10:07 -0800)
- /dev/pts
- copy console helper scripts
- run from any directory

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/script/build_debian_image.sh

index 154cea1fb882ff17c3ac3491b0e3d1e3bd830329..eef0508f92e06678cedc67a8c3bc2d33db3043a5 100755 (executable)
@@ -6,6 +6,8 @@ image="$1"
 root=/tmp/$$
 dist=squeeze
 
+srcdir=`dirname $0`
+
 # image
 [ -e $image ] && echo $image exists && exit 1
 dd if=/dev/zero of=$image bs=1M seek=1023 count=1
@@ -17,6 +19,7 @@ mount -o loop $image $root
 cleanup() {
        umount $root/proc || true
        umount $root/sys || true
+       umount $root/dev/pts || true
        umount $root
 }
 trap cleanup INT TERM EXIT
@@ -38,11 +41,16 @@ mkdir $root/host
 # set up chroot
 mount -t proc proc $root/proc
 mount -t sysfs sysfs $root/sys
+mount -t devpts devptr $root/dev/pts -o gid=5,mode=620
 
 # set up network
-cp network-from-cmdline $root/etc/init.d/network-from-cmdline
+cp $srcdir/network-from-cmdline $root/etc/init.d/network-from-cmdline
 chroot $root update-rc.d network-from-cmdline defaults 20
 
+# kcon_ helpers
+cp $srcdir/kcon_most.sh $root/root/most.sh
+cp $srcdir/kcon_all.sh $root/root/all.sh
+
 # fix up consoles
 cat <<EOF >> $root/etc/securetty 
 
@@ -69,9 +77,6 @@ cp ~/.ssh/authorized_keys $root/root/.ssh/authorized_keys
 chmod 600 $root/root/.ssh/authorized_keys
 
 # packages
-for p in ssh libcrypto++
-do
-       chroot $root apt-get -y --force-yes install $p
-done
+chroot $root apt-get -y --force-yes install ssh libcrypto++
 
 exit 0