From ba1ca3ca02d643b1abeec06a406f22d42a28743c Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Fri, 7 Jan 2005 22:41:29 +0000 Subject: [PATCH] --- debian/changelog | 6 ++++++ livecd.sh | 44 ++++++++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index bb15b44a..b2a1a0ca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (0.2) hoary; urgency=low + + * Better divertion setup, fix sources.list + + -- LaMont Jones Fri, 7 Jan 2005 13:00:37 -0700 + livecd-rootfs (0.1) hoary; urgency=low * Initial revision diff --git a/livecd.sh b/livecd.sh index a5aaa4e4..639ec98d 100755 --- a/livecd.sh +++ b/livecd.sh @@ -25,7 +25,13 @@ case $(hostname --fqdn) in *) MIRROR=http://archive.ubuntu.com/ubuntu;; esac -ROOT=$(pwd)/chroot-livecd/ +# How much space do we leave on the filesystem for the user? +USZ="400*1024" # 400MB for the user +# And how many inodes? Default currently gives them > 100000 +UINUM="" # blank (default), or number of inodes desired. +STE=hoary + +ROOT=$(pwd)/chroot-livecd/ # trailing / is CRITICAL IMG=livecd.fsimg MOUNTS="${ROOT}dev/pts ${ROOT}dev/shm ${ROOT}.dev ${ROOT}dev ${ROOT}proc" @@ -42,7 +48,7 @@ Flags: seen # need to defer udev until the apt-get, since debootstrap doesn't believe # in diversions -debootstrap --exclude=udev,ubuntu-base hoary $ROOT $MIRROR +debootstrap --exclude=udev,ubuntu-base $STE $ROOT $MIRROR # Just make a few things go away, which lets us skip a few other things. # sadly, udev's postinst does some actual work, so we can't just make it @@ -50,8 +56,9 @@ debootstrap --exclude=udev,ubuntu-base hoary $ROOT $MIRROR DIVERTS="usr/sbin/mkinitrd usr/sbin/invoke-rc.d etc/init.d/dbus-1 sbin/udevd" for file in $DIVERTS; do mkdir -p ${ROOT}${file%/*} + sudo chroot $ROOT dpkg-divert --add --local \ + --divert /${file}.livecd --rename /${file} cp /bin/true ${ROOT}$file - (echo /$file; echo /${file}.livecd; echo :) >> ${ROOT}var/lib/dpkg/diversions done # /bin/true won't cut it for mkinitrd, need to have -o support. @@ -98,22 +105,35 @@ case $(dpkg --print-architecture) in esac # Create a good sources.list, and finish the install -echo deb $MIRROR hoary main restricted > ${ROOT}etc/apt/sources.list +echo deb $MIRROR $STE main restricted > ${ROOT}etc/apt/sources.list chroot $ROOT apt-get update chroot $ROOT apt-get -y install ubuntu-base ubuntu-desktop $KERNEL ${ROOT}etc/apt/sources.list -echo deb http://archive.ubuntu.com/ubuntu hoary main restricted -echo deb-src http://archive.ubuntu.com/ubuntu hoary main restricted +deb http://archive.ubuntu.com/ubuntu $STE main restricted +deb-src http://archive.ubuntu.com/ubuntu $STE main restricted + +## Uncomment the following two lines to add software from the 'universe' +## repository. +## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu +## team, and may not be under a free licence. Please satisfy yourself as to +## your rights to use the software. Also, please note that software in +## universe WILL NOT receive any review or updates from the Ubuntu security +## team. +# deb http://archive.ubuntu.com/ubuntu $STE universe +# deb-src http://archive.ubuntu.com/ubuntu $STE universe + +# deb http://security.ubuntu.com/ubuntu ${STE}-security main restricted +# deb-src http://security.ubuntu.com/ubuntu ${STE}-security main restricted @@EOF mv ${ROOT}etc/apt/trusted.gpg.$$ ${ROOT}etc/apt/trusted.gpg @@ -122,8 +142,6 @@ chroot ${ROOT} apt-get clean rm ${ROOT}var/lib/apt/lists/*_* # Make the filesystem, with some room for meta data and such -USZ="400*1024" # 400MB for the user -UINUM="" # blank (default), or number of inodes desired. SZ=$(python -c "print int($(du -sk $ROOT|sed 's/[^0-9].*$//')*1.1+$USZ)") dd if=/dev/zero of=$IMG seek=$SZ bs=1024 count=1 if [-n "$UINUM" ]; then @@ -135,8 +153,6 @@ losetup $DEV $IMG mkdir -p livecd.mnt MOUNTS="$MOUNTS $(pwd)/livecd.mnt" mount $DEV livecd.mnt -rsync -a ${ROOT}/ livecd.mnt - -rm -rf ${ROOT} & +rsync -a ${ROOT} livecd.mnt create_compressed_fs $IMG 65536 > livecd.cloop