[SRU] Reinforce hostname preseed regex
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
debian-installer (Ubuntu) |
Fix Released
|
Medium
|
Hua Zhang | ||
Trusty |
Fix Released
|
Medium
|
Eric Desrochers | ||
Xenial |
Fix Released
|
Medium
|
Hua Zhang | ||
Artful |
Fix Released
|
Medium
|
Hua Zhang | ||
Bionic |
Fix Released
|
Medium
|
Hua Zhang | ||
preseed (Ubuntu) |
Fix Released
|
Medium
|
Hua Zhang | ||
Trusty |
Fix Released
|
Medium
|
Hua Zhang | ||
Xenial |
Fix Released
|
Medium
|
Hua Zhang | ||
Artful |
Fix Released
|
Medium
|
Hua Zhang | ||
Bionic |
Fix Released
|
Medium
|
Hua Zhang |
Bug Description
[Special notes]
Rebuilding debian-installer will be necessary in order to get a new mini.iso (Minimal ISO image of Ubuntu) containing this particular fix.
Despite the fact that a full ISO are no longer built for some of the affected stable releases, one can use what is called a minimal ISO image (mini.iso) of Ubuntu. This mini.iso uses a text-based installer, resulting in a smaller image. The minimal ISO image will download packages from online archives at installation time instead of providing them on the install media itself.
[Impact]
This is the same issue reported in https:/
However that is marked as 'Fix Released' and the issue is still occurring so it seems best to just open a new bug according to Eric's comment.
The present hostname preseed regex looks like:
if ! echo "$RET" | grep -q 'ubuntu'; then
...
/bin/sed -i "s/$CURRENT_
...
fi
There are still multiple problems with them according to Peter's comment (https:/
- The default hostname is 'ubuntu', and is the value you will get if nothing is preseeded -- we *do* need to skip it in this case, although the grep may need to be more precise. A name like 'ubuntuxenial' should match this grep.
- The sed needs to be fixed to more appropriately catch for the exact string, rather than any substring -- ie. it should not match 'ipv6-allnodes' if the name received from DHCP was 'node'. It should only match and replace for 'node'.
So the fix will try to:
1) Keep the if statement and add the -w option to grep to be more robust
2) Modify the sed cmd with word boundaries (\b) to be more robust as well.
[Test Case]
Install Ubuntu using a preseed[1] file[2] and add the following line in the preseed recipe :
d-i netcfg/hostname string <HOSTNAME>
Change the HOSTNAME to see if the hostname in /etc/hosts can be updated correctly.
[1] - url=http://<WEB_SERVER>
[2] - https:/
[Regression Potential]
* none expected, the actual changes are as follows:
- if ! echo "$RET" | grep -q 'ubuntu'; then
+ if ! echo "$RET" | grep -qw 'ubuntu'; then
...
- /bin/sed -i "s/$CURRENT_
+ /bin/sed -i "s/\b${
In other words, we simply make it more robust to select only pattern containing matches that form whole word... catching 'ubuntu' hostname as-is but not catching pattern where ubuntu is part of the user chosen hostname as follow :
"sometextubuntu"
"sometextubuntu
"ubuntusometext"
...
[Original Description]
Related branches
tags: | added: sts |
Changed in preseed (Ubuntu Trusty): | |
assignee: | nobody → Hua Zhang (zhhuabj) |
Changed in preseed (Ubuntu Xenial): | |
assignee: | nobody → Hua Zhang (zhhuabj) |
Changed in preseed (Ubuntu Bionic): | |
assignee: | nobody → Hua Zhang (zhhuabj) |
status: | New → Confirmed |
Changed in preseed (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in preseed (Ubuntu Trusty): | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in preseed (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in preseed (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Bionic): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in debian-installer (Ubuntu Xenial): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in debian-installer (Ubuntu Trusty): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in preseed (Ubuntu Trusty): | |
status: | Confirmed → In Progress |
Changed in preseed (Ubuntu Xenial): | |
status: | Confirmed → In Progress |
Changed in preseed (Ubuntu Bionic): | |
status: | Confirmed → In Progress |
Changed in preseed (Ubuntu Artful): | |
assignee: | nobody → Hua Zhang (zhhuabj) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in debian-installer (Ubuntu Artful): | |
assignee: | nobody → Eric Desrochers (slashd) |
Changed in debian-installer (Ubuntu Bionic): | |
status: | New → In Progress |
tags: | added: patch |
Changed in debian-installer (Ubuntu Bionic): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Artful): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Trusty): | |
importance: | Undecided → Medium |
Changed in debian-installer (Ubuntu Artful): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu Xenial): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in debian-installer (Ubuntu Bionic): | |
assignee: | Eric Desrochers (slashd) → Hua Zhang (zhhuabj) |
Changed in debian-installer (Ubuntu Artful): | |
assignee: | Eric Desrochers (slashd) → Hua Zhang (zhhuabj) |
Changed in debian-installer (Ubuntu Xenial): | |
assignee: | Eric Desrochers (slashd) → Hua Zhang (zhhuabj) |
description: | updated |
description: | updated |
tags: | added: id-5ab94d853c3f9bad14e58f87 |
Changed in debian-installer (Ubuntu Bionic): | |
status: | In Progress → Fix Released |
Changed in debian-installer (Ubuntu): | |
status: | In Progress → Fix Released |
tags: | removed: verification-needed |
I'll take care of the "d-i" bit to force a rebuild of the mini.iso once Joshua's preseed patch is uploaded in affected releases.
Note: "d-i" for Trusty will need extra care as it faces a FTBFS situation.
For more details, see LP: #1743787.
- Eric