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
diff --git a/scripts/casper b/scripts/casper
index 6e9ff35..6cecb79 100644
--- a/scripts/casper
+++ b/scripts/casper
@@ -345,7 +345,7 @@ do_interactive_netmount() {
345 read -p "vlan id (optional): " vlanid345 read -p "vlan id (optional): " vlanid
346346
347 # pick interface347 # pick interface
348 interfaces=$(ls /sys/class/net | grep -v lo)348 interfaces=$(ls /sys/class/net | grep -v lo | sort)
349 count=$(echo $interfaces | wc -w)349 count=$(echo $interfaces | wc -w)
350 default_device=$(echo ${interfaces} | cut -d " " -f1)350 default_device=$(echo ${interfaces} | cut -d " " -f1)
351 if [ "$count" -gt 1 ]; then351 if [ "$count" -gt 1 ]; then
@@ -359,10 +359,6 @@ do_interactive_netmount() {
359 fi359 fi
360 fi360 fi
361361
362 if [ "$proto" = "none" ]; then
363 export IP=:$ipaddr:$gateway:::$DEVICE:$proto:$dns
364 fi
365
366 . /etc/os-release362 . /etc/os-release
367 # TODO: not sure how to get flavour information363 # TODO: not sure how to get flavour information
368 # maybe make livecd-rootfs embed something in the casper initrd?364 # maybe make livecd-rootfs embed something in the casper initrd?
@@ -406,7 +402,19 @@ do_interactive_netmount() {
406 if [ -n "$vlanid" ]; then402 if [ -n "$vlanid" ]; then
407 export VLAN=$DEVICE.$vlanid:$DEVICE403 export VLAN=$DEVICE.$vlanid:$DEVICE
408 DEVICE=$DEVICE.$vlanid404 DEVICE=$DEVICE.$vlanid
409 export VLAN=$vlan405 fi
406
407 if [ "$proto" = "none" ]; then
408 case $ipaddr in
409 *.*)
410 netmask=255.255.255.0
411 ;;
412 *:*)
413 # I don't think we support static ipv6
414 netmask=
415 ;;
416 esac
417 export IP=$ipaddr::$gateway:$netmask::$DEVICE:$proto:$dns
410 fi418 fi
411419
412 echo Configuring networking...420 echo Configuring networking...
@@ -703,9 +711,6 @@ setup_overlay() {
703 mount -o move "${d}" "${rootmnt}/rofs"711 mount -o move "${d}" "${rootmnt}/rofs"
704 break712 break
705 done713 done
706
707 # move /cow such that live-system can poke & debug the overlayfs layers
708 mount -o move /cow "${rootmnt}/cow"
709}714}
710715
711check_dev ()716check_dev ()
@@ -885,6 +890,10 @@ mountroot() {
885 if [ "${livefs_root}" ]; then890 if [ "${livefs_root}" ]; then
886 break891 break
887 fi892 fi
893 # No more udev events, no more devices, nothing to wait for
894 if udevadm settle --timeout 0 2>/dev/null; then
895 break
896 fi
888 sleep 1897 sleep 1
889 i="$(($i + 1))"898 i="$(($i + 1))"
890 done899 done

Subscribers

People subscribed via source and target branches