add support for kubuntu livecds

ubuntu/precise
LaMont Jones 20 years ago
parent 8b12cea1a7
commit 8e6007b171

@ -1,8 +1,8 @@
#!/bin/sh -eu #!/bin/bash -eu
################################################################# ######################################################################
#### (c) Copyright 2004 Canonical Ltd. All rights reserved. #### #### (c) Copyright 2004,2005 Canonical Ltd. All rights reserved. ####
################################################################# ######################################################################
# Depends: debootstrap, rsync, cloop-utils, python # Depends: debootstrap, rsync, cloop-utils, python
@ -30,6 +30,22 @@ case $(hostname --fqdn) in
*) MIRROR=http://archive.ubuntu.com/ubuntu;; *) MIRROR=http://archive.ubuntu.com/ubuntu;;
esac esac
while getopts :m: name; do case $name in
m) MIRROR="$OPTARG";;
\?) echo bad usage >&2; exit 2;;
\:) echo missing argument >&2; exit 2;;
esac; done;
shift $((OPTIND-1))
(( $# == 0 )) && set -- ubuntu || true
[ "X$1" = "Xall" ] && set -- ubuntu kubuntu || true
for arg in "$@"; do case "$arg" in
ubuntu|kubuntu) ;;
*) echo bad name >&2; exit 2;;
esac; done
for FS in "$@"; do
# How much space do we leave on the filesystem for the user? # How much space do we leave on the filesystem for the user?
USZ="400*1024" # 400MB for the user USZ="400*1024" # 400MB for the user
# And how many inodes? Default currently gives them > 100000 # And how many inodes? Default currently gives them > 100000
@ -52,6 +68,16 @@ Owners: debconf
Flags: seen Flags: seen
@@EOF @@EOF
case "$FS" in
ubuntu)
LIST="ubuntu-base ubuntu-desktop ubuntu-live"
;;
kubuntu)
LIST="ubuntu-base kubuntu-desktop ubuntu-live"
;;
esac
LIST="$LIST xresprobe laptop-detect"
# need to defer udev until the apt-get, since debootstrap doesn't believe # need to defer udev until the apt-get, since debootstrap doesn't believe
# in diversions # in diversions
debootstrap --exclude=udev,ubuntu-base $STE $ROOT $MIRROR debootstrap --exclude=udev,ubuntu-base $STE $ROOT $MIRROR
@ -102,7 +128,6 @@ mount -tproc none ${ROOT}proc
cp ${ROOT}etc/apt/trusted.gpg ${ROOT}etc/apt/trusted.gpg.$$ cp ${ROOT}etc/apt/trusted.gpg ${ROOT}etc/apt/trusted.gpg.$$
cat /etc/apt/trusted.gpg >> ${ROOT}etc/apt/trusted.gpg cat /etc/apt/trusted.gpg >> ${ROOT}etc/apt/trusted.gpg
LIST="ubuntu-base ubuntu-desktop ubuntu-live xresprobe laptop-detect"
case $(dpkg --print-architecture) in case $(dpkg --print-architecture) in
amd64) LIST="$LIST linux-amd64-generic";; amd64) LIST="$LIST linux-amd64-generic";;
i386) LIST="$LIST linux-386";; i386) LIST="$LIST linux-386";;
@ -157,6 +182,7 @@ rm -f ${ROOT}var/lib/apt/lists/*_*
rm -f ${ROOT}var/spool/postfix/maildrop/* rm -f ${ROOT}var/spool/postfix/maildrop/*
chroot $ROOT apt-get update || true # give them fresh lists, but don't fail chroot $ROOT apt-get update || true # give them fresh lists, but don't fail
rm ${ROOT}etc/resolv.conf rm ${ROOT}etc/resolv.conf
chroot ${ROOT} dpkg-query -W --showformat='${Package} ${Version}\n' > livecd.manifest
mkdir -p livecd.mnt mkdir -p livecd.mnt
MOUNTS="$MOUNTS $(pwd)/livecd.mnt" MOUNTS="$MOUNTS $(pwd)/livecd.mnt"
@ -170,7 +196,7 @@ SZ=2047 # XXX fix size for now
for fsbs in 1024:65536; do for fsbs in 1024:65536; do
FSBLOCK=${fsbs%:*} FSBLOCK=${fsbs%:*}
COMP=${fsbs#*:} COMP=${fsbs#*:}
IMGNAME=${IMG}-${FSBLOCK} IMGNAME=${IMG}-${FS}-${FSBLOCK}
if [ ! -f ${IMGNAME} ]; then if [ ! -f ${IMGNAME} ]; then
if [ -f old-${IMGNAME} ]; then if [ -f old-${IMGNAME} ]; then
cp old-${IMGNAME} new-${IMGNAME} cp old-${IMGNAME} new-${IMGNAME}
@ -193,7 +219,7 @@ for fsbs in 1024:65536; do
mv new-${IMGNAME} ${IMGNAME} mv new-${IMGNAME} ${IMGNAME}
cp ${IMGNAME} old-${IMGNAME} cp ${IMGNAME} old-${IMGNAME}
fi fi
create_compressed_fs $IMGNAME $COMP > livecd.cloop-${fsbs} create_compressed_fs $IMGNAME $COMP > livecd.cloop-${FS}-${fsbs}
done done
chroot ${ROOT} dpkg-query -W --showformat='${Package} ${Version}\n' > livecd.manifest done

Loading…
Cancel
Save