Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2014-07-21 10:35:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2014-07-18 06:40:28.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2014-07-21 10:35:30.000000000 +0200 @@ -1,0 +2,11 @@ +Fri Jul 18 15:28:15 CEST 2014 - snw...@suse.de + +- continue network code reworking: +- fix network re-config (bnc #887841) +- move network setup into separate menu item +- move various net_activate_s390_devs() calls into a single place +- unify network config code +- remove obsolete code +- 5.0.1 + +------------------------------------------------------------------- Old: ---- linuxrc-5.0.0.tar.xz New: ---- linuxrc-5.0.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.zQNYfl/_old 2014-07-21 10:35:31.000000000 +0200 +++ /var/tmp/diff_new_pack.zQNYfl/_new 2014-07-21 10:35:31.000000000 +0200 @@ -25,9 +25,9 @@ Summary: SUSE Installation Program License: GPL-3.0+ Group: System/Boot -Version: 5.0.0 +Version: 5.0.1 Release: 0 -Source: linuxrc-5.0.0.tar.xz +Source: linuxrc-5.0.1.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build %description ++++++ linuxrc-5.0.0.tar.xz -> linuxrc-5.0.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/VERSION new/linuxrc-5.0.1/VERSION --- old/linuxrc-5.0.0/VERSION 2014-07-17 10:52:44.000000000 +0200 +++ new/linuxrc-5.0.1/VERSION 2014-07-18 15:28:06.000000000 +0200 @@ -1 +1 @@ -5.0.0 +5.0.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/auto2.c new/linuxrc-5.0.1/auto2.c --- old/linuxrc-5.0.0/auto2.c 2014-07-10 11:08:53.000000000 +0200 +++ new/linuxrc-5.0.1/auto2.c 2014-07-18 14:54:13.000000000 +0200 @@ -356,11 +356,6 @@ printf("Reading info file: %s\n", sl->key); fflush(stdout); url = url_set(sl->key); -#if defined(__s390__) || defined(__s390x__) - if(url->is.network && !config.net.configured) { - net_activate_s390_devs(); - } -#endif err = url_read_file_anywhere(url, NULL, NULL, "/download/info", NULL, URL_FLAG_PROGRESS + URL_FLAG_NODIGEST); url_umount(url); url_free(url); @@ -382,9 +377,6 @@ printf("Downloading AutoYaST file: %s\n", config.autoyast2); fflush(stdout); } -#if defined(__s390__) || defined(__s390x__) - if(url->is.network && !config.net.configured) net_activate_s390_devs(); -#endif err = url_read_file_anywhere(url, NULL, NULL, "/download/autoyast.xml", NULL, URL_FLAG_PROGRESS + URL_FLAG_NODIGEST); url_umount(url); url_free(url); @@ -424,11 +416,6 @@ strprintf(&path2, "%s%sdriverupdate", path1, path1[0] == 0 || path1[strlen(path1) - 1] == '/' ? "" : "/"); -#if defined(__s390__) || defined(__s390x__) - if(url->is.network && !config.net.configured) { - net_activate_s390_devs(); - } -#endif err = url_read_file_anywhere( url, NULL, NULL, file_name, NULL, URL_FLAG_NODIGEST + URL_FLAG_PROGRESS + (config.secure ? URL_FLAG_CHECK_SIG : 0) @@ -608,11 +595,7 @@ */ void auto2_user_netconfig() { - slist_t *sl; - - if(!config.net.do_setup) return; - - if(config.ifcfg.if_up) return; + if(!net_config_needed(0)) return; check_ptp(); @@ -632,37 +615,12 @@ } if(config.net.configured == nc_none || config.net.do_setup) { - if(config.net.all_ifs && (config.net.setup & NS_DHCP)) { - util_update_netdevice_list(NULL, 1); - - config.net.configured = nc_none; + int win_old, maybe_interactive; - for(sl = config.net.devices; sl && config.net.configured == nc_none; sl = sl->next) { - str_copy(&config.net.device, sl->key); - - net_dhcp(); - - if(config.net.dhcp_active) { - config.net.configured = nc_dhcp; - - if(net_activate_ns()) { - fprintf(stderr, "%s: net activation failed\n", config.net.device); - config.net.configured = nc_none; - } - else { - fprintf(stderr, "%s: ok\n", config.net.device); - } - } - } - } - else { - int win_old, maybe_interactive; - - maybe_interactive = config.net.setup != NS_DHCP; - if(!(win_old = config.win) && maybe_interactive) util_disp_init(); - net_config(); - if(!win_old && maybe_interactive) util_disp_done(); - } + maybe_interactive = config.net.setup != NS_DHCP; + if(!(win_old = config.win) && maybe_interactive) util_disp_init(); + net_config(); + if(!win_old && maybe_interactive) util_disp_done(); } if(config.net.configured == nc_none) { @@ -1253,4 +1211,3 @@ return err; } - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/changelog new/linuxrc-5.0.1/changelog --- old/linuxrc-5.0.0/changelog 2014-07-17 10:52:46.000000000 +0200 +++ new/linuxrc-5.0.1/changelog 2014-07-18 15:28:08.000000000 +0200 @@ -1,3 +1,11 @@ +2014-07-18: HEAD + - continue network code reworking + - fix network re-config (bnc #887841) + - move network setup into separate menu item + - move various net_activate_s390_devs() calls into a single place + - unify network config code + - remove obsolete code + 2014-07-17: 5.0.0 - fix proxy handling in linuxrc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/dialog.c new/linuxrc-5.0.1/dialog.c --- old/linuxrc-5.0.0/dialog.c 2014-07-08 14:15:33.000000000 +0200 +++ new/linuxrc-5.0.1/dialog.c 2014-07-18 13:31:20.000000000 +0200 @@ -63,8 +63,7 @@ { di_inst_update, "Upgrade", }, { di_inst_rescue, "Rescue System", }, { di_inst_system, "Boot Installed System", }, - { di_inst_update_add, "Add Driver Update", }, - { di_inst_update_show, "Show Driver Updates", }, + { di_inst_net_config, "Network Setup", }, { di_source_cdrom, "DVD / CD-ROM", }, { di_source_net, "Network", }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/dialog.h new/linuxrc-5.0.1/dialog.h --- old/linuxrc-5.0.0/dialog.h 2014-06-23 12:50:51.000000000 +0200 +++ new/linuxrc-5.0.1/dialog.h 2014-07-18 13:31:12.000000000 +0200 @@ -49,8 +49,7 @@ di_inst_update, di_inst_rescue, di_inst_system, - di_inst_update_add, - di_inst_update_show, + di_inst_net_config, di_source_cdrom, di_source_net, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/file.c new/linuxrc-5.0.1/file.c --- old/linuxrc-5.0.0/file.c 2014-07-17 10:51:20.000000000 +0200 +++ new/linuxrc-5.0.1/file.c 2014-07-18 14:19:48.000000000 +0200 @@ -1112,7 +1112,6 @@ else if(!strcmp(s, "hostip")) i = NS_HOSTIP; else if(!strcmp(s, "netmask")) i = NS_NETMASK; else if(!strcmp(s, "gateway")) i = NS_GATEWAY; - else if(!strcmp(s, "all")) i = NS_ALLIFS; #if defined(__s390__) || defined(__s390x__) else if(!strcmp(s, "display")) i = NS_DISPLAY; #endif @@ -1132,10 +1131,7 @@ sizeof config.net.nameserver / sizeof *config.net.nameserver : u; } - if(i == NS_ALLIFS) { - config.net.all_ifs = *sl->key == '-' ? 0 : 1; - } - else if(i == NS_NOW) { + if(i == NS_NOW) { config.net.now = *sl->key == '-' ? 0 : 1; } else if(i) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/global.h new/linuxrc-5.0.1/global.h --- old/linuxrc-5.0.0/global.h 2014-07-10 10:58:35.000000000 +0200 +++ new/linuxrc-5.0.1/global.h 2014-07-18 14:19:00.000000000 +0200 @@ -305,7 +305,6 @@ #define NS_NETMASK (1 << 3) #define NS_GATEWAY (1 << 4) #define NS_NAMESERVER (1 << 5) -#define NS_ALLIFS (1 << 6) #define NS_DISPLAY (1 << 7) // #define NS_DHCP6 (1 << 8) #define NS_NOW (1 << 9) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/install.c new/linuxrc-5.0.1/install.c --- old/linuxrc-5.0.0/install.c 2014-06-23 12:54:47.000000000 +0200 +++ new/linuxrc-5.0.1/install.c 2014-07-18 14:54:06.000000000 +0200 @@ -92,6 +92,7 @@ di_inst_update, di_inst_rescue, di_inst_system, + di_inst_net_config, di_none }; @@ -143,6 +144,11 @@ err = root_boot_system(); break; + case di_inst_net_config: + net_config(); + err = 1; + break; + default: break; } @@ -637,7 +643,7 @@ int err = 0; char *device = NULL; - if(config.net.do_setup && net_config()) return 1; + if(net_config_needed(0) && net_config()) return 1; if( config.url.install && @@ -671,7 +677,7 @@ int err = 0; char *device = NULL, *path = NULL; - if(config.net.do_setup && net_config()) return 1; + if(net_config_needed(0) && net_config()) return 1; if( config.url.install && @@ -726,7 +732,7 @@ inet_t server = {}, proxy = {}; /* setup network */ - if(net_config()) return 1; + if(net_config_needed(1) && net_config()) return 1; /* get current values */ if(config.url.install) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/linuxrc.c new/linuxrc-5.0.1/linuxrc.c --- old/linuxrc-5.0.0/linuxrc.c 2014-07-16 16:00:50.000000000 +0200 +++ new/linuxrc-5.0.1/linuxrc.c 2014-07-18 13:24:59.000000000 +0200 @@ -512,7 +512,7 @@ static char *progs[] = { "portmap", "rpciod", "lockd", "cifsd", "mount.smbfs", "udevd", "mount.ntfs-3g", "brld", "sbl", "wickedd", "wickedd-auto4", "wickedd-dhcp4", - "wickedd-dhcp6", "dbus-daemon", "rpc.idmapd", "sh", "haveged" + "wickedd-dhcp6", "wickedd-nanny", "dbus-daemon", "rpc.idmapd", "sh", "haveged" }; int i; @@ -1158,7 +1158,7 @@ strprintf(&buf, "%s\n\nRetry?", s ?: "Please make sure your installation medium is available."); do { - j = dia_okcancel(buf, YES) == YES ? 1 : 0; + j = dia_yesno(buf, YES) == YES ? 1 : 0; if(j) { slist_t *sl; config.manual = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/net.c new/linuxrc-5.0.1/net.c --- old/linuxrc-5.0.0/net.c 2014-07-16 15:53:05.000000000 +0200 +++ new/linuxrc-5.0.1/net.c 2014-07-18 15:17:19.000000000 +0200 @@ -52,7 +52,6 @@ static int net_activate4(void); static int net_activate6(void); #if defined(__s390__) || defined(__s390x__) -int net_activate_s390_devs(void); int net_activate_s390_devs_ex(hd_t* hd, char** device); #endif static void net_setup_nameserver(void); @@ -64,7 +63,7 @@ static dia_item_t di_wlan_auth_last = di_none; static int parse_leaseinfo(char *file); -static int net_wicked_dhcp(void); +static void net_wicked_dhcp(void); static void net_cifs_build_options(char **options, char *user, char *password, char *workgroup); static void net_ask_domain(void); @@ -171,14 +170,15 @@ int rc = 0; char buf[256]; - if(!config.win && !config.manual && config.ifcfg.if_up) return 0; + if(!config.win && !config.manual) return 0; + // really here? net_ask_password(); if( config.win && - config.net.is_configured && - (!config.manual || dia_yesno("Your network is already configured. Keep this configuration?", YES) == YES) + config.ifcfg.if_up && + (!config.manual || dia_yesno("Your network is already configured. Keep this configuration?", YES) != NO) ) { return 0; } @@ -231,136 +231,6 @@ } -static void net_config2_manual(void); - - -/* - * Configure network interface. Ask for network config data if necessary. - * Does either DHCP, BOOTP or static network setup. - * - * config.net.device: network interface - * - * Return: - * 0: ok - * != 0: error or abort - * - * config.net.is_configured: nc_none, nc_dhcp, nc_static - * - * Does nothing if DHCP is active. - * - */ -int net_config2(int type) -{ - config.net.configured = nc_none; - - // ###### FIXME: use net_choose_device() - if(!config.net.device) str_copy(&config.net.device, config.netdevice); - if(!config.net.device) { - util_update_netdevice_list(NULL, 1); - if(config.net.devices) str_copy(&config.net.device, config.net.devices->key); - } - - if(!config.net.device) { - fprintf(stderr, "interface setup: no interfaces\n"); - return 1; - } - - fprintf(stderr, "interface setup: %s\n", config.net.device); - -// if(url->is.wlan && wlan_setup()) return 0; - - if((config.net.do_setup & DS_SETUP)) net_config2_manual(); - - if(config.net.configured == nc_none) config.net.configured = nc_static; - - /* we need at least ip & netmask for static network config */ - if((net_config_mask() & 3) != 3) { - net_dhcp(); - - if(!config.net.dhcp_active) { - config.net.configured = nc_none; - return 0; - } - - config.net.configured = nc_dhcp; - } - - if(net_activate_ns()) { - fprintf(stderr, "network setup failed\n"); - config.net.configured = nc_none; - - return 0; - } - else { - fprintf(stderr, "%s activated\n", config.net.device); - } - - - - - - return 0; -} - - -void net_config2_manual() -{ - int win_old; - slist_t *sl; - - if(!config.net.do_setup) return; - - if((net_config_mask() & 3) == 3) { /* we have ip & netmask */ - config.net.configured = nc_static; - /* looks a bit weird, but we need it here for net_activate_ns() */ - if(!config.net.device) str_copy(&config.net.device, config.netdevice); - if(!config.net.device) { - util_update_netdevice_list(NULL, 1); - if(config.net.devices) str_copy(&config.net.device, config.net.devices->key); - } - if(net_activate_ns()) { - fprintf(stderr, "net activation failed\n"); - config.net.configured = nc_none; - } - } - - if(config.net.configured == nc_none || config.net.do_setup) { - if(config.net.all_ifs && (config.net.setup & NS_DHCP)) { - util_update_netdevice_list(NULL, 1); - - config.net.configured = nc_none; - - for(sl = config.net.devices; sl && config.net.configured == nc_none; sl = sl->next) { - str_copy(&config.net.device, sl->key); - - net_dhcp(); - - if(config.net.dhcp_active) { - config.net.configured = nc_dhcp; - - if(net_activate_ns()) { - fprintf(stderr, "%s: net activation failed\n", config.net.device); - config.net.configured = nc_none; - } - else { - fprintf(stderr, "%s: ok\n", config.net.device); - } - } - } - } - else { - if(!(win_old = config.win)) util_disp_init(); - net_config(); - if(!win_old) util_disp_done(); - } - } - - if(config.net.configured == nc_none) { - config.vnc = config.usessh = 0; - } -} - - /* * Shut down all network interfaces. * @@ -1689,27 +1559,25 @@ * config.net.nisdomain * config.net.nameserver */ -int net_wicked_dhcp() +void net_wicked_dhcp() { char file[256], *buf = NULL; window_t win; - int got_ip = 0, i, rc; + int got_ip = 0; ifcfg_t *ifcfg = NULL; - if(config.net.dhcp_active) return 0; - if(config.test) { config.net.dhcp_active = 1; - return 0; + return; } strprintf(&buf, "Sending DHCP%s request to %s...", net_dhcp_type(), config.net.device); + fprintf(stderr, "%s\n", buf); if(config.win) { dia_info(&win, buf, MSGTYPE_INFO); } else { - fprintf(stderr, "%s\n", buf); printf("%s\n", buf); fflush(stdout); } @@ -1731,17 +1599,15 @@ if(config.net.ipv4) { snprintf(file, sizeof file, "/run/wicked/leaseinfo.%s.dhcp.ipv4", config.net.device); - got_ip = parse_leaseinfo(file); + parse_leaseinfo(file); } if(!got_ip && config.net.ipv6) { snprintf(file, sizeof file, "/run/wicked/leaseinfo.%s.dhcp.ipv6", config.net.device); - got_ip = parse_leaseinfo(file); + parse_leaseinfo(file); } - net_update_state(); - - if(slist_getentry(config.ifcfg.if_up, config.net.device)) got_ip |= 1; + if(slist_getentry(config.ifcfg.if_up, config.net.device)) got_ip = 1; if(config.win) win_close(&win); @@ -1750,21 +1616,10 @@ if(config.net.ifup_wait) sleep(config.net.ifup_wait); } else { - if(config.win) { - if(config.net.dhcpfail && strcmp(config.net.dhcpfail, "ignore")) { - if(!strcmp(config.net.dhcpfail, "show")) { - dia_info(&win, "DHCP configuration failed.", MSGTYPE_ERROR); - sleep(4); - win_close(&win); - } - else if(!strcmp(config.net.dhcpfail, "manual")) { - i = dia_yesno("DHCP configuration failed.", NO); - if(i == YES) { - // is_static = 1; - // ????? - } - } - } + if(config.win && config.net.dhcpfail && !strcmp(config.net.dhcpfail, "show")) { + dia_info(&win, "DHCP configuration failed.", MSGTYPE_ERROR); + sleep(4); + win_close(&win); } } @@ -1782,18 +1637,14 @@ } fprintf(stderr, "%s\n", buf); - printf("%s\n", buf); + if(!config.win) printf("%s\n", buf); str_copy(&buf, NULL); } else { fprintf(stderr, "no/incomplete answer.\n"); - printf("no/incomplete answer.\n"); + if(!config.win) printf("no/incomplete answer.\n"); } - - rc = config.net.dhcp_active ? 0 : 1; - - return rc; } @@ -1907,7 +1758,7 @@ return 0; } -int net_activate_s390_devs(void) +int net_activate_s390_devs() { return net_activate_s390_devs_ex(NULL, NULL); } @@ -3142,6 +2993,10 @@ system(buf); + sleep(1); + + net_update_state(); + str_copy(&buf, NULL); } @@ -3159,6 +3014,10 @@ system(buf); + sleep(1); + + net_update_state(); + str_copy(&buf, NULL); } @@ -3207,3 +3066,20 @@ return prefix; } + +/* + * Check whether a network setup is necessary. + * + * That is: we need a network but no interface is up. + * + * We need a network if really or config.net.do_setup is set. + */ +int net_config_needed(int really) +{ + if(!(config.net.do_setup || really)) return 0; + + net_update_state(); + + return config.ifcfg.if_up ? 0 : 1; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/net.h new/linuxrc-5.0.1/net.h --- old/linuxrc-5.0.0/net.h 2014-07-16 15:34:06.000000000 +0200 +++ new/linuxrc-5.0.1/net.h 2014-07-18 14:51:03.000000000 +0200 @@ -30,3 +30,4 @@ void net_wicked_up(char *ifname); void net_wicked_down(char *ifname); int netmask_to_prefix(char *netmask); +int net_config_needed(int really); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/settings.c new/linuxrc-5.0.1/settings.c --- old/linuxrc-5.0.0/settings.c 2014-07-08 14:15:50.000000000 +0200 +++ new/linuxrc-5.0.1/settings.c 2014-07-18 14:58:57.000000000 +0200 @@ -247,6 +247,7 @@ di_set_usessh, di_set_startshell, di_set_slp, + di_inst_net_config, di_none }; @@ -340,6 +341,10 @@ break; case di_set_slp: + if(net_config_needed(1) && net_config()) { + rc = 1; + break; + } url = url_set("slp:"); s = slp_get_install(url); url_free(url); @@ -359,6 +364,11 @@ rc = 1; break; + case di_inst_net_config: + net_config(); + rc = 1; + break; + default: break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/url.c new/linuxrc-5.0.1/url.c --- old/linuxrc-5.0.0/url.c 2014-07-17 10:38:29.000000000 +0200 +++ new/linuxrc-5.0.1/url.c 2014-07-18 14:03:11.000000000 +0200 @@ -1787,6 +1787,10 @@ } else { +#if defined(__s390__) || defined(__s390x__) + net_activate_s390_devs(); +#endif + update_device_list(0); LXRC_WAIT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.0/util.c new/linuxrc-5.0.1/util.c --- old/linuxrc-5.0.0/util.c 2014-07-16 14:05:38.000000000 +0200 +++ new/linuxrc-5.0.1/util.c 2014-07-18 15:09:02.000000000 +0200 @@ -1168,7 +1168,6 @@ add_flag(&sl0, buf, config.textmode, "textmode"); add_flag(&sl0, buf, config.rebootmsg, "rebootmsg"); add_flag(&sl0, buf, config.nopcmcia, "nopcmcia"); - add_flag(&sl0, buf, config.net.dhcp_active, "dhcp_active"); add_flag(&sl0, buf, config.use_ramdisk, "ramdisk"); add_flag(&sl0, buf, config.ask_language, "ask_lang"); add_flag(&sl0, buf, config.ask_keytable, "ask_keytbl"); -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org