Merge ~xnox/casper:more-fixes into casper:master

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: b78e4da7bbfcb6b97e1b883be2062cefda748238
Proposed branch: ~xnox/casper:more-fixes
Merge into: casper:master
Diff against target: 64 lines (+16/-10)
2 files modified
casper-md5check/casper-md5check.c (+1/-3)
scripts/casper (+15/-7)
Reviewer Review Type Date Requested Status
Ubuntu Installer Team Pending
Review via email: mp+384879@code.launchpad.net

Commit message

More fixes.

UX improvements in md5check, interactive static ip config.

Bugfix failure to correctly configure static ip config on a single available device.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/casper-md5check/casper-md5check.c b/casper-md5check/casper-md5check.c
2index 1d5699b..16b86b5 100644
3--- a/casper-md5check/casper-md5check.c
4+++ b/casper-md5check/casper-md5check.c
5@@ -187,7 +187,7 @@ void plymouth_urgent(ply_boot_client_t *client, char *format, ...) {
6 plymouth_response, NULL);
7 ply_boot_client_flush(client);
8 } else
9- printf("%s\n", s);
10+ printf("\n%s\n", s);
11
12 free(s);
13 }
14@@ -310,8 +310,6 @@ int main(int argc, char **argv) {
15
16 if (!client || !ply_event_loop || !ply_boot_client_connect(client, plymouth_disconnected, NULL))
17 {
18- /* Fall back to text output */
19- perror("Connecting to plymouth");
20 got_plymouth = 0;
21 } else
22 got_plymouth = 1;
23diff --git a/scripts/casper b/scripts/casper
24index 6cecb79..87f72ce 100644
25--- a/scripts/casper
26+++ b/scripts/casper
27@@ -332,8 +332,16 @@ do_interactive_netmount() {
28 static|off|none)
29 proto=none
30 read -p "ip: " ipaddr
31- read -p "gateway: " gateway
32- read -p "dns: " dns
33+ default_gw=${ipaddr%.*}.1
34+ read -p "gateway (default $default_gw): " gateway
35+ if [ -z "$gateway" ]; then
36+ gateway=$default_gw
37+ fi
38+ default_dns=$gateway
39+ read -p "dns (default $default_dns): " dns
40+ if [ -z "$dns" ]; then
41+ dns=$default_dns
42+ fi
43 ;;
44 dhcp|on|any|"")
45 export IP=dhcp ;;
46@@ -348,14 +356,14 @@ do_interactive_netmount() {
47 interfaces=$(ls /sys/class/net | grep -v lo | sort)
48 count=$(echo $interfaces | wc -w)
49 default_device=$(echo ${interfaces} | cut -d " " -f1)
50- if [ "$count" -gt 1 ]; then
51- if [ -n "$vlanid" ] || [ "$proto" = "none" ]; then
52+ if [ -n "$vlanid" ] || [ "$proto" = "none" ]; then
53+ if [ "$count" -gt 1 ]; then
54 echo "Available interfaces:"
55 echo $interfaces | fold -s -w 79
56 read -p "device (default $default_device): " DEVICE
57- if [ -z "$DEVICE" ]; then
58- DEVICE=$default_device
59- fi
60+ fi
61+ if [ -z "$DEVICE" ]; then
62+ DEVICE=$default_device
63 fi
64 fi
65

Subscribers

People subscribed via source and target branches