squashfs url matching is too strict
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-initramfs-tools |
Fix Released
|
Low
|
Unassigned | ||
cloud-initramfs-tools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Won't Fix
|
Medium
|
Unassigned | ||
Artful |
Fix Released
|
Medium
|
Unassigned |
Bug Description
==== Begin SRU Template ===
[Impact]
Squashfs images published by Ubuntu on http://
end in '.squashfs' and on http://
the files are named 'squashfs'.
When you boot an initramfs with rooturl it would automatically
determine/assume that content is squashfs if it ended in
'.squash' or '.squashfs'.
The filter was just too strict and would thus not match
http://
That meant a usage would have to re-publish the url.
[Test Case]
## setup system to build maas images
$ sudo apt-get install -qy --no-install-
$ bzr branch lp:maas-images
$ cd maas-images
$ ./system-setup
## download the reference squashfs images.
$ arch=amd64
$ burl=http://
# download reference squashfs images
$ for rel in xenial zesty artful; do
file=
[ -f "$file" ] && continue;
wget "$burl/
mv "$file.tmp" "$file"
done
## build maas image output. This creates a squashfs image and kernel/initramfs
## files that have the updated packages inside.
## It does take a while to run, and lots of cpu and IO.
## You can reduce the kernels built by commenting out 'lowlatency' and 'edge'
## kernels:
## sed -i -e '/^[ ].*\(lowlatency
# either set 'proposed' or add the repo via M2E_ADD_REPOS
$ proposed=
$ export M2E_ADD_
$ for rel in xenial zesty artful; do
img=.
PATH=
$arch $rel $(date +"%Y%m%d") $img ../$rel.d/ 2>&1 |
tee ../$rel.log
done
## After running, you will have files like:
$ find xenial.d/xenial -type f | sort
xenial.
xenial.
xenial.
xenial.
xenial.
xenial.
## You can verify in the $rel.log files you have 'Setting up cloud-initramfs-'
$ grep '^Setting up overlayroot' xenial.log
Setting up overlayroot (0.27ubuntu1.
## Now download the test-boot script, provide it a directory and
## the squashfs, kernel, initramfs
$ ./test-boot test-x xenial.
xenial.
xenial.
$ r=zesty; ./test-boot work.d $r.d/*/
Now, do:
cd work.d
./boot
## Running ./boot will serve the squashfs image over http, and then
## boot the kernel and initrd with a kernel command line of
## root=http://<url>/squashfs
## and
## ds=nocloud-
## which will the read the 'user-data' and 'meta-data' files in that dir.
##
## The result is that you can log in with 'ubuntu' and 'passw0rd'
## Then collect some information
# you'll see the 'LABEL=' entry is commented out.
$ cat /etc/fstab
# local-fs.target should be fine
$ systemctl status local-fs.target --no-pager
# just for record
$ cat /proc/cmdline
[Regression Potential]
Very low.
If a url does not match, rooturl would just complain and do nothing.
This just extends the things that match.
[Other Info]
This does seem to be low importance. In fact it is, but its jsut part
of syncing cloud-initramfs
The fix applied here is a backport what is currently in bionic to
each release. in xenial, that means a new binary package
(cloud-
==== End SRU Template ===
The code that automatically determines a squashfs url is just to strict.
You can explicitly declare it as squash with:
root=squashfs:http://<>/...
but currently the automatic matching requires it to end in .squashfs or .squash.
This doesn't match urls like
<url>/squashfs
<url>/my-squash
which are as obviously squashfs urls as others.
Changed in cloud-initramfs-tools: | |
status: | New → Fix Released |
importance: | Undecided → Medium |
Changed in cloud-initramfs-tools (Ubuntu): | |
status: | New → Fix Released |
Changed in cloud-initramfs-tools: | |
importance: | Medium → Low |
Changed in cloud-initramfs-tools (Ubuntu): | |
importance: | Undecided → Medium |
status: | Fix Released → Confirmed |
Changed in cloud-initramfs-tools (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-initramfs-tools (Ubuntu Zesty): | |
status: | New → Confirmed |
Changed in cloud-initramfs-tools (Ubuntu Artful): | |
status: | New → Confirmed |
Changed in cloud-initramfs-tools (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-initramfs-tools (Ubuntu Zesty): | |
importance: | Undecided → Medium |
Changed in cloud-initramfs-tools (Ubuntu Artful): | |
importance: | Undecided → Medium |
description: | updated |
summary: |
- squashfs url matching is to strict + squashfs url matching is too strict |
description: | updated |
description: | updated |
This bug was fixed in the package cloud-initramfs -tools - 0.40ubuntu1
--------------- -tools (0.40ubuntu1) bionic; urgency=medium
cloud-initramfs
* rooturl: adjust squashfs url matching to not require '.'.
Previously it would match <url>*.squashfs or <url>*.squash
Now it will match <url>*squashfs or <url>*.squash.
(LP: #1728048)
* overlayroot: Comment out the read-only line for /. This hopes to
avoid systemd confusion and transient ordering cycle. (LP: #1723183)
-- Scott Moser <email address hidden> Fri, 27 Oct 2017 09:44:49 -0400