mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-02-22 10:51:11 +00:00
Refactor functions out of ubuntu-cpc and ubuntu-server hooks.
This commit is contained in:
parent
292c5f300c
commit
46fd6c58f5
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -1,6 +1,7 @@
|
||||
livecd-rootfs (2.441) UNRELEASED; urgency=medium
|
||||
|
||||
* Add ubuntu-server-live for a subiquity-based server image.
|
||||
* Refactor functions out of ubuntu-cpc and ubuntu-server hooks.
|
||||
|
||||
-- Mathieu Trudel-Lapierre <cyphermox@ubuntu.com> Thu, 23 Mar 2017 16:20:16 -0400
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
# vi: ts=4 expandtab syntax=sh
|
||||
|
||||
CLOUD_IMG_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||
IMAGE_SIZE=$((2252*1024**2)) # 2.2G (the current size we ship)
|
||||
imagesize=${IMAGE_SIZE:-$((2252*1024**2))} # 2.2G (the current size we ship)
|
||||
fs_label="${FS_LABEL:-rootfs}"
|
||||
|
||||
rootfs_dev_mapper=
|
||||
loop_device=
|
||||
@ -28,13 +28,13 @@ clean_loops() {
|
||||
|
||||
create_empty_disk_image() {
|
||||
# Prepare an empty disk image
|
||||
dd if=/dev/zero of="$1" bs=1 count=0 seek="${IMAGE_SIZE}"
|
||||
dd if=/dev/zero of="$1" bs=1 count=0 seek="${imagesize}"
|
||||
}
|
||||
|
||||
make_ext4_partition() {
|
||||
device="$1"
|
||||
|
||||
mkfs.ext4 -F -b 4096 -i 8192 -m 0 -L cloudimg-rootfs -E resize=536870912 "$device"
|
||||
label=${fs_label:+-L "${fs_label}"}
|
||||
mkfs.ext4 -F -b 4096 -i 8192 -m 0 ${label} -E resize=536870912 "$device"
|
||||
}
|
||||
|
||||
mount_image() {
|
||||
@ -103,7 +103,7 @@ mount_disk_image() {
|
||||
# such as updating grub and installing software
|
||||
cat > $mountpoint/usr/sbin/policy-rc.d << EOF
|
||||
#!/bin/sh
|
||||
# ${CLOUD_IMG_STR}
|
||||
# ${IMAGE_STR}
|
||||
echo "All runlevel operations denied by policy" >&2
|
||||
exit 101
|
||||
EOF
|
||||
@ -251,9 +251,9 @@ convert_to_qcow2() {
|
||||
|
||||
replace_grub_root_with_label() {
|
||||
# When update-grub is run, it will detect the disks in the build system.
|
||||
# Instead, we want grub to use the cloudimg-rootfs labelled disk
|
||||
# Instead, we want grub to use the right labelled disk
|
||||
CHROOT_ROOT="$1"
|
||||
|
||||
sed -i -e "s,root=[^ ]\+,root=LABEL=cloudimg-rootfs," \
|
||||
sed -i -e "s,root=[^ ]\+,root=LABEL=${fs_label}," \
|
||||
"$CHROOT_ROOT/boot/grub/grub.cfg"
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
. /build/config/functions
|
||||
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||
FS_LABEL="cloudimg-rootfs"
|
||||
|
||||
. auto/functions
|
||||
|
||||
BOOTPART_START=
|
||||
BOOTPART_END=
|
||||
|
@ -17,7 +17,7 @@ if [ -n "$SUBARCH" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
mkdir binary/boot/squashfs.dir
|
||||
cp -a chroot/* binary/boot/squashfs.dir
|
||||
|
@ -9,7 +9,10 @@ case $ARCH in
|
||||
;;
|
||||
esac
|
||||
|
||||
. /build/config/functions
|
||||
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||
FS_LABEL="cloudimg-rootfs"
|
||||
|
||||
. auto/functions
|
||||
|
||||
apt-get -qqy install dosfstools gdisk
|
||||
|
||||
|
@ -7,7 +7,10 @@ case $ARCH in
|
||||
;;
|
||||
esac
|
||||
|
||||
. /build/config/functions
|
||||
IMAGE_STR="# CLOUD_IMG: This file was created/modified by the Cloud Image build process"
|
||||
FS_LABEL="cloudimg-rootfs"
|
||||
|
||||
. auto/functions
|
||||
|
||||
create_partitions() {
|
||||
disk_image="$1"
|
||||
|
@ -21,7 +21,7 @@ esac
|
||||
|
||||
apt-get install -qqy qemu-utils
|
||||
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
if [ -f binary/boot/disk-uefi.ext4 ]; then
|
||||
convert_to_qcow2 binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.img
|
||||
|
@ -18,7 +18,7 @@ case ${IMAGE_TARGETS:-} in
|
||||
;;
|
||||
esac
|
||||
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
if [ -e binary/boot/disk-uefi.ext4 ]; then
|
||||
create_vmdk binary/boot/disk-uefi.ext4 livecd.ubuntu-cpc.vmdk
|
||||
|
@ -44,7 +44,7 @@ case $ARCH in
|
||||
exit 0;;
|
||||
esac
|
||||
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
# Virtualbox is needed for making a small VMDK
|
||||
apt-get -qqy install genisoimage qemu-utils
|
||||
|
@ -9,7 +9,7 @@ if [ ! -d ${my_dir}/extra ]; then
|
||||
fi
|
||||
|
||||
# Export the common functions to the extras
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
# Cleaner execution
|
||||
/bin/run-parts --regex ".*\.binary" "${extra_d}"
|
||||
|
@ -1 +0,0 @@
|
||||
../ubuntu-cpc/functions
|
@ -20,7 +20,7 @@ if [ -n "$SUBARCH" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
mkdir binary/boot/squashfs.dir
|
||||
cp -a chroot/* binary/boot/squashfs.dir
|
||||
|
@ -21,7 +21,7 @@ if [ -n "$SUBARCH" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. /build/config/functions
|
||||
. auto/functions
|
||||
|
||||
SQUASH_ROOT=binary/boot/squashfs.dir
|
||||
OVERLAY_ROOT=binary/boot/overlay.dir
|
||||
|
Loading…
x
Reference in New Issue
Block a user