Merge ~xnox/casper:papercuts into casper:master

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 64e869d8b5d9c9d0db4ff3f92b873e3e947f9c06
Proposed branch: ~xnox/casper:papercuts
Merge into: casper:master
Diff against target: 66 lines (+18/-9)
1 file modified
scripts/casper (+18/-9)
Reviewer Review Type Date Requested Status
Michael Hudson-Doyle Pending
Ubuntu Installer Team Pending
Review via email: mp+384565@code.launchpad.net

Commit message

Fix a bunch of UX papercuts when trying to use VLAN static IP configuration.

1) Sorts interface names
2) Correctly export IP= after $DEVICE got converted into $DEVICE.vlanid
3) Set netmask => default netmask that ipconfig guesses is plain wrong
4) Drop bogus mount - move /cow /root/cow => it doesn't work with tmpfs
5) Break out of the loop waiting for devices to appear quicker, if there are no more udev events

With this in place, I can relatively painlessly configure interactively static IP configuration.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

This all looks good, just one question.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Oh and while you're here (sorry) have you ever thought about making uuid mismatches noisier? I get extremely confused every time my test vm doesn't boot because I forgot about uuids.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On Wed, 27 May 2020 at 03:03, Michael Hudson-Doyle
<email address hidden> wrote:
>
> This all looks good, just one question.
>
> Diff comments:
>
> > diff --git a/scripts/casper b/scripts/casper
> > index 6e9ff35..6cecb79 100644
> > --- a/scripts/casper
> > +++ b/scripts/casper
> > @@ -885,6 +890,10 @@ mountroot() {
> > if [ "${livefs_root}" ]; then
> > break
> > fi
> > + # No more udev events, no more devices, nothing to wait for
>
> Are we just waiting for udev here? I thought the issue was that sometimes it takes some time for hardware to show up at all. If I'm mistaken, +1 for sure.
>

I don't know how to make a distinction between hardware that is slow
and we are enumerating 1000s of hard drives looking for our CDROM,
versus interactive netboot where there will never be a drive matching
for us.

My assumption here is that, if we are enumerating 1000s of hard
drives, udev queue will be full of unprocessed events.

On the s390x LPAR, it appears that the installer is hung up, one hits
enter a few times, and then none of the `read -p` work, cause stdin is
full of things.

Whereas on s390x QEMU, the CDROM should appear there quite quickly.

Regards,

Dimitri.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

On Wed, 27 May 2020 at 03:04, Michael Hudson-Doyle
<email address hidden> wrote:
>
> Oh and while you're here (sorry) have you ever thought about making uuid mismatches noisier? I get extremely confused every time my test vm doesn't boot because I forgot about uuids.

That is https://bugs.launchpad.net/ubuntu/+source/casper/+bug/1877618

--
Regards,

Dimitri.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/casper b/scripts/casper
2index 6e9ff35..6cecb79 100644
3--- a/scripts/casper
4+++ b/scripts/casper
5@@ -345,7 +345,7 @@ do_interactive_netmount() {
6 read -p "vlan id (optional): " vlanid
7
8 # pick interface
9- interfaces=$(ls /sys/class/net | grep -v lo)
10+ interfaces=$(ls /sys/class/net | grep -v lo | sort)
11 count=$(echo $interfaces | wc -w)
12 default_device=$(echo ${interfaces} | cut -d " " -f1)
13 if [ "$count" -gt 1 ]; then
14@@ -359,10 +359,6 @@ do_interactive_netmount() {
15 fi
16 fi
17
18- if [ "$proto" = "none" ]; then
19- export IP=:$ipaddr:$gateway:::$DEVICE:$proto:$dns
20- fi
21-
22 . /etc/os-release
23 # TODO: not sure how to get flavour information
24 # maybe make livecd-rootfs embed something in the casper initrd?
25@@ -406,7 +402,19 @@ do_interactive_netmount() {
26 if [ -n "$vlanid" ]; then
27 export VLAN=$DEVICE.$vlanid:$DEVICE
28 DEVICE=$DEVICE.$vlanid
29- export VLAN=$vlan
30+ fi
31+
32+ if [ "$proto" = "none" ]; then
33+ case $ipaddr in
34+ *.*)
35+ netmask=255.255.255.0
36+ ;;
37+ *:*)
38+ # I don't think we support static ipv6
39+ netmask=
40+ ;;
41+ esac
42+ export IP=$ipaddr::$gateway:$netmask::$DEVICE:$proto:$dns
43 fi
44
45 echo Configuring networking...
46@@ -703,9 +711,6 @@ setup_overlay() {
47 mount -o move "${d}" "${rootmnt}/rofs"
48 break
49 done
50-
51- # move /cow such that live-system can poke & debug the overlayfs layers
52- mount -o move /cow "${rootmnt}/cow"
53 }
54
55 check_dev ()
56@@ -885,6 +890,10 @@ mountroot() {
57 if [ "${livefs_root}" ]; then
58 break
59 fi
60+ # No more udev events, no more devices, nothing to wait for
61+ if udevadm settle --timeout 0 2>/dev/null; then
62+ break
63+ fi
64 sleep 1
65 i="$(($i + 1))"
66 done

Subscribers

People subscribed via source and target branches