Permalink
| #! /bin/sh | |
| set -ex | |
| IVER="$(dpkg -s initramfs-tools-ubuntu-core | \ | |
| sed -n '/^Version:/{s/^[^: ]*: \([^: ]*\).*/\1/;p;}')" | |
| # fail the build if we did not find the snappy initrd package | |
| [ -n "$IVER" ] || exit 1 | |
| # force lzma | |
| mkdir -p /etc/initramfs-tools/conf.d | |
| echo "COMPRESS=lzma" >/etc/initramfs-tools/conf.d/snappy-generic-initrd.conf | |
| update-initramfs.REAL -c -kcore-"$IVER" -v | |
| (cd /boot; ln -s initrd.img-core-"$IVER" initrd.img-core) | |
| sha1sum /boot/initrd.img-core >/var/lib/initramfs-tools/core | |
| # for snapcraft backwards compatibility | |
| mkdir -p /usr/lib/ubuntu-core-generic-initrd | |
| for f in /boot/initrd.img*; do | |
| # use relative path as this is inside the core snap which may be relocated | |
| ln -s ../../../boot/"$(basename "$f")" /usr/lib/ubuntu-core-generic-initrd/ | |
| done |