mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-03-12 20:01:20 +00:00
merge ext2/3 image generation code from lp:~mcasadevall/livecd-rootfs/ext-image-generation
This commit is contained in:
commit
18d73cf6ff
32
BuildLiveCD
32
BuildLiveCD
@ -27,27 +27,19 @@ fi
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
SUBARCH=""
|
||||
SUBARCHARG=""
|
||||
DEFAULTSUITE="karmic"
|
||||
NEWSUITE=""
|
||||
NEWSUITE="maverick"
|
||||
SUITES=""
|
||||
PROPOSED=""
|
||||
if [ "$1" = '-s' ]; then
|
||||
shift
|
||||
SUBARCH="$1"
|
||||
SUBARCHARG="-s$SUBARCH"
|
||||
shift
|
||||
fi
|
||||
if [ "$1" = '-p' ]; then
|
||||
PROPOSED='-p'
|
||||
shift
|
||||
fi
|
||||
if [ "$1" = '-d' ]; then
|
||||
shift
|
||||
NEWSUITE="$1"
|
||||
shift
|
||||
else
|
||||
NEWSUITE="$DEFAULTSUITE"
|
||||
fi
|
||||
IMAGEFORMAT="squashfs"
|
||||
|
||||
while getopts :s:d:f:p name; do case $name in
|
||||
s) SUBARCH="$OPTARG";;
|
||||
d) NEWSUITE="$OPTARG";;
|
||||
f) IMAGEFORMAT="$OPTARG";;
|
||||
p) PROPOSED="-p";;
|
||||
esac; done;
|
||||
shift $((OPTIND-1))
|
||||
|
||||
for s in $NEWSUITE; do
|
||||
if [ -d build-${s}-live/chroot-${s} ]; then SUITES="$SUITES $s"; fi
|
||||
done
|
||||
@ -128,7 +120,7 @@ for STE in $SUITES; do
|
||||
rm -f ${PUBDIR}latest
|
||||
ln -sf ${PUBDIR}${NOW} ${PUBDIR}latest
|
||||
mkdir -p ${PUBDIR}${NOW}
|
||||
if $LINUX32 sudo chroot ${DIR%/./*} sh -c "cd /${DIR#*/./} && /usr/sbin/livecd.sh ${SUBARCHARG} ${PROPOSED} -d${STE} ${ARCHARG} $arg" > ${LOG} 2>&1; then
|
||||
if $LINUX32 sudo chroot ${DIR%/./*} sh -c "cd /${DIR#*/./} && /usr/sbin/livecd.sh ${SUBARCHARG} ${PROPOSED} -d${STE} -f${IMAGEFORMAT} ${ARCHARG} ${IMAGEARG} $arg" > ${LOG} 2>&1; then
|
||||
rm -f ${PUBDIR}current
|
||||
ln -sf ${NOW} ${PUBDIR}current
|
||||
|
||||
|
10
debian/changelog
vendored
10
debian/changelog
vendored
@ -1,3 +1,13 @@
|
||||
livecd-rootfs (1.116) UNRELEASED; urgency=low
|
||||
|
||||
* added new -f switch for changing image build type
|
||||
* added support for building ext2 and ext3 images in addition to squashfs
|
||||
* fixed spacing in the livefs build code
|
||||
* extended BuildLiveCD to handle the -f switch
|
||||
* reworked BuildLiveCD command line parsing to be more sane
|
||||
|
||||
-- Michael Casadevall <mcasadevall@ubuntu.com> Mon, 17 May 2010 13:59:28 -0400
|
||||
|
||||
livecd-rootfs (1.115) maverick; urgency=low
|
||||
|
||||
* use a tmpfs for the livefs root directory, to get some speed
|
||||
|
79
livecd.sh
79
livecd.sh
@ -21,7 +21,7 @@ set -eu
|
||||
# Boston, MA 02110-1301 USA. #
|
||||
##########################################################################
|
||||
|
||||
# Depends: debootstrap, rsync, python-minimal|python, procps, squashfs-tools, ltsp-server [i386]
|
||||
# Depends: debootstrap, rsync, python-minimal|python, procps, squashfs-tools, ltsp-server [i386], genext2fs
|
||||
|
||||
cleanup() {
|
||||
for mnt in ${ROOT}dev/pts ${ROOT}dev/shm ${ROOT}.dev ${ROOT}dev \
|
||||
@ -56,6 +56,37 @@ subst_package() {
|
||||
}
|
||||
|
||||
|
||||
livefs_squash()
|
||||
{
|
||||
squashsort="http://people.ubuntu.com/~tfheen/livesort/${FSS}.list.${TARGETARCH}"
|
||||
#if wget -O livecd.${FSS}.sort ${squashsort} > /dev/null 2>&1; then
|
||||
if false; then
|
||||
echo "Using the squashfs sort list from ${squashsort}."
|
||||
else
|
||||
echo "Unable to fetch squashfs sort list; using a blank list."
|
||||
: > livecd.${FSS}.sort
|
||||
fi
|
||||
|
||||
# make sure there is no old squashfs idling around
|
||||
rm -f livecd.${FSS}.squashfs
|
||||
|
||||
mksquashfs ${ROOT} livecd.${FSS}.squashfs -sort livecd.${FSS}.sort
|
||||
chmod 644 livecd.${FSS}.squashfs
|
||||
}
|
||||
|
||||
livefs_ext2()
|
||||
{
|
||||
# Add 10MiB extra free space for first boot + ext3 journal
|
||||
size=$(($(du -ks ${ROOT} | cut -f1) + (10240)))
|
||||
echo "Building ext2 filesystem."
|
||||
|
||||
# remove any stale filesystem images
|
||||
rm -f livecd.${FSS}.ext?
|
||||
|
||||
genext2fs -b $size -d ${ROOT} livecd.${FSS}.ext2
|
||||
chmod 644 livecd.${FSS}.ext2
|
||||
}
|
||||
|
||||
if [ $(id -u) != 0 ];then
|
||||
echo "must be run as root"
|
||||
exit 2
|
||||
@ -118,11 +149,12 @@ EXCLUDE=""
|
||||
LIST=""
|
||||
SUBARCH=""
|
||||
PROPOSED=""
|
||||
IMAGEFORMAT="squashfs"
|
||||
# must be in the "team / PPA name" form; e.g. "moblin/ppa"; the default PPA
|
||||
# name is "ppa", don't omit it
|
||||
PPA=""
|
||||
|
||||
while getopts :d:e:i:I:m:S:s:a:p name; do case $name in
|
||||
while getopts :d:e:i:I:m:S:s:a:f:p name; do case $name in
|
||||
d) STE=$OPTARG;;
|
||||
e) EXCLUDE="$EXCLUDE $OPTARG";;
|
||||
i) LIST="$LIST $OPTARG";;
|
||||
@ -131,6 +163,7 @@ while getopts :d:e:i:I:m:S:s:a:p name; do case $name in
|
||||
S) USZ="$OPTARG";;
|
||||
s) SUBARCH="$OPTARG";;
|
||||
a) ARCH="$OPTARG";;
|
||||
f) IMAGEFORMAT="$OPTARG";;
|
||||
p) PROPOSED="yes";;
|
||||
\?) echo bad usage >&2; exit 2;;
|
||||
\:) echo missing argument >&2; exit 2;;
|
||||
@ -624,35 +657,29 @@ Pin-Priority: 550
|
||||
perl -i -nle 'print unless /^Package: language-(pack|support)/ .. /^$/;' \
|
||||
${ROOT}/var/lib/apt/extended_states
|
||||
|
||||
# And run the cleanup function dead last, to umount /proc after nothing
|
||||
# else needs to be run in the chroot (umounting it earlier breaks rm):
|
||||
cleanup
|
||||
# And run the cleanup function dead last, to umount /proc after nothing
|
||||
# else needs to be run in the chroot (umounting it earlier breaks rm):
|
||||
cleanup
|
||||
|
||||
# Squashfs does not report unpacked disk space usage, which is explained at
|
||||
# <http://lkml.org/lkml/2006/6/16/163>. However, we would like to cache this
|
||||
# number for partman's sufficient free space check and ubiquity's
|
||||
# installation progress calculation.
|
||||
printf $(du -sx --block-size=1 ${ROOT} | cut -f1) > livecd.${FSS}.size || true
|
||||
# Squashfs does not report unpacked disk space usage, which is explained at
|
||||
# <http://lkml.org/lkml/2006/6/16/163>. However, we would like to cache this
|
||||
# number for partman's sufficient free space check and ubiquity's
|
||||
# installation progress calculation.
|
||||
printf $(du -sx --block-size=1 ${ROOT} | cut -f1) > livecd.${FSS}.size || true
|
||||
|
||||
livefs_squash()
|
||||
{
|
||||
squashsort="http://people.ubuntu.com/~tfheen/livesort/${FSS}.list.${TARGETARCH}"
|
||||
#if wget -O livecd.${FSS}.sort ${squashsort} > /dev/null 2>&1; then
|
||||
if false; then
|
||||
echo "Using the squashfs sort list from ${squashsort}."
|
||||
|
||||
# Build our images
|
||||
if [ "$IMAGEFORMAT" = "ext2" ] || [ "$IMAGEFORMAT" = "ext3" ]; then
|
||||
livefs_ext2
|
||||
else
|
||||
echo "Unable to fetch squashfs sort list; using a blank list."
|
||||
: > livecd.${FSS}.sort
|
||||
livefs_squash
|
||||
fi
|
||||
|
||||
# make sure there is no old squashfs idling around
|
||||
rm -f livecd.${FSS}.squashfs
|
||||
|
||||
mksquashfs ${ROOT} livecd.${FSS}.squashfs -sort livecd.${FSS}.sort
|
||||
chmod 644 livecd.${FSS}.squashfs
|
||||
}
|
||||
|
||||
livefs_squash
|
||||
# Upgrade ext2->ext3 if that's what is requested
|
||||
if [ "$IMAGEFORMAT" = "ext3" ]; then
|
||||
tune2fs -j livecd.${FSS}.ext2
|
||||
mv livecd.${FSS}.ext2 livecd.${FSS}.ext3
|
||||
fi
|
||||
|
||||
# LTSP chroot building (only in 32bit and for Edubuntu (DVD))
|
||||
case $FS in
|
||||
|
Loading…
x
Reference in New Issue
Block a user