Merge latest prerequisite branches.

sil2100/raspi-wpasupplicant
Łukasz 'sil2100' Zemczak 6 years ago
commit cc5d39b93d

8
debian/changelog vendored

@ -5,6 +5,14 @@ livecd-rootfs (2.543) UNRELEASED; urgency=medium
* Add support for raspi3 rootfs builds (based on Ryan Finnie).
* For ubuntu-image consumption, export the kernel and initrd to
image/boot/uboot for raspi*.
* vagrant: disabling automatic console log file
[ Łukasz 'sil2100' Zemczak ]
* Avoid issues of hard-linking to a symbolic vmlinuz as this can lead to a
dangling symlink.
* Add support for raspi3 rootfs builds (based on Ryan Finnie).
* For ubuntu-image consumption, export the kernel and initrd to
image/boot/uboot for raspi*.
-- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 18 Sep 2018 10:21:30 +0200

@ -565,6 +565,7 @@ fi
# '--initramfs none' produces different manifest names.
if [ -e "binary/$INITFS/filesystem.packages" ]; then
./config/snap-seed-parse "chroot/" >> "binary/${INITFS}/filesystem.packages"
ln "binary/$INITFS/filesystem.packages" "$PREFIX.manifest"
chmod 644 "$PREFIX.manifest"
fi

@ -33,6 +33,7 @@ fi
mkdir -p config
cp -af /usr/share/livecd-rootfs/live-build/functions config/functions
cp -af /usr/share/livecd-rootfs/live-build/snap-seed-parse.py config/snap-seed-parse
mkdir -p config/package-lists
@ -197,6 +198,14 @@ case $IMAGEFORMAT in
*)
UBUNTU_IMAGE_ARGS="" ;;
esac
case $SUITE in
xenial)
# Ubuntu Core 16
;;
*)
# Ubuntu Core 18
MODEL="ubuntu-core-18-${MODEL#pc-}" ;;
esac
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common

@ -43,6 +43,17 @@ create_empty_disk_image() {
dd if=/dev/zero of="$1" bs=1 count=0 seek="${imagesize}"
}
create_manifest() {
local chroot_root=${1}
local target_file=${2}
echo "create_manifest chroot_root: ${chroot_root}"
dpkg-query --show --admindir="${chroot_root}/var/lib/dpkg" > ${target_file}
echo "create_manifest call to dpkg-query finished."
./config/snap-seed-parse "${chroot_root}" >> ${target_file}
echo "create_manifest call to snap_seed_parse finished."
echo "create_manifest finished"
}
make_ext4_partition() {
device="$1"
label=${fs_label:+-L "${fs_label}"}

@ -0,0 +1,56 @@
#!/usr/bin/python3
"""
Usage: snap-seed-parse ${chroot_dir} > somefile.manifest
This script looks for a seed.yaml path in the given root directory, parsing
it and printing generated manifest lines to stdout for easy redirection.
"""
import re
import sys
import yaml
import os.path
def log(msg):
sys.stderr.write("snap-seed-parse: {}\n".format(msg))
log("Parsing seed.yaml")
CHROOT_ROOT = sys.argv[1] if len(sys.argv) > 1 and len(sys.argv[1]) > 0 \
else ''
# Trim any trailing slashes for correct appending
log("CHROOT_ROOT: {}".format(CHROOT_ROOT))
if len(CHROOT_ROOT) > 0 and CHROOT_ROOT[-1] == '/':
CHROOT_ROOT = CHROOT_ROOT[:-1]
# This is where we expect to find the seed.yaml file
YAML_PATH = CHROOT_ROOT + '/var/lib/snapd/seed/seed.yaml'
# Snaps are prepended with this string in the manifest
LINE_PREFIX = 'snap:'
log("yaml path: {}".format(YAML_PATH))
if not os.path.isfile(YAML_PATH):
log("WARNING: yaml path not found; no seeded snaps found.")
exit(0)
else:
log("yaml path found.")
with open(YAML_PATH, 'r') as fh:
yaml_lines = yaml.safe_load(fh)['snaps']
# Loop over dict items, outputting one manifest line from each triplet
for item in yaml_lines:
filestring = item['file']
# Pull the revision number off the file name
revision = filestring[filestring.rindex('_')+1:]
revision = re.sub(r'[^0-9]', '', revision)
print("{}{}\t{}\t{}".format(LINE_PREFIX,
item['name'],
item['channel'],
revision,
))

@ -26,4 +26,4 @@ mkdir -p $rootfs_dir/lib/modules
teardown_mountpoint $rootfs_dir
dpkg-query --admindir=$rootfs_dir/var/lib/dpkg -W > $rootfs_dir.manifest
create_manifest "${rootfs_dir}" "${rootfs_dir}.manifest"

@ -93,6 +93,12 @@ install_grub() {
;;
esac
# This call to generate the package manifest is added here to capture
# grub-efi packages that otherwise would not make it into the base
# manifest. filesystem.packages is moved into place via symlinking to
# livecd.ubuntu-cpc.manifest by live-build/auto/build after lb_binary runs
create_manifest "mountpoint" "binary/boot/filesystem.packages"
chroot mountpoint grub-install "${loop_device}" \
--boot-directory=/boot \
--efi-directory=/boot/efi \

@ -163,7 +163,8 @@ Vagrant.configure("2") do |config|
config.vm.provider "virtualbox" do |vb|
vb.customize [ "modifyvm", :id, "--uart1", "0x3F8", "4" ]
vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ]
# Creating a console log file is not an expected behavior for vagrant boxes. LP #1777827
# vb.customize [ "modifyvm", :id, "--uartmode1", "file", File.join(Dir.pwd, "${prefix}-console.log") ]
end
end
EOF

@ -28,7 +28,7 @@ cp -a chroot/* binary/boot/squashfs.dir
squashfs_f="${PWD}/livecd.${PROJECT}.squashfs"
squashfs_f_manifest="${squashfs_f}.manifest"
dpkg-query --admindir=binary/boot/squashfs.dir/var/lib/dpkg -W > ${squashfs_f_manifest}
create_manifest "binary/boot/squashfs.dir" "${squashfs_f_manifest}"
(cd "binary/boot/squashfs.dir/" &&
mksquashfs . ${squashfs_f} \

Loading…
Cancel
Save