Calculate total size of the image + typos

sil2100/core18-pi3-arm64
Jean-Baptiste Lallement 6 years ago
parent 3db920c40c
commit f84d92d76f

@ -23,7 +23,7 @@ ALL_TRIPLETS="
lubuntu:: lubuntu::
mythbuntu:: mythbuntu::
ubuntu:: ubuntu::
ubuntu:ubiquity-ng: ubuntu:canary:
ubuntu-base:: ubuntu-base::
ubuntu-budgie:: ubuntu-budgie::
ubuntu-budgie-desktop:: ubuntu-budgie-desktop::

@ -186,46 +186,46 @@ remove_package ()
} }
add_packages_from_seed_regexp () { add_packages_from_seed_regexp () {
# Creates one or more passes, depending on base_pass_name, from any seeds matching seed_regexp. # Creates one or more passes, depending on base_pass_name, from any seeds matching seed_regexp.
# $1 base pass # $1 base pass
# $2 seeds (regexp) # $2 seeds (regexp)
local pass local pass
_check_immutable_passes_to_layers _check_immutable_passes_to_layers
_check_layers_only_API "add_packages_from_seed_regexp" _check_layers_only_API "add_packages_from_seed_regexp"
for seed in $(ls config/germinate-output/|grep -P "$2"); do for seed in $(ls config/germinate-output/|grep -P "$2"); do
pass=${1}.${seed} pass=${1}.${seed}
_register_pass "$pass" _register_pass "$pass"
list_packages_from_seed ${seed} >> config/package-lists/livecd-rootfs.list.chroot_$pass list_packages_from_seed ${seed} >> config/package-lists/livecd-rootfs.list.chroot_$pass
done done
} }
remove_packages_from_seed_regexp() { 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 # 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}. # pass then), resulting from base_seed - {current_seed_match_from_regexp}.
# $1 base pass # $1 base pass
# $2 base seed # $2 base seed
# $3 seeds to remove from base seed (regexp). If empty, a no-<base-seed> sublayer is generated. # $3 seeds to remove from base seed (regexp). If empty, a no-<base-seed> sublayer is generated.
local pass local pass
_check_immutable_passes_to_layers _check_immutable_passes_to_layers
_check_layers_only_API "remove_packages_from_seed_regexp" _check_layers_only_API "remove_packages_from_seed_regexp"
local seed_regexp="$3" local seed_regexp="$3"
if [ -z "${seed_regexp}" ]; then if [ -z "${seed_regexp}" ]; then
pass="${1}.no-${2}" pass="${1}.no-${2}"
_register_pass "$pass" _register_pass "$pass"
subtract_package_lists ${2} "" >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass subtract_package_lists ${2} "" >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
return return
fi fi
for seed in $(ls config/germinate-output/|grep -P "$seed_regexp"); do for seed in $(ls config/germinate-output/|grep -P "$seed_regexp"); do
pass="${1}.${seed}" pass="${1}.${seed}"
_register_pass "$pass" _register_pass "$pass"
subtract_package_lists ${2} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass subtract_package_lists ${2} ${seed} >> config/package-lists/livecd-rootfs.removal-list.chroot_$pass
done done
} }
add_chroot_hook () add_chroot_hook ()
@ -269,7 +269,7 @@ _get_live_passes ()
[ -z "$passes" ] && return [ -z "$passes" ] && return
for pass in $passes; do for pass in $passes; do
if echo $pass | grep -Eq '\.live*'; then if echo $pass | grep -Eq '\.live$'; then
livepasses="$pass $livepasses" livepasses="$pass $livepasses"
fi fi
done done

@ -724,10 +724,10 @@ get_parent_pass () {
} }
setenv_file () { setenv_file () {
# Exposes an environment variable in a chroot # Exposes an environment variable in a chroot
# $1 Name of the variable # $1 Name of the variable
# $2 Value of the variable # $2 Value of the variable
# $3 Path to the environment file of the chroot # $3 Path to the environment file of the chroot
local var="$1" local var="$1"
local val="$2" local val="$2"
local file="$3" local file="$3"

@ -96,7 +96,7 @@ build_layered_squashfs () {
squashfs_f_size="${base}.size" squashfs_f_size="${base}.size"
du -B 1 -s "overlay.${pass}/" | cut -f1 > "${squashfs_f_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 # Prepare initrd + kernel
# Main manifest and size files # Main manifest and size files
prefix="livecd.$PROJECT${SUBARCH:+-$SUBARCH}" prefix="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
@ -104,7 +104,18 @@ build_layered_squashfs () {
for livepass in $LIVE_PASSES; do for livepass in $LIVE_PASSES; do
[ "$livepass" != "$pass" ] && continue [ "$livepass" != "$pass" ] && continue
lb binary_linux-image ${*} 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" cp "${squashfs_f_manifest}.full" "${prefix}.manifest"
break break
done done

@ -8,7 +8,7 @@
## under certain conditions; see COPYING for details. ## under certain conditions; see COPYING for details.
## This is a fork of lb_chroot for layered live system. ## 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. ## we clean and setup the chroot each time.
## In addition, we create the squashfs for each layer, but top one (live) ## In addition, we create the squashfs for each layer, but top one (live)
## which still can be configured after lb chroot call. ## which still can be configured after lb chroot call.
@ -107,7 +107,7 @@ lb_chroot_includes () {
} }
reduce_pass_size () { 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 # Note the empty directories created in a child pass are not removed
local pass=$1 local pass=$1
local parent="$(get_parent_pass $pass)" local parent="$(get_parent_pass $pass)"
@ -118,7 +118,7 @@ reduce_pass_size () {
parent_pass_dir="overlay.${parent}" parent_pass_dir="overlay.${parent}"
local list_pass=$(mktemp) 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 $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) (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 ${*} lb chroot_apt install ${*}
# Note: this triggers an upgrade + dist-ugprade; which may impact sublayers with more # Note: this triggers an upgrade + dist-ugprade; which may impact sublayers with more
# diff content than desired. So only running this on root pass. # diff content than desired. So only running this on root pass.
# Also configure universe
# Only configure universe on root passes # Only configure universe on root passes
if $(is_root_layer $pass); then if $(is_root_layer $pass); then
lb chroot_archives chroot install ${*} lb chroot_archives chroot install ${*}

Loading…
Cancel
Save