mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-17 13:51:32 +00:00
add a way to prevent a layer (and descendants) from being made into a sqashfs
for the live server build, i want to make a layer to install the kernel into but do not want the layer itself to be published. the implementation is a bit clunky but it works.
This commit is contained in:
parent
e4ca30e351
commit
fb8af1fd80
@ -1023,6 +1023,9 @@ echo "IMAGEFORMAT=\"$IMAGEFORMAT\"" >> config/chroot
|
|||||||
if [ -n "$PASSES" ]; then
|
if [ -n "$PASSES" ]; then
|
||||||
echo "PASSES=\"$PASSES\"" >> config/common
|
echo "PASSES=\"$PASSES\"" >> config/common
|
||||||
fi
|
fi
|
||||||
|
if [ -n "$NO_SQUASHFS_PASSES" ]; then
|
||||||
|
echo "NO_SQUASHFS_PASSES=\"$NO_SQUASHFS_PASSES\"" >> config/common
|
||||||
|
fi
|
||||||
if [ -n "$LIVE_PASSES" ]; then
|
if [ -n "$LIVE_PASSES" ]; then
|
||||||
echo "LIVE_PASSES=\"$LIVE_PASSES\"" >> config/common
|
echo "LIVE_PASSES=\"$LIVE_PASSES\"" >> config/common
|
||||||
fi
|
fi
|
||||||
|
@ -92,37 +92,54 @@ build_layered_squashfs () {
|
|||||||
rm -f chroot/boot/initrd.img-* chroot/boot/vmlinu{x,z}-*
|
rm -f chroot/boot/initrd.img-* chroot/boot/vmlinu{x,z}-*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Full manifest until that PASS
|
make_squashfs=yes
|
||||||
squashfs_f_manifest="${base}.manifest"
|
ppass="${pass}"
|
||||||
create_manifest "chroot" "${squashfs_f_manifest}.full"
|
while :; do
|
||||||
|
for nsp in ${NO_SQUASHFS_PASSES}; do
|
||||||
|
if [ "${ppass}" = "${nsp}" ]; then
|
||||||
|
make_squashfs=no
|
||||||
|
break 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
ppass="$(get_parent_pass "${ppass}")"
|
||||||
|
if [ -z "${ppass}" ]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Delta manifest
|
if [ $make_squashfs = yes ]; then
|
||||||
diff -NU0 ${PWD}/livecd.${PROJECT}.$(get_parent_pass $pass).manifest.full ${squashfs_f_manifest}.full|grep -v ^@ > $squashfs_f_manifest
|
# Full manifest until that PASS
|
||||||
|
squashfs_f_manifest="${base}.manifest"
|
||||||
|
create_manifest "chroot" "${squashfs_f_manifest}.full"
|
||||||
|
|
||||||
squashfs_f_size="${base}.size"
|
# Delta manifest
|
||||||
du -B 1 -s "overlay.${pass}/" | cut -f1 > "${squashfs_f_size}"
|
diff -NU0 ${PWD}/livecd.${PROJECT}.$(get_parent_pass $pass).manifest.full ${squashfs_f_manifest}.full|grep -v ^@ > $squashfs_f_manifest
|
||||||
|
|
||||||
# We take first live pass for "global" ISO properties (used by installers and checkers):
|
squashfs_f_size="${base}.size"
|
||||||
# Prepare initrd + kernel
|
du -B 1 -s "overlay.${pass}/" | cut -f1 > "${squashfs_f_size}"
|
||||||
# Main manifest and size files
|
|
||||||
prefix="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
|
|
||||||
if [ ! -e "${prefix}.manifest" ] && $(is_live_layer "$pass"); then
|
|
||||||
totalsize=$(cat ${squashfs_f_size})
|
|
||||||
curpass="$pass"
|
|
||||||
while :; do
|
|
||||||
curpass=$(get_parent_pass $curpass)
|
|
||||||
# We climbed up the tree to the root layer, we are done
|
|
||||||
[ -z "$curpass" ] && break
|
|
||||||
|
|
||||||
totalsize=$(expr $totalsize + $(cat "${PWD}/livecd.${PROJECT}.${curpass}.size"))
|
# We take first live pass for "global" ISO properties (used by installers and checkers):
|
||||||
done
|
# Prepare initrd + kernel
|
||||||
echo ${totalsize} > "${prefix}.size"
|
# Main manifest and size files
|
||||||
|
prefix="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
|
||||||
|
if [ ! -e "${prefix}.manifest" ] && $(is_live_layer "$pass"); then
|
||||||
|
totalsize=$(cat ${squashfs_f_size})
|
||||||
|
curpass="$pass"
|
||||||
|
while :; do
|
||||||
|
curpass=$(get_parent_pass $curpass)
|
||||||
|
# We climbed up the tree to the root layer, we are done
|
||||||
|
[ -z "$curpass" ] && break
|
||||||
|
|
||||||
cp "${squashfs_f_manifest}.full" "${prefix}.manifest"
|
totalsize=$(expr $totalsize + $(cat "${PWD}/livecd.${PROJECT}.${curpass}.size"))
|
||||||
|
done
|
||||||
|
echo ${totalsize} > "${prefix}.size"
|
||||||
|
|
||||||
|
cp "${squashfs_f_manifest}.full" "${prefix}.manifest"
|
||||||
|
fi
|
||||||
|
|
||||||
|
create_squashfs "overlay.${pass}/" ${squashfs_f}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
create_squashfs "overlay.${pass}" ${squashfs_f}
|
|
||||||
|
|
||||||
if [ -n "$lowerdirs" ]; then
|
if [ -n "$lowerdirs" ]; then
|
||||||
umount chroot
|
umount chroot
|
||||||
rmdir chroot
|
rmdir chroot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user