Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2015-11-12 19:37:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/linuxrc (Old) and /work/SRC/openSUSE:Factory/.linuxrc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "linuxrc" Changes: -------- --- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes 2015-10-28 17:14:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2015-11-12 19:37:13.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Nov 9 09:08:25 UTC 2015 - [email protected] + +- remove obsolete code +- fix wifi support in linuxrc (bsc#949938) +- 5.0.62 + +------------------------------------------------------------------- Old: ---- linuxrc-5.0.61.tar.xz New: ---- linuxrc-5.0.62.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.KqgyjP/_old 2015-11-12 19:37:14.000000000 +0100 +++ /var/tmp/diff_new_pack.KqgyjP/_new 2015-11-12 19:37:14.000000000 +0100 @@ -25,7 +25,7 @@ Summary: SUSE Installation Program License: GPL-3.0+ Group: System/Boot -Version: 5.0.61 +Version: 5.0.62 Release: 0 Source: %{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ linuxrc-5.0.61.tar.xz -> linuxrc-5.0.62.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/VERSION new/linuxrc-5.0.62/VERSION --- old/linuxrc-5.0.61/VERSION 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/VERSION 2015-11-09 11:08:05.000000000 +0100 @@ -1 +1 @@ -5.0.61 +5.0.62 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/changelog new/linuxrc-5.0.62/changelog --- old/linuxrc-5.0.61/changelog 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/changelog 2015-11-09 11:08:05.000000000 +0100 @@ -1,3 +1,7 @@ +2015-11-06: 5.0.62 + - remove obsolete code + - fix wifi support in linuxrc (bsc #949938) + 2015-10-21: 5.0.61 - skip also hostname check when sslcerts option is 0 (bsc #951001) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/dialog.c new/linuxrc-5.0.62/dialog.c --- old/linuxrc-5.0.61/dialog.c 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/dialog.c 2015-11-09 11:08:05.000000000 +0100 @@ -116,9 +116,8 @@ { di_osa_qdio, "QDIO" }, { di_wlan_open, "No Authentication" }, - { di_wlan_wep_o, "WEP - Open" }, - { di_wlan_wep_r, "WEP - Shared Key" }, - { di_wlan_wpa, "WPA-PSK" }, + { di_wlan_wpa_psk, "WPA-PSK" }, + { di_wlan_wpa_peap, "WPA-PEAP" }, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/dialog.h new/linuxrc-5.0.62/dialog.h --- old/linuxrc-5.0.61/dialog.h 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/dialog.h 2015-11-09 11:08:05.000000000 +0100 @@ -99,9 +99,8 @@ di_osa_qdio, di_wlan_open, - di_wlan_wep_o, - di_wlan_wep_r, - di_wlan_wpa, + di_wlan_wpa_psk, + di_wlan_wpa_peap, } dia_item_t; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/file.c new/linuxrc-5.0.62/file.c --- old/linuxrc-5.0.61/file.c 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/file.c 2015-11-09 11:08:05.000000000 +0100 @@ -246,13 +246,13 @@ { key_ethtool, "ethtool", kf_cfg + kf_cmd_early }, { key_listen, "listen", kf_cfg + kf_cmd }, { key_zombies, "Zombies", kf_cfg + kf_cmd }, - { key_forceip, "forceip", kf_cfg + kf_cmd }, - { key_wlan_essid, "WlanESSID", kf_cfg + kf_cmd }, - { key_wlan_auth, "WlanAuth", kf_cfg + kf_cmd }, - { key_wlan_key_ascii, "WlanKeyAscii", kf_cfg + kf_cmd }, - { key_wlan_key_hex, "WlanKeyHex", kf_cfg + kf_cmd }, - { key_wlan_key_pass, "WlanKeyPass", kf_cfg + kf_cmd }, - { key_wlan_key_len, "WlanKeyLen", kf_cfg + kf_cmd }, + { key_wlan_essid, "WlanESSID", kf_cfg + kf_cmd_early }, + { key_wlan_essid, "ESSID", kf_cfg + kf_cmd_early }, + { key_wlan_auth, "WlanAuth", kf_cfg + kf_cmd_early }, + { key_wlan_wpa_psk, "WPAPSK", kf_cfg + kf_cmd_early }, + { key_wlan_wpa_pass, "WPAPassword", kf_cfg + kf_cmd_early }, + { key_wlan_wpa_id, "WPAIdentity", kf_cfg + kf_cmd_early }, + { key_wlan_device, "WlanDevice", kf_cfg + kf_cmd_early }, { key_netcardname, "NetCardName", kf_none }, { key_ibft_hwaddr, "iSCSI_INITIATOR_HWADDR", kf_ibft }, { key_ibft_ipaddr, "iSCSI_INITIATOR_IPADDR", kf_ibft }, @@ -359,10 +359,9 @@ { "lcs", di_osa_lcs }, #endif { "open", wa_open }, - { "wep", wa_wep_open }, - { "wep_o", wa_wep_open }, - { "wep_r", wa_wep_restricted }, - { "wpa", wa_wpa }, + { "psk", wa_wpa_psk }, + { "wpa", wa_wpa_psk }, + { "peap", wa_wpa_peap }, }; @@ -1418,37 +1417,36 @@ if(f->is.numeric) config.mediacheck = f->nvalue; break; - case key_forceip: - if(f->is.numeric) config.forceip = f->nvalue; - break; - case key_wlan_essid: str_copy(&config.net.wlan.essid, *f->value ? f->value : NULL); break; - case key_wlan_key_ascii: - str_copy(&config.net.wlan.key, *f->value ? f->value : NULL); - config.net.wlan.key_type = kt_ascii; - break; - - case key_wlan_key_hex: - str_copy(&config.net.wlan.key, *f->value ? f->value : NULL); - config.net.wlan.key_type = kt_hex; + case key_wlan_wpa_psk: + str_copy(&config.net.wlan.wpa_psk, *f->value ? f->value : NULL); + config.net.wlan.auth = wa_wpa_psk; break; - case key_wlan_key_pass: - str_copy(&config.net.wlan.key, *f->value ? f->value : NULL); - config.net.wlan.key_type = kt_pass; + case key_wlan_wpa_id: + str_copy(&config.net.wlan.wpa_identity, *f->value ? f->value : NULL); + config.net.wlan.auth = wa_wpa_peap; break; - case key_wlan_key_len: - if(f->is.numeric) config.net.wlan.key_len = f->nvalue; + case key_wlan_wpa_pass: + str_copy(&config.net.wlan.wpa_password, *f->value ? f->value : NULL); + config.net.wlan.auth = wa_wpa_peap; break; case key_wlan_auth: if(f->is.numeric) config.net.wlan.auth = f->nvalue; break; + case key_wlan_device: + if(*f->value) { + slist_append_str(&config.net.wlan.devices, f->value); + config.net.wlan.devices_fixed = 1; + } + break; + case key_net_retry: if(f->is.numeric) config.net.retry = f->nvalue; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/file.h new/linuxrc-5.0.62/file.h --- old/linuxrc-5.0.61/file.h 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/file.h 2015-11-09 11:08:05.000000000 +0100 @@ -41,9 +41,9 @@ key_port, key_smbshare, key_rootimage2, key_instsys_id, key_initrd_id, key_instsys_complain, key_osainterface, key_dud_complain, key_dud_expected, - key_withiscsi, key_ethtool, key_listen, key_zombies, key_forceip, - key_layer2, key_wlan_essid, key_wlan_auth, key_wlan_key_ascii, - key_wlan_key_hex, key_wlan_key_pass, key_wlan_key_len, key_netcardname, + key_withiscsi, key_ethtool, key_listen, key_zombies, + key_layer2, key_wlan_essid, key_wlan_auth, key_wlan_wpa_psk, + key_wlan_wpa_id, key_wlan_wpa_pass, key_wlan_device, key_netcardname, key_ibft_hwaddr, key_ibft_ipaddr, key_ibft_netmask, key_ibft_gateway, key_ibft_dns, key_net_retry, key_bootif, key_swap_size, key_ntfs_3g, key_hash, key_insecure, key_kexec, key_nisdomain, key_nomodprobe, key_device, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/global.h new/linuxrc-5.0.62/global.h --- old/linuxrc-5.0.61/global.h 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/global.h 2015-11-09 11:08:05.000000000 +0100 @@ -225,15 +225,10 @@ typedef enum { - wa_none, wa_open, wa_wep_open, wa_wep_restricted, wa_wpa + wa_none, wa_open, wa_wpa_psk, wa_wpa_peap } wlan_auth_t; -typedef enum { - kt_ascii, kt_hex, kt_pass -} key_type_t; - - typedef struct { char *str; instmode_t scheme; @@ -367,7 +362,6 @@ unsigned startshell:1; /* start shell before & after yast */ unsigned listen:1; /* listen on port */ unsigned zombies:1; /* keep zombies around */ - unsigned forceip:1; /* do not check for duplicate IP address */ unsigned mediacheck:1; /* check media */ unsigned installfilesread:1; /* already got install files */ unsigned zen; /* zenworks mode */ @@ -626,11 +620,13 @@ char *module; /* cifs/smb kernel module */ } cifs; struct { - wlan_auth_t auth; /* open, wep, wpa */ + wlan_auth_t auth; /* open, wpa_psk, wpa_peap */ char *essid; /* ESSID */ - char *key; /* wep/wpa key */ - key_type_t key_type; /* ascii, hex, passphrase */ - int key_len; /* key length in bits (40/104 for wep) */ + char *wpa_psk; /* wpa pre-shared key */ + char *wpa_identity; /* wpa peap identity */ + char *wpa_password; /* wpa peap password */ + slist_t *devices; /* list of wlan interfaces */ + unsigned devices_fixed:1; /* device list updated only via WlanDevices config option (for debugging) */ } wlan; } net; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/net.c new/linuxrc-5.0.62/net.c --- old/linuxrc-5.0.61/net.c 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/net.c 2015-11-09 11:08:05.000000000 +0100 @@ -162,7 +162,7 @@ !config.ifcfg.manual->ptp ) { sprintf(buf, "Automatic configuration via %s?", "DHCP"); - rc = dia_yesno(buf, NO); + rc = dia_yesno(buf, YES); } else { rc = NO; @@ -255,7 +255,9 @@ get_and_copy_ifcfg_flags(config.ifcfg.manual, config.ifcfg.manual->device); - ifcfg_write(config.ifcfg.manual->device, config.ifcfg.manual, 0); + if(!ifcfg_write(config.ifcfg.manual->device, config.ifcfg.manual, 0)) { + return 1; + } net_wicked_up(config.ifcfg.manual->device); @@ -749,6 +751,9 @@ } } + // only this should be used rather than all the hd_list() calls above... + update_device_list(0); + if(item_cnt == 0) { dia_message("No network device found.\n" "Load a network module first.", @@ -811,9 +816,6 @@ if(item_hds && item_hds[choice - 1]) { hd = item_hds[choice - 1]; - if(hd->is.wlan) { - if(wlan_setup()) choice = -1; - } } } @@ -1151,7 +1153,7 @@ { char file[256], *buf = NULL; window_t win; - int got_ip = 0; + int got_ip = 0, cfg_ok; ifcfg_t *ifcfg = NULL; char *device = config.ifcfg.manual->device; char *type; @@ -1170,17 +1172,6 @@ if(!strcmp(config.ifcfg.manual->type, "dhcp6")) type = "6"; } - strprintf(&buf, "Sending DHCP%s request to %s...", type, device); - fprintf(stderr, "%s\n", buf); - if(config.win) { - dia_info(&win, buf, MSGTYPE_INFO); - } - else { - printf("%s\n", buf); - fflush(stdout); - } - str_copy(&buf, NULL); - ifcfg = calloc(1, sizeof *ifcfg); ifcfg->dhcp = 1; @@ -1188,12 +1179,25 @@ ifcfg->flags = config.ifcfg.manual->flags; - ifcfg_write(device, ifcfg, 0); + cfg_ok = ifcfg_write(device, ifcfg, 0); free(ifcfg->type); free(ifcfg); ifcfg = NULL; + if(!cfg_ok) return; + + strprintf(&buf, "Sending DHCP%s request to %s...", type, device); + fprintf(stderr, "%s\n", buf); + if(config.win) { + dia_info(&win, buf, MSGTYPE_INFO); + } + else { + printf("%s\n", buf); + fflush(stdout); + } + str_copy(&buf, NULL); + net_apply_ethtool(device, NULL); net_wicked_up(device); @@ -1723,33 +1727,36 @@ dia_item_t di; dia_item_t items[] = { di_wlan_open, - di_wlan_wep_o, - di_wlan_wep_r, - di_wlan_wpa, + di_wlan_wpa_psk, + di_wlan_wpa_peap, di_none }; + if(config.manual || !config.net.wlan.essid) { + if(dia_input2("ESSID (Network Name)", &config.net.wlan.essid, 30, 0)) { + return 1; + } + } + switch(config.net.wlan.auth) { case wa_open: di = di_wlan_open; break; - case wa_wep_open: - di = di_wlan_wep_o; + case wa_wpa_psk: + di = di_wlan_wpa_psk; break; - case wa_wep_restricted: - di = di_wlan_wep_r; - break; - - case wa_wpa: - di = di_wlan_wpa; + case wa_wpa_peap: + di = di_wlan_wpa_peap; break; default: di = di_none; } + if(di_wlan_auth_last == di_none) di_wlan_auth_last = di; + if(config.manual || di == di_none) { di = dia_menu2("WLAN Authentication", 40, wlan_auth_cb, items, di_wlan_auth_last); } @@ -1771,216 +1778,51 @@ */ int wlan_auth_cb(dia_item_t di) { - int rc = 1, i, j; - char *buf = NULL, *key = NULL, *s; - int wep_mode = 0; - static char *wep_key_items[] = { - "ASCII", "HEX", "Passphrase - 40 bit", "Passphrase - 104 bit", - NULL - }; - static char *wpa_key_items[] = { - "HEX", "Passphrase", - NULL - }; - FILE *f; + int rc = 1; di_wlan_auth_last = di; - util_killall("wpa_supplicant", 15); - usleep(100000); - util_killall("wpa_supplicant", 9); - switch(di) { case di_wlan_open: config.net.wlan.auth = wa_open; - if(config.manual || !config.net.wlan.essid) { - if(dia_input2("ESSID", &config.net.wlan.essid, 30, 0)) { - rc = -1; - break; - } - } - - strprintf(&buf, "iwconfig %s essid %s'%s'", - config.net.device, - config.net.wlan.essid ? "-- " : "", - config.net.wlan.essid ?: "any" - ); - fprintf(stderr, "%s\n", buf); - system_log(buf); - - strprintf(&buf, "iwconfig %s key off", config.net.device); - fprintf(stderr, "%s\n", buf); - system_log(buf); - rc = 0; break; - case di_wlan_wep_o: - wep_mode = 1; - - case di_wlan_wep_r: - config.net.wlan.auth = wep_mode ? wa_wep_open : wa_wep_restricted; - - if(config.manual || !config.net.wlan.essid) { - if(dia_input2("ESSID", &config.net.wlan.essid, 30, 0)) { - rc = -1; - break; - } - } - - if(config.manual || !config.net.wlan.key) { - i = dia_list("WEP Key Type", 30, NULL, wep_key_items, config.net.wlan.key_type + 1, align_left) - 1; + case di_wlan_wpa_psk: + config.net.wlan.auth = wa_wpa_psk; - if(i < 0) { + if(config.manual || !config.net.wlan.wpa_psk) { + if(dia_input2("WPA Key", &config.net.wlan.wpa_psk, 30, 0)) { rc = -1; break; } - switch(i) { - case 0: - config.net.wlan.key_type = kt_ascii; - config.net.wlan.key_len = 0; - break; - - case 1: - config.net.wlan.key_type = kt_hex; - config.net.wlan.key_len = 0; - break; - - case 2: - config.net.wlan.key_type = kt_pass; - config.net.wlan.key_len = 40; - break; - - case 3: - config.net.wlan.key_type = kt_pass; - config.net.wlan.key_len = 104; - break; - } - - if(dia_input2("WEP Key", &config.net.wlan.key, 30, 0) || !config.net.wlan.key) { + if(!config.net.wlan.wpa_psk || strlen(config.net.wlan.wpa_psk) < 8) { + dia_message("Key is too short (at least 8 characters).", MSGTYPE_ERROR); rc = -1; break; } } - switch(config.net.wlan.key_type) { - case kt_ascii: - strprintf(&key, "s:%s", config.net.wlan.key); - break; - - case kt_hex: - str_copy(&key, config.net.wlan.key); - break; - - case kt_pass: - strprintf(&buf, "lwepgen%s '%s'", - config.net.wlan.key_len == 104 ? " -s" : "", - config.net.wlan.key - ); - f = popen(buf, "r"); - if(f) { - fgets(key = calloc(1, 256), 256, f); - if((s = strchr(key, '\n'))) *s = 0; - pclose(f); - if(!*key) rc = -1; - } - else { - rc = -1; - } - break; - - default: - rc = -1; - break; - } - - if(rc == -1) break; - - strprintf(&buf, "iwconfig %s essid %s'%s'", - config.net.device, - config.net.wlan.essid ? "-- " : "", - config.net.wlan.essid ?: "any" - ); - fprintf(stderr, "%s\n", buf); - system_log(buf); - - strprintf(&buf, "iwconfig %s key %s '%s'", - config.net.device, - config.net.wlan.auth == wa_wep_open ? "open" : "restricted", - key - ); - fprintf(stderr, "%s\n", buf); - system_log(buf); - rc = 0; break; - case di_wlan_wpa: - if(config.manual || !config.net.wlan.essid) { - if(dia_input2("ESSID", &config.net.wlan.essid, 30, 0)) { - rc = -1; - break; - } - } - - if(config.manual || !config.net.wlan.key) { - j = config.net.wlan.key_type == kt_pass ? 2 : 1; - - i = dia_list("WPA Key Type", 30, NULL, wpa_key_items, j, align_left); - - if(i < 1) { - rc = -1; - break; - } - - config.net.wlan.key_type = i == 1 ? kt_hex : kt_pass; - config.net.wlan.key_len = 0; + case di_wlan_wpa_peap: + config.net.wlan.auth = wa_wpa_peap; - if(dia_input2("WPA Key", &config.net.wlan.key, 30, 0) || !config.net.wlan.key) { + if(config.manual || !config.net.wlan.wpa_identity) { + if(dia_input2("WPA Identity", &config.net.wlan.wpa_identity, 30, 0)) { rc = -1; break; } - if(config.net.wlan.key_type == kt_pass && strlen(config.net.wlan.key) < 8) { - dia_message("Password is too short (must have at least 8 characters).", MSGTYPE_ERROR); + if(dia_input2("WPA Password", &config.net.wlan.wpa_password, 30, 0)) { rc = -1; break; } } - if(config.net.wlan.key_type == kt_pass) { - strprintf(&key, "\"%s\"", config.net.wlan.key); - } - else { - str_copy(&key, config.net.wlan.key); - } - - f = fopen("/tmp/wpa_supplicant.conf", "w"); - if(!f) { - rc = -1; - break; - } - fprintf(f, - "ap_scan=1\n" - "network={\n" - " key_mgmt=WPA-PSK\n" - " scan_ssid=1\n" - " ssid=\"%s\"\n" - " psk=%s\n" - "}\n", - config.net.wlan.essid, - key - ); - fclose(f); - - strprintf(&buf, "wpa_supplicant -B -Dwext -i%s -c/tmp/wpa_supplicant.conf", - config.net.device - ); - fprintf(stderr, "%s\n", buf); - system_log(buf); - rc = 0; break; @@ -1988,9 +1830,6 @@ break; } - free(buf); - free(key); - return rc; } @@ -2179,7 +2018,7 @@ char *ns = NULL; // allocated char *domain = NULL; // allocated char *vlan = NULL; // allocated - int is_dhcp = 0; + int is_dhcp = 0, ok = 0; slist_t *sl, *sl2; slist_t *sl_ifcfg = NULL; slist_t *sl_ifroute = NULL; @@ -2196,7 +2035,7 @@ sleep(60); - return 0; + return ok; } fprintf(stderr, "ifcfg_write: device = %s, ifcfg = %s\n", device, ifcfg ? ifcfg->device : ""); @@ -2319,9 +2158,41 @@ } // set hostname, if requested - if(config.net.sethostname && !slist_getentry(sl_ifcfg, "DHCLIENT_SET_HOSTNAME")) { - sl2 = slist_append_str(&sl_ifcfg, "DHCLIENT_SET_HOSTNAME"); - str_copy(&sl2->value, "yes"); + if(config.net.sethostname) { + slist_setentry(&sl_ifcfg, "DHCLIENT_SET_HOSTNAME", "yes", 0); + } + + // add wlan options, if necessary + if(util_is_wlan(device)) { + // ask for missing wifi parameters; abort of user pressed ESC + if(wlan_setup()) goto err; + + if(config.net.wlan.essid) { + slist_setentry(&sl_ifcfg, "WIRELESS_ESSID", config.net.wlan.essid, 0); + } + + switch(config.net.wlan.auth) { + case wa_open: + slist_setentry(&sl_ifcfg, "WIRELESS_AUTH_MODE", "open", 0); + break; + + case wa_wpa_psk: + slist_setentry(&sl_ifcfg, "WIRELESS_AUTH_MODE", "psk", 0); + slist_setentry(&sl_ifcfg, "WIRELESS_WPA_PSK", config.net.wlan.wpa_psk, 0); + break; + + case wa_wpa_peap: + slist_setentry(&sl_ifcfg, "WIRELESS_AUTH_MODE", "eap", 0); + slist_setentry(&sl_ifcfg, "WIRELESS_EAP_MODE", "PEAP", 0); + // seems not to be necessary + // slist_setentry(&sl_ifcfg, "WIRELESS_EAP_AUTH", "mschapv2", 0); + slist_setentry(&sl_ifcfg, "WIRELESS_WPA_IDENTITY", config.net.wlan.wpa_identity, 0); + slist_setentry(&sl_ifcfg, "WIRELESS_WPA_PASSWORD", config.net.wlan.wpa_password, 0); + break; + + default: + break; + } } #if defined(__s390__) || defined(__s390x__) @@ -2459,6 +2330,10 @@ } } + ok = 1; + +err: + str_copy(&gw, NULL); str_copy(&ns, NULL); str_copy(&domain, NULL); @@ -2469,7 +2344,7 @@ slist_free(sl_ifcfg); slist_free(sl_ifroute); - return 1; + return ok; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/url.c new/linuxrc-5.0.62/url.c --- old/linuxrc-5.0.61/url.c 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/url.c 2015-11-09 11:08:05.000000000 +0100 @@ -1428,7 +1428,7 @@ str_copy(&url->used.model, hd->model); } - url->is.wlan = hd->is.wlan; + if(hd->is.wlan) util_set_wlan(hd->unix_dev_name); if((ok = url_mount_disk(url, dir, test_func))) { found++; @@ -2030,7 +2030,7 @@ str_copy(&url->used.hwaddr, hwaddr); str_copy(&url->used.model, hd->model); - url->is.wlan = hd->is.wlan; + if(hd->is.wlan) util_set_wlan(hd->unix_dev_name); url_setup_device(url); @@ -2506,8 +2506,6 @@ fprintf(stderr, "interface setup: %s\n", config.ifcfg.manual->device); - if(url->is.wlan && wlan_setup()) return 0; - if((config.net.do_setup & DS_SETUP)) auto2_user_netconfig(); if(!config.ifcfg.if_up) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/util.c new/linuxrc-5.0.62/util.c --- old/linuxrc-5.0.61/util.c 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/util.c 2015-11-09 11:08:05.000000000 +0100 @@ -1358,8 +1358,18 @@ slist_append_str(&sl0, buf); } + if(config.net.wlan.devices) { + sprintf(buf, "wlan interfaces%s:", config.net.wlan.devices_fixed ? " (fixed)" : ""); + slist_append_str(&sl0, buf); + for(sl = config.net.wlan.devices; sl; sl = sl->next) { + if(!sl->key) continue; + sprintf(buf, " %s", sl->key); + slist_append_str(&sl0, buf); + } + } + if(config.net.wlan.auth) { - static char *wlan_a[] = { "", "open", "wep open", "wep restricted", "wpa" }; + static char *wlan_a[] = { "", "open", "wpa psk", "wpa eap" }; sprintf(buf, "wlan auth = %d (%s)", config.net.wlan.auth, wlan_a[config.net.wlan.auth < sizeof wlan_a / sizeof *wlan_a ? config.net.wlan.auth : 0] @@ -1372,14 +1382,18 @@ slist_append_str(&sl0, buf); } - if(config.net.wlan.key) { - sprintf(buf, "wlan key = \"%s\", type %d", - config.net.wlan.key, - config.net.wlan.key_type - ); - if(config.net.wlan.key_len) { - sprintf(buf + strlen(buf), ", len %d)", config.net.wlan.key_len); - } + if(config.net.wlan.wpa_psk) { + sprintf(buf, "wlan psk = \"%s\"", config.net.wlan.wpa_psk); + slist_append_str(&sl0, buf); + } + + if(config.net.wlan.wpa_identity) { + sprintf(buf, "wlan eap id = \"%s\"", config.net.wlan.wpa_identity); + slist_append_str(&sl0, buf); + } + + if(config.net.wlan.wpa_password) { + sprintf(buf, "wlan eap pass = \"%s\"", config.net.wlan.wpa_password); slist_append_str(&sl0, buf); } @@ -2168,7 +2182,7 @@ } -slist_t *slist_append_str(slist_t **sl0, char *str) +slist_t *slist_append_str(slist_t **sl0, char *str) { slist_t *sl; @@ -2186,6 +2200,31 @@ } +/* + * Append key - value pair to list. + * + * If replace is 0, it will not update an existing entry (like setenv()). + */ +slist_t *slist_setentry(slist_t **sl0, char *key, char *value, int replace) +{ + slist_t *sl; + + sl = slist_getentry(*sl0, key); + + if(sl) { + if(!replace) return sl; + } + else { + sl = slist_append(sl0, slist_new()); + str_copy(&sl->key, key); + } + + str_copy(&sl->value, value); + + return sl; +} + + slist_t *slist_assign_values(slist_t **sl0, char *str) { int todo = 0; @@ -3860,6 +3899,9 @@ { static time_t last_time; struct stat sbuf; + hd_t *hd, *net_list; + + fprintf(stderr, "update_device_list(%d)\n", force); hd_hw_item_t hw_items[] = { hw_block, hw_network_ctrl, hw_network, 0 @@ -3887,6 +3929,13 @@ config.hd_data = calloc(1, sizeof *config.hd_data); fix_device_names(hd_list2(config.hd_data, hw_items, 1)); + + // update wlan interface list + net_list = hd_list(config.hd_data, hw_network_ctrl, 0, NULL); + for(hd = net_list; hd; hd = hd->next) { + if(hd->is.wlan) util_set_wlan(hd->unix_dev_name); + } + hd_free_hd_list(net_list); } @@ -5253,3 +5302,23 @@ dia_message("Sorry, system didn't boot.", MSGTYPE_ERROR); } + +/* + * Remember that device is a wlan interface. + */ +void util_set_wlan(char *device) +{ + if(!device || config.net.wlan.devices_fixed) return; + + slist_setentry(&config.net.wlan.devices, device, NULL, 0); +} + + +/* + * Return 1 if device is a wlan interface. + */ +int util_is_wlan(char *device) +{ + return slist_getentry(config.net.wlan.devices, device) ? 1 : 0; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.61/util.h new/linuxrc-5.0.62/util.h --- old/linuxrc-5.0.61/util.h 2015-10-21 13:56:31.000000000 +0200 +++ new/linuxrc-5.0.62/util.h 2015-11-09 11:08:05.000000000 +0100 @@ -56,6 +56,7 @@ slist_t *slist_append(slist_t **sl0, slist_t *sl); slist_t *slist_append_str(slist_t **sl0, char *str); slist_t *slist_add(slist_t **sl0, slist_t *sl); +slist_t *slist_setentry(slist_t **sl0, char *key, char *value, int replace); slist_t *slist_assign_values(slist_t **sl0, char *str); slist_t *slist_getentry(slist_t *sl, char *key); slist_t *slist_reverse(slist_t *sl0); @@ -160,3 +161,6 @@ void util_boot_system(void); +void util_set_wlan(char *device); +int util_is_wlan(char *device); +
