mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-23 03:11:12 +00:00
Calculate total size of the image + typos
This commit is contained in:
parent
3db920c40c
commit
f84d92d76f
2
debian/tests/default-bootstraps
vendored
2
debian/tests/default-bootstraps
vendored
@ -23,7 +23,7 @@ ALL_TRIPLETS="
|
||||
lubuntu::
|
||||
mythbuntu::
|
||||
ubuntu::
|
||||
ubuntu:ubiquity-ng:
|
||||
ubuntu:canary:
|
||||
ubuntu-base::
|
||||
ubuntu-budgie::
|
||||
ubuntu-budgie-desktop::
|
||||
|
@ -186,46 +186,46 @@ remove_package ()
|
||||
}
|
||||
|
||||
add_packages_from_seed_regexp () {
|
||||
# Creates one or more passes, depending on base_pass_name, from any seeds matching seed_regexp.
|
||||
# $1 base pass
|
||||
# $2 seeds (regexp)
|
||||
# Creates one or more passes, depending on base_pass_name, from any seeds matching seed_regexp.
|
||||
# $1 base pass
|
||||
# $2 seeds (regexp)
|
||||
local pass
|
||||
|
||||
_check_immutable_passes_to_layers
|
||||
_check_layers_only_API "add_packages_from_seed_regexp"
|
||||
|
||||
for seed in $(ls config/germinate-output/|grep -P "$2"); do
|
||||
pass=${1}.${seed}
|
||||
_register_pass "$pass"
|
||||
list_packages_from_seed ${seed} >> config/package-lists/livecd-rootfs.list.chroot_$pass
|
||||
done
|
||||
for seed in $(ls config/germinate-output/|grep -P "$2"); do
|
||||
pass=${1}.${seed}
|
||||
_register_pass "$pass"
|
||||
list_packages_from_seed ${seed} >> config/package-lists/livecd-rootfs.list.chroot_$pass
|
||||
done
|
||||
}
|
||||
|
||||
remove_packages_from_seed_regexp() {
|
||||
# Creates one or more passes, based on base_pass_name, from any seed matching seed_regexp.
|
||||
# Creates one or more passes, based on base_pass_name, from any seed matching seed_regexp.
|
||||
# This package list is a list of packages to remove (and included in a previous dependent
|
||||
# pass then), resulting from base_seed - {current_seed_match_from_regexp}.
|
||||
# $1 base pass
|
||||
# $2 base seed
|
||||
# $3 seeds to remove from base seed (regexp). If empty, a no-<base-seed> sublayer is generated.
|
||||
# $1 base pass
|
||||
# $2 base seed
|
||||
# $3 seeds to remove from base seed (regexp). If empty, a no-<base-seed> sublayer is generated.
|
||||
local pass
|
||||
|
||||
_check_immutable_passes_to_layers
|
||||
_check_layers_only_API "remove_packages_from_seed_regexp"
|
||||
|
||||
local seed_regexp="$3"
|
||||
if [ -z "${seed_regexp}" ]; then
|
||||
local seed_regexp="$3"
|
||||
if [ -z "${seed_regexp}" ]; then
|
||||
pass="${1}.no-${2}"
|
||||
_register_pass "$pass"
|
||||
subtract_package_lists ${2} "" >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
||||
return
|
||||
fi
|
||||
subtract_package_lists ${2} "" >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
||||
return
|
||||
fi
|
||||
|
||||
for seed in $(ls config/germinate-output/|grep -P "$seed_regexp"); do
|
||||
pass="${1}.${seed}"
|
||||
for seed in $(ls config/germinate-output/|grep -P "$seed_regexp"); do
|
||||
pass="${1}.${seed}"
|
||||
_register_pass "$pass"
|
||||
subtract_package_lists ${2} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
||||
done
|
||||
subtract_package_lists ${2} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
|
||||
done
|
||||
}
|
||||
|
||||
add_chroot_hook ()
|
||||
@ -269,7 +269,7 @@ _get_live_passes ()
|
||||
[ -z "$passes" ] && return
|
||||
|
||||
for pass in $passes; do
|
||||
if echo $pass | grep -Eq '\.live*'; then
|
||||
if echo $pass | grep -Eq '\.live$'; then
|
||||
livepasses="$pass $livepasses"
|
||||
fi
|
||||
done
|
||||
|
@ -724,10 +724,10 @@ get_parent_pass () {
|
||||
}
|
||||
|
||||
setenv_file () {
|
||||
# Exposes an environment variable in a chroot
|
||||
# $1 Name of the variable
|
||||
# $2 Value of the variable
|
||||
# $3 Path to the environment file of the chroot
|
||||
# Exposes an environment variable in a chroot
|
||||
# $1 Name of the variable
|
||||
# $2 Value of the variable
|
||||
# $3 Path to the environment file of the chroot
|
||||
local var="$1"
|
||||
local val="$2"
|
||||
local file="$3"
|
||||
|
@ -96,7 +96,7 @@ build_layered_squashfs () {
|
||||
squashfs_f_size="${base}.size"
|
||||
du -B 1 -s "overlay.${pass}/" | cut -f1 > "${squashfs_f_size}"
|
||||
|
||||
# We take first live path for "global" ISO properties (used by installers and checkers):
|
||||
# We take first live pass for "global" ISO properties (used by installers and checkers):
|
||||
# Prepare initrd + kernel
|
||||
# Main manifest and size files
|
||||
prefix="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
|
||||
@ -104,7 +104,18 @@ build_layered_squashfs () {
|
||||
for livepass in $LIVE_PASSES; do
|
||||
[ "$livepass" != "$pass" ] && continue
|
||||
lb binary_linux-image ${*}
|
||||
cp ${squashfs_f_size} "${prefix}.size"
|
||||
|
||||
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"))
|
||||
done
|
||||
echo ${totalsize} > "${prefix}.size"
|
||||
|
||||
cp "${squashfs_f_manifest}.full" "${prefix}.manifest"
|
||||
break
|
||||
done
|
||||
|
@ -8,7 +8,7 @@
|
||||
## under certain conditions; see COPYING for details.
|
||||
|
||||
## This is a fork of lb_chroot for layered live system.
|
||||
## We don't want leaking host configuratino in each layer, and so,
|
||||
## We don't want leaking host configuration in each layer, and so,
|
||||
## we clean and setup the chroot each time.
|
||||
## In addition, we create the squashfs for each layer, but top one (live)
|
||||
## which still can be configured after lb chroot call.
|
||||
@ -107,7 +107,7 @@ lb_chroot_includes () {
|
||||
}
|
||||
|
||||
reduce_pass_size () {
|
||||
# Remove duplicated files between parent and currant pass
|
||||
# Remove duplicated files between parent and current pass
|
||||
# Note the empty directories created in a child pass are not removed
|
||||
local pass=$1
|
||||
local parent="$(get_parent_pass $pass)"
|
||||
@ -118,7 +118,7 @@ reduce_pass_size () {
|
||||
parent_pass_dir="overlay.${parent}"
|
||||
|
||||
local list_pass=$(mktemp)
|
||||
local list_parent=$(mktemp)
|
||||
local list_parent=$(mktemp)
|
||||
|
||||
(cd $pass_dir && find . ! -type d -printf "%h/%f|%s|%y|%U|%G|%m\n"|sort > $list_pass)
|
||||
(cd $parent_pass_dir && find . ! -type d -printf "%h/%f|%s|%y|%U|%G|%m\n"|sort > $list_parent)
|
||||
@ -188,7 +188,6 @@ create_chroot_pass () {
|
||||
lb chroot_apt install ${*}
|
||||
# Note: this triggers an upgrade + dist-ugprade; which may impact sublayers with more
|
||||
# diff content than desired. So only running this on root pass.
|
||||
# Also configure universe
|
||||
# Only configure universe on root passes
|
||||
if $(is_root_layer $pass); then
|
||||
lb chroot_archives chroot install ${*}
|
||||
|
Loading…
x
Reference in New Issue
Block a user