Hello community, here is the log from the commit of package linuxrc for openSUSE:Factory checked in at 2016-05-23 16:36:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2016-05-02 10:43:37.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes 2016-05-23 16:36:20.000000000 +0200 @@ -1,0 +2,27 @@ +Wed May 18 09:55:14 UTC 2016 - snwint@suse.com + +- activate AutoUpgrade if Upgrade + AutoYaST are set (bsc#978252) +- 5.0.81 + +------------------------------------------------------------------- +Wed May 18 09:35:17 UTC 2016 - snwint@suse.com + +- Removed unnecessary definition for win +- Converted multiple dialog calls to one +- Added definition for win variable used by dia_info +- Updated the copyright information that is displayed on the console. +- 5.0.80 + +------------------------------------------------------------------- +Tue May 17 13:30:17 UTC 2016 - snwint@suse.com + +- ensure the correct interfaces are (de-)activated when using vlan tagging (bsc#971166) +- 5.0.79 + +------------------------------------------------------------------- +Tue May 17 12:50:17 UTC 2016 - snwint@suse.com + +- sanitize hostname handling (fate#319639) +- 5.0.78 + +------------------------------------------------------------------- Old: ---- linuxrc-5.0.77.tar.xz New: ---- linuxrc-5.0.81.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ linuxrc.spec ++++++ --- /var/tmp/diff_new_pack.cfUyC1/_old 2016-05-23 16:36:21.000000000 +0200 +++ /var/tmp/diff_new_pack.cfUyC1/_new 2016-05-23 16:36:21.000000000 +0200 @@ -25,7 +25,7 @@ Summary: SUSE Installation Program License: GPL-3.0+ Group: System/Boot -Version: 5.0.77 +Version: 5.0.81 Release: 0 Source: %{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ linuxrc-5.0.77.tar.xz -> linuxrc-5.0.81.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/VERSION new/linuxrc-5.0.81/VERSION --- old/linuxrc-5.0.77/VERSION 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/VERSION 2016-05-18 11:50:57.000000000 +0200 @@ -1 +1 @@ -5.0.77 +5.0.81 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/changelog new/linuxrc-5.0.81/changelog --- old/linuxrc-5.0.77/changelog 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/changelog 2016-05-18 11:50:57.000000000 +0200 @@ -1,3 +1,18 @@ +2016-05-18: 5.0.81 + - activate AutoUpgrade if Upgrade + AutoYaST are set (bsc #978252) + +2016-05-09: 5.0.80 + - Removed unnecessary definition for win + - Converted multiple dialog calls to one + - Added definition for win variable used by dia_info + - Updated the copyright information that is displayed on the console. + +2016-05-02: 5.0.79 + - ensure the correct interfaces are (de-)activated when using vlan tagging (bsc #971166) + +2016-05-04: 5.0.78 + - sanitize hostname handling (fate #319639) + 2016-04-25: 5.0.77 - remove O_TMPFILE workaround needed for bsc #964709 and bsc #965068 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/file.c new/linuxrc-5.0.81/file.c --- old/linuxrc-5.0.77/file.c 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/file.c 2016-05-18 11:50:57.000000000 +0200 @@ -1895,13 +1895,6 @@ if(config.net.realhostname) { file_write_str(f, key_hostname, config.net.realhostname); } - else { - char buf[256]; - if(!gethostname(buf, sizeof buf)) { - log_debug("hostname = \"%s\"\n", buf); - if(*buf && strcmp(buf, "(none)")) file_write_str(f, key_hostname, buf); - } - } LXRC_WAIT @@ -1914,6 +1907,14 @@ file_write_num(f, key_yast2update, config.update.ask || config.update.count ? 1 : 0); file_write_num(f, key_textmode, config.textmode); file_write_str(f, key_autoyast, config.autoyast); + /* + * autoyast + upgrade = autoupgrade + * + * autoyast uses a different config var to trigger updates for historical reasons + */ + if(config.autoyast && config.upgrade) { + fprintf(f, "AutoUpgrade: 1\n"); + } file_write_num(f, key_memfree, config.memoryXXX.current >> 10); // convention: in kB file_write_num(f, key_vnc, config.vnc); file_write_str(f, key_vncpassword, config.net.vncpassword); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/install.c new/linuxrc-5.0.81/install.c --- old/linuxrc-5.0.77/install.c 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/install.c 2016-05-18 11:50:57.000000000 +0200 @@ -1113,6 +1113,9 @@ if(inst_choose_source()) err = 1; } + /* if the user specified a hostname, set it */ + util_set_hostname(config.net.realhostname); + if(! err && config.rescue) { /* get rid of repo */ url_umount(config.url.install); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/linuxrc.c new/linuxrc-5.0.81/linuxrc.c --- old/linuxrc-5.0.77/linuxrc.c 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/linuxrc.c 2016-05-18 11:50:57.000000000 +0200 @@ -383,6 +383,9 @@ if(config.net.sshpassword) setenv("SSHPASSWORD", config.net.sshpassword, 1); if(config.net.sshpassword_enc) setenv("SSHPASSWORDENC", config.net.sshpassword_enc, 1); + /* change hostname from 'install' to 'rescue' unless we've had something better */ + if(!config.net.realhostname) util_set_hostname("rescue"); + lxrc_run_console("/mounts/initrd/scripts/prepare_rescue"); LXRC_WAIT @@ -773,6 +776,7 @@ config.net.ipv6 = 1; config.net.setup = NS_DHCP; /* unless we are told otherwise just go for dhcp */ config.net.nameservers = 1; + config.net.sethostname = 1; /* let wicked set hostname */ config.explode_win = 1; config.color = 2; @@ -855,6 +859,8 @@ config.initrd_has_ldso = 1; #endif + util_set_hostname("install"); + // read config from initrd: // - /linuxrc.config // - /etc/linuxrc.d/* @@ -881,7 +887,7 @@ if (config.linemode) putchar('\n'); printf( - "\n>>> %s installation program v" LXRC_FULL_VERSION " (c) 1996-2015 SUSE LLC <<<\n", + "\n>>> %s installation program v" LXRC_FULL_VERSION " (c) 1996-2016 SUSE LLC <<<\n", config.product ); if (config.linemode) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/linuxrc_hostname.md new/linuxrc-5.0.81/linuxrc_hostname.md --- old/linuxrc-5.0.77/linuxrc_hostname.md 1970-01-01 01:00:00.000000000 +0100 +++ new/linuxrc-5.0.81/linuxrc_hostname.md 2016-05-18 11:50:57.000000000 +0200 @@ -0,0 +1,31 @@ +#hostname setting in installation/rescue system + +There are 3 cases: + +1. no hostname is set + +2. hostname is set via dhcp (either from HOSTNAME or FQDN) + +3. hostname is set via `hostname` boot option + +linuxrc defaults to `install`, which may be overridden by dhcp (2) or user +(3). (3) takes precedence over (2). + +##installation system + +When yast is started, the value from (3) is passed to yast via +`/etc/install.inf::Hostname` and ends up in `/etc/hostname` of the installed system. + +When linuxrc doesn't set `/etc/install.inf::Hostname` yast generates a +default `/etc/hostname` entry of the form `linux-XXXX` (+ `.suse` in sle12). +`XXXX` is some random part. + +There is no `/etc/hostname` file in the installation environment. + +##rescue system + +linuxrc changes the hostname to `rescue`, which may be overridden by user (3). + +This value is put into `/etc/hostname` of the rescue system. The value there may later +be overridden by dhcp (2). + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/linuxrc_yast_interface.txt new/linuxrc-5.0.81/linuxrc_yast_interface.txt --- old/linuxrc-5.0.77/linuxrc_yast_interface.txt 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/linuxrc_yast_interface.txt 2016-05-18 11:50:57.000000000 +0200 @@ -127,7 +127,7 @@ # else the entry is missing ProxyURL: %s -# the hostname as set by dhcp or by 'hostname=foo' boot option +# the hostname as set by 'hostname=foo' boot option # entry is missing if unset Hostname: %s diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/net.c new/linuxrc-5.0.81/net.c --- old/linuxrc-5.0.77/net.c 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/net.c 2016-05-18 11:50:57.000000000 +0200 @@ -261,9 +261,7 @@ char *ifname = NULL; - str_copy(&ifname, config.ifcfg.manual->device); - - if(config.ifcfg.manual->vlan) strprintf(&ifname, "%s.%s", ifname, config.ifcfg.manual->vlan); + str_copy(&ifname, net_get_ifname(config.ifcfg.manual)); net_wicked_up(ifname); @@ -1161,7 +1159,6 @@ window_t win; int got_ip = 0, cfg_ok; ifcfg_t *ifcfg = NULL; - char *device = config.ifcfg.manual->device; char *type; if(config.test) { @@ -1186,7 +1183,7 @@ ifcfg->flags = config.ifcfg.manual->flags; str_copy(&ifcfg->vlan, config.ifcfg.manual->vlan); - cfg_ok = ifcfg_write(device, ifcfg, 0); + cfg_ok = ifcfg_write(config.ifcfg.manual->device, ifcfg, 0); free(ifcfg->type); free(ifcfg->vlan); @@ -1197,9 +1194,7 @@ char *ifname = NULL; - str_copy(&ifname, device); - - if(config.ifcfg.manual->vlan) strprintf(&ifname, "%s.%s", ifname, config.ifcfg.manual->vlan); + str_copy(&ifname, net_get_ifname(config.ifcfg.manual)); strprintf(&buf, "Sending DHCP%s request to %s...", type, ifname); log_show_maybe(!config.win, "%s\n", buf); @@ -1208,7 +1203,7 @@ } str_copy(&buf, NULL); - net_apply_ethtool(device, NULL); + net_apply_ethtool(config.ifcfg.manual->device, NULL); net_wicked_up(ifname); @@ -1548,7 +1543,10 @@ } if(config.hwp.layer2 == LAYER2_YES) { IFNOTAUTO(config.hwp.osahwaddr) { - dia_input2("MAC address", &config.hwp.osahwaddr, 17, 1); + dia_input2("Specifying a MAC address is optional.\n"\ + "In most cases letting it default is the correct choice.\n"\ + "Provide one only if you know it is truly necessary.\n"\ + "Optional MAC address", &config.hwp.osahwaddr, 17, 0); } } @@ -2577,7 +2575,7 @@ */ void net_wicked_down(char *ifname) { - char *buf = NULL; + char *buf = NULL, *s; if(!ifname) return; @@ -2593,6 +2591,20 @@ net_update_state(); + str_copy(&buf, ifname); + + /* + * In case we were just taking down a vlan tagged interface, shutdown the + * untagged interface as well, unless there's an explicit config file for + * it (it was brought up by wicked implicitly). + */ + if((s = strchr(buf, '.'))) { + *s = 0; + if(!util_check_exist2("/etc/sysconfig/network/ifcfg-", buf)) { + net_wicked_down(buf); + } + } + str_copy(&buf, NULL); } @@ -2898,3 +2910,22 @@ } } + +/* + * Convenience function: provide network interface name in "INTERFACE.VLANID" form. + * + * Returns the string in a static buffer; + */ +char *net_get_ifname(ifcfg_t *ifcfg) +{ + static char *buf = NULL; + + if(!ifcfg || !ifcfg->device) return NULL; + + str_copy(&buf, ifcfg->device); + + if(ifcfg->vlan) strprintf(&buf, "%s.%s", buf, ifcfg->vlan); + + return buf; +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/net.h new/linuxrc-5.0.81/net.h --- old/linuxrc-5.0.77/net.h 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/net.h 2016-05-18 11:50:57.000000000 +0200 @@ -39,3 +39,4 @@ unsigned check_ptp(char *ifname); void net_wicked_get_config_keys(void); void net_nanny(void); +char *net_get_ifname(ifcfg_t *ifcfg); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/url.c new/linuxrc-5.0.81/url.c --- old/linuxrc-5.0.77/url.c 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/url.c 2016-05-18 11:50:57.000000000 +0200 @@ -2583,11 +2583,11 @@ str_copy(&config.ifcfg.manual->device, url->used.device); - log_info("interface setup: %s\n", config.ifcfg.manual->device); + log_info("interface setup: %s\n", net_get_ifname(config.ifcfg.manual)); if((config.net.do_setup & DS_SETUP)) auto2_user_netconfig(); - if(!config.ifcfg.if_up) { + if(!slist_getentry(config.ifcfg.if_up, net_get_ifname(config.ifcfg.manual))) { check_ptp(config.ifcfg.manual->device); if(config.ifcfg.manual->dhcp && !config.ifcfg.manual->ptp) { @@ -2598,12 +2598,12 @@ } } - if(!config.ifcfg.if_up) { - log_info("network setup failed\n"); + if(!slist_getentry(config.ifcfg.if_up, net_get_ifname(config.ifcfg.manual))) { + log_info("%s network setup failed\n", net_get_ifname(config.ifcfg.manual)); return 0; } else { - log_info("%s activated\n", config.ifcfg.manual->device); + log_info("%s activated\n", net_get_ifname(config.ifcfg.manual)); } return 1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/util.c new/linuxrc-5.0.81/util.c --- old/linuxrc-5.0.77/util.c 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/util.c 2016-05-18 11:50:57.000000000 +0200 @@ -5443,3 +5443,17 @@ return buf; } + +/* + * Convenience function: + * Set hostname and log this. + */ +void util_set_hostname(char *hostname) +{ + if(!hostname) return; + + sethostname(hostname, strlen(hostname)); + + log_info("set hostname: %s\n", hostname); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/linuxrc-5.0.77/util.h new/linuxrc-5.0.81/util.h --- old/linuxrc-5.0.77/util.h 2016-04-25 16:14:36.000000000 +0200 +++ new/linuxrc-5.0.81/util.h 2016-05-18 11:50:57.000000000 +0200 @@ -155,3 +155,4 @@ int util_run(char *cmd, unsigned log_stdout); void util_perror(unsigned level, char *msg); char *util_get_caller(int skip); +void util_set_hostname(char *hostname);