From 46bae4cebfbc29a1310603875206c5cbc2e03430 Mon Sep 17 00:00:00 2001 From: Mathieu Trudel-Lapierre Date: Tue, 11 Apr 2017 17:16:35 -0400 Subject: [PATCH] Fix up functions refactoring tfor a proper path to the file. --- live-build/auto/config | 3 +++ live-build/{auto => }/functions | 11 +++++++++++ live-build/ubuntu-cpc/hooks/032-disk-image.binary | 2 +- live-build/ubuntu-cpc/hooks/032-root-squashfs.binary | 2 +- .../ubuntu-cpc/hooks/033-disk-image-uefi.binary | 2 +- .../ubuntu-cpc/hooks/034-disk-image-ppc64el.binary | 2 +- live-build/ubuntu-cpc/hooks/040-qcow2-image.binary | 2 +- live-build/ubuntu-cpc/hooks/040-vmdk-image.binary | 2 +- live-build/ubuntu-cpc/hooks/042-vagrant.binary | 2 +- live-build/ubuntu-cpc/hooks/999-extras.binary | 2 +- .../ubuntu-server/hooks/030-root-squashfs.binary | 2 +- .../ubuntu-server/hooks/032-installer-squashfs.binary | 2 +- 12 files changed, 24 insertions(+), 10 deletions(-) rename live-build/{auto => }/functions (97%) diff --git a/live-build/auto/config b/live-build/auto/config index 1521dbe7..f5835313 100755 --- a/live-build/auto/config +++ b/live-build/auto/config @@ -33,6 +33,9 @@ if [ -z "$MIRROR" ]; then esac fi +mkdir -p config +cp -af /usr/share/livecd-rootfs/live-build/functions config/functions + mkdir -p config/package-lists add_task () diff --git a/live-build/auto/functions b/live-build/functions similarity index 97% rename from live-build/auto/functions rename to live-build/functions index af555998..6e4668eb 100644 --- a/live-build/auto/functions +++ b/live-build/functions @@ -87,6 +87,17 @@ mount_partition() { setup_mountpoint "$mountpoint" } +mount_overlay() { + lower="$1" + upper="$2" + work="$2/../work" + path="$3" + + mkdir -p "$work" + mount -t overlay overlay \ + -olowerdir="$lower",upperdir="$upper",workdir="$work" \ + "$path" +} mount_disk_image() { local disk_image=${1} diff --git a/live-build/ubuntu-cpc/hooks/032-disk-image.binary b/live-build/ubuntu-cpc/hooks/032-disk-image.binary index 54df55a1..929c84d0 100755 --- a/live-build/ubuntu-cpc/hooks/032-disk-image.binary +++ b/live-build/ubuntu-cpc/hooks/032-disk-image.binary @@ -3,7 +3,7 @@ IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" FS_LABEL="cloudimg-rootfs" -. auto/functions +. config/functions BOOTPART_START= BOOTPART_END= diff --git a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary index f129384c..0a1d51ce 100755 --- a/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary +++ b/live-build/ubuntu-cpc/hooks/032-root-squashfs.binary @@ -17,7 +17,7 @@ if [ -n "$SUBARCH" ]; then exit 0 fi -. auto/functions +. config/functions mkdir binary/boot/squashfs.dir cp -a chroot/* binary/boot/squashfs.dir diff --git a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary index e1ea4f9b..d7885346 100755 --- a/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary +++ b/live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary @@ -12,7 +12,7 @@ esac IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" FS_LABEL="cloudimg-rootfs" -. auto/functions +. config/functions apt-get -qqy install dosfstools gdisk diff --git a/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary b/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary index a0281ee2..55e1dc84 100755 --- a/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary +++ b/live-build/ubuntu-cpc/hooks/034-disk-image-ppc64el.binary @@ -10,7 +10,7 @@ esac IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process" FS_LABEL="cloudimg-rootfs" -. auto/functions +. config/functions create_partitions() { disk_image="$1" diff --git a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary index 9b1c6c32..d2a00b11 100755 --- a/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-qcow2-image.binary @@ -21,7 +21,7 @@ esac apt-get install -qqy qemu-utils -. auto/functions +. config/functions if [ -f binary/boot/disk-uefi.ext4 ]; then convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img diff --git a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary index 6c7bbeb0..7c2e0e54 100755 --- a/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary +++ b/live-build/ubuntu-cpc/hooks/040-vmdk-image.binary @@ -18,7 +18,7 @@ case ${IMAGE_TARGETS:-} in ;; esac -. auto/functions +. config/functions if [ -e binary/boot/disk-uefi.ext4 ]; then create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk diff --git a/live-build/ubuntu-cpc/hooks/042-vagrant.binary b/live-build/ubuntu-cpc/hooks/042-vagrant.binary index 4be0b7f8..382ac547 100755 --- a/live-build/ubuntu-cpc/hooks/042-vagrant.binary +++ b/live-build/ubuntu-cpc/hooks/042-vagrant.binary @@ -44,7 +44,7 @@ case $ARCH in exit 0;; esac -. auto/functions +. config/functions # Virtualbox is needed for making a small VMDK apt-get -qqy install genisoimage qemu-utils diff --git a/live-build/ubuntu-cpc/hooks/999-extras.binary b/live-build/ubuntu-cpc/hooks/999-extras.binary index f5790201..c36b1e7f 100755 --- a/live-build/ubuntu-cpc/hooks/999-extras.binary +++ b/live-build/ubuntu-cpc/hooks/999-extras.binary @@ -9,7 +9,7 @@ if [ ! -d ${my_dir}/extra ]; then fi # Export the common functions to the extras -. auto/functions +. config/functions # Cleaner execution /bin/run-parts --regex ".*\.binary" "${extra_d}" diff --git a/live-build/ubuntu-server/hooks/030-root-squashfs.binary b/live-build/ubuntu-server/hooks/030-root-squashfs.binary index eb03d7fc..dad337d0 100755 --- a/live-build/ubuntu-server/hooks/030-root-squashfs.binary +++ b/live-build/ubuntu-server/hooks/030-root-squashfs.binary @@ -20,7 +20,7 @@ if [ -n "$SUBARCH" ]; then exit 0 fi -. auto/functions +. config/functions mkdir binary/boot/squashfs.dir cp -a chroot/* binary/boot/squashfs.dir diff --git a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary index f71d9674..32e57ca6 100755 --- a/live-build/ubuntu-server/hooks/032-installer-squashfs.binary +++ b/live-build/ubuntu-server/hooks/032-installer-squashfs.binary @@ -21,7 +21,7 @@ if [ -n "$SUBARCH" ]; then exit 0 fi -. auto/functions +. config/functions SQUASH_ROOT=binary/boot/squashfs.dir OVERLAY_ROOT=binary/boot/overlay.dir