Hello community,

here is the log from the commit of package linuxrc for openSUSE:Factory checked 
in at 2020-04-11 23:45:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/linuxrc (Old)
 and      /work/SRC/openSUSE:Factory/.linuxrc.new.3248 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "linuxrc"

Sat Apr 11 23:45:37 2020 rev:282 rq:792775 version:7.0.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/linuxrc/linuxrc.changes  2020-03-11 
18:32:21.650899201 +0100
+++ /work/SRC/openSUSE:Factory/.linuxrc.new.3248/linuxrc.changes        
2020-04-11 23:45:51.331057584 +0200
@@ -1,0 +2,35 @@
+Thu Apr 9 15:20:00 UTC 2020 - [email protected]
+
+- merge gh#openSUSE/linuxrc#221
+- Use long-named options for better readability
+- 7.0.14
+
+--------------------------------------------------------------------
+Thu Apr 9 15:17:31 UTC 2020 - [email protected]
+
+- merge gh#openSUSE/linuxrc#218
+- Update doc for hostname in different SLE versions
+
+--------------------------------------------------------------------
+Mon Apr 6 14:48:37 UTC 2020 - [email protected]
+
+- merge gh#openSUSE/linuxrc#220
+- make I/O device pre-configuration optional (bsc#1168036,
+  jsc#SLE-7396)
+- add check for pre-config data
+- change displayed texts to 'auto-configuration'
+- 7.0.13
+
+--------------------------------------------------------------------
+Thu Apr 2 08:37:54 UTC 2020 - [email protected]
+
+- merge gh#openSUSE/linuxrc#219
+- parse 'try' keyword in ifcfg option (jsc#SLE-8965, jsc#SLE-9791)
+- move ifcfg option with 'try' to config.ifcfg.manual
+- fix iterating through device list
+- remove unused is_configured var
+- remove trailing space
+- fix travis setup
+- 7.0.12
+
+--------------------------------------------------------------------

Old:
----
  linuxrc-7.0.11.tar.xz

New:
----
  linuxrc-7.0.14.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ linuxrc.spec ++++++
--- /var/tmp/diff_new_pack.urTMb1/_old  2020-04-11 23:45:52.715058639 +0200
+++ /var/tmp/diff_new_pack.urTMb1/_new  2020-04-11 23:45:52.719058642 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           linuxrc
-Version:        7.0.11
+Version:        7.0.14
 Release:        0
 Summary:        SUSE Installation Program
 License:        GPL-3.0+

++++++ linuxrc-7.0.11.tar.xz -> linuxrc-7.0.14.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/.travis.yml 
new/linuxrc-7.0.14/.travis.yml
--- old/linuxrc-7.0.11/.travis.yml      2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/.travis.yml      2020-04-09 17:20:00.000000000 +0200
@@ -9,4 +9,4 @@
   - docker run --rm -it linuxrc-image rpm -qa | sort
 
 script:
-  - docker run --rm -it -e TRAVIS=1 linuxrc-image bash -c "make -j `nproc` && 
./smoke_test.sh"
+  - docker run --rm -it -e TRAVIS=1 --privileged linuxrc-image bash -c "make 
-j `nproc` && ./smoke_test.sh"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/VERSION new/linuxrc-7.0.14/VERSION
--- old/linuxrc-7.0.11/VERSION  2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/VERSION  2020-04-09 17:20:00.000000000 +0200
@@ -1 +1 @@
-7.0.11
+7.0.14
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/changelog new/linuxrc-7.0.14/changelog
--- old/linuxrc-7.0.11/changelog        2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/changelog        2020-04-09 17:20:00.000000000 +0200
@@ -1,3 +1,25 @@
+2020-04-09:    7.0.14
+       - merge gh#openSUSE/linuxrc#218
+       - Update doc for hostname in different SLE versions
+       - merge gh#openSUSE/linuxrc#221
+       - Use long-named options for better readability
+
+2020-04-06:    7.0.13
+       - merge gh#openSUSE/linuxrc#220
+       - make I/O device pre-configuration optional (bsc#1168036,
+         jsc#SLE-7396)
+       - add check for pre-config data
+       - change displayed texts to 'auto-configuration'
+
+2020-04-02:    7.0.12
+       - merge gh#openSUSE/linuxrc#219
+       - parse 'try' keyword in ifcfg option (jsc#SLE-8965, jsc#SLE-9791)
+       - move ifcfg option with 'try' to config.ifcfg.manual
+       - fix iterating through device list
+       - remove unused is_configured var
+       - remove trailing space
+       - fix travis setup
+
 2020-03-06:    7.0.11
        - merge gh#openSUSE/linuxrc#216
        - fix rescue system setup (bsc#1160378)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/dialog.c new/linuxrc-7.0.14/dialog.c
--- old/linuxrc-7.0.11/dialog.c 2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/dialog.c 2020-04-09 17:20:00.000000000 +0200
@@ -57,6 +57,7 @@
   { di_set_usessh,       "Enable or Disable SSH Mode",          },
   { di_set_startshell,   "Start shell before and after YaST?",    },
   { di_set_slp,          "Get SLP info",        },
+  { di_set_auto_config,  "I/O device auto-configuration" },
 
   { di_inst_install,     "Installation",       },
   { di_inst_update,      "Upgrade",       },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/dialog.h new/linuxrc-7.0.14/dialog.h
--- old/linuxrc-7.0.11/dialog.h 2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/dialog.h 2020-04-09 17:20:00.000000000 +0200
@@ -43,6 +43,7 @@
   di_set_usessh,
   di_set_startshell,
   di_set_slp,
+  di_set_auto_config,
 
   di_inst_install,
   di_inst_update,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/file.c new/linuxrc-7.0.14/file.c
--- old/linuxrc-7.0.11/file.c   2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/file.c   2020-04-09 17:20:00.000000000 +0200
@@ -316,6 +316,7 @@
   { key_linuxrc_core,   "LinuxrcCore",    kf_cfg + kf_cmd_early          },
   { key_norepo,         "NoRepo",         kf_cfg + kf_cmd                },
   { key_auto_assembly,  "AutoAssembly",   kf_cfg + kf_cmd_early          },
+  { key_device_auto_config, "DeviceAutoConfig",  kf_cfg + kf_cmd_early   },
 };
 
 static struct {
@@ -328,6 +329,7 @@
   { "yes",       1                  },
   { "j",         1                  }, // keep for compatibility?
   { "default",   1                  },
+  { "ask",       2                  },
   { "Undef",     0                  },
   { "Mono",      1                  },
   { "Color",     2                  },
@@ -1715,7 +1717,18 @@
         break;
 
       case key_ifcfg:
-        if(*f->value) ifcfg_append(&config.ifcfg.list, ifcfg_parse(f->value));
+        if(*f->value) {
+          ifcfg_t *ifcfg = ifcfg_parse(f->value);
+          if(ifcfg) {
+            // if 'try' flag is set, move to config.ifcfg.manual
+            if(ifcfg->search) {
+              ifcfg_copy(config.ifcfg.manual, ifcfg);
+            }
+            else {
+              ifcfg_append(&config.ifcfg.list, ifcfg);
+            }
+          }
+        }
         break;
 
       case key_defaultinstall:
@@ -1787,6 +1800,10 @@
         if(f->is.numeric) config.auto_assembly = f->nvalue;
         break;
 
+      case key_device_auto_config:
+        if(f->is.numeric) config.device_auto_config = f->nvalue;
+        break;
+
       default:
         break;
     }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/file.h new/linuxrc-7.0.14/file.h
--- old/linuxrc-7.0.11/file.h   2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/file.h   2020-04-09 17:20:00.000000000 +0200
@@ -56,7 +56,8 @@
   key_withipoib, key_upgrade, key_media_upgrade, key_ifcfg, key_defaultinstall,
   key_nanny, key_vlanid,
   key_sshkey, key_systemboot, key_sethostname, key_debugshell, key_self_update,
-  key_ibft_devices, key_linuxrc_core, key_norepo, key_auto_assembly, 
key_autoyast_parse
+  key_ibft_devices, key_linuxrc_core, key_norepo, key_auto_assembly, 
key_autoyast_parse,
+  key_device_auto_config
 } file_key_t;
 
 typedef enum {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/global.h new/linuxrc-7.0.14/global.h
--- old/linuxrc-7.0.11/global.h 2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/global.h 2020-04-09 17:20:00.000000000 +0200
@@ -310,6 +310,7 @@
   unsigned used:1;     ///< config has been used
   unsigned pattern:1;  ///< 'device' is shell glob
   unsigned ptp:1;      ///< ptp config, gw is ptp peer
+  unsigned search:1;    ///< whether "try" feature is enabled for this ifcfg
   int netmask_prefix;  ///< prefix given via netmask option and only used if 
an ip doen't have one
   char *vlan;          ///< vlan id, if any
   char *ip;            ///< list of ip addresses, space separated
@@ -449,6 +450,8 @@
   unsigned norepo:1;            /**< disable repo location check, expect YaST 
*/
   unsigned auto_assembly:1;    /**< enable MD/RAID auto-assembly */
   unsigned autoyast_parse:1;   /**< analyse autoyast parameter */
+  unsigned device_auto_config:2;       /**< run s390 device auto-config (cf. 
bsc#1168036) */
+  unsigned device_auto_config_done:1;  /**< set after s390 device auto-config 
has been run */
   struct {
     unsigned check:1;          /**< check for braille displays and start brld 
if found */
     char *dev;                 /**< braille device */
@@ -631,7 +634,6 @@
   struct {
     unsigned dhcp_active:1;    /**< dhcpd is running */
     unsigned ifconfig:1;       /**< setup network interface */
-    unsigned is_configured:1;  /**< set if network is configured */
     unsigned all_ifs:1;                /**< try all interfaces */
     unsigned now:1;            /**< configure network _now_ */
     unsigned ipv4:1;           /**< do ipv4 config */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/linuxrc.c new/linuxrc-7.0.14/linuxrc.c
--- old/linuxrc-7.0.11/linuxrc.c        2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/linuxrc.c        2020-04-09 17:20:00.000000000 +0200
@@ -808,6 +808,9 @@
   config.kexec = 2;            /* kexec if necessary, with user dialog */
   config.auto_assembly = 0;    /* default to disable MD/RAID auto-assembly 
(bsc#1132688) */
   config.autoyast_parse = 1;   /* analyse autoyast option and read autoyast 
file */
+#if defined(__s390x__)
+  config.device_auto_config = 2;       /* ask before doing s390 device auto 
config */
+#endif
 
   // defaults for self-update feature
   config.self_update_url = NULL;
@@ -1044,6 +1047,8 @@
 
   LXRC_WAIT
 
+  util_device_auto_config();
+
   /* look for driver updates in initrd */
   util_chk_driver_update("/", "/");
 
@@ -1206,7 +1211,7 @@
     util_disp_init();
 
     if(util_check_exist("/nextmedia") == 'r') {
-      config.cd1texts = file_parse_xmllike("/nextmedia", "text");  
+      config.cd1texts = file_parse_xmllike("/nextmedia", "text");
     }
 
     char *next_msg = get_translation(config.cd1texts, 
current_language()->locale);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/linuxrc_hostname.md 
new/linuxrc-7.0.14/linuxrc_hostname.md
--- old/linuxrc-7.0.11/linuxrc_hostname.md      2020-03-06 13:13:38.000000000 
+0100
+++ new/linuxrc-7.0.14/linuxrc_hostname.md      2020-04-09 17:20:00.000000000 
+0200
@@ -1,31 +1,65 @@
 # hostname setting in installation/rescue system
 
-There are 3 cases:
+The hostname can be set (in order of precedence):
 
-1. no hostname is set
+1. via `hostname` boot option
+2. via DHCP (either from HOSTNAME or FQDN)
+3. Default hostname
+
+linuxrc doesn't write to `/etc/hostname`, but sets the transient hostname
+and writes other settings before Yast starts. After that, Yast takes over.
+See https://github.com/yast/yast-network/blob/master/doc/hostname.md
 
-2. hostname is set via dhcp (either from HOSTNAME or FQDN)
+## installation system
 
-3. hostname is set via `hostname` boot option
+- `etc/hostname` is an empty file at the beginning of the installation
+- `linuxrc` doesn't write anything to `/etc/hostname`
+- `linuxrc` writes by default `/etc/install.inf::SetHostname=1`
 
-linuxrc defaults to `install`, which may be overridden by dhcp (2) or user
-(3). (3) takes precedence over (2).
+## If `ifcfg=*=dhcp` is used
 
-## installation system
+- `linuxrc` writes `/etc/sysconfig/network/dhcp:DHCLIENT_SET_HOSTNAME="yes"`
+
+## If `hostname` boot option is used
+
+1. linuxrc writes `/etc/install.inf::SetHostnameUsed=1`
+2. linuxrc takes the value of `hostname` boot option and
+   - writes it to `/etc/install.inf::Hostname`
+   - sets the transient hostname to that value
+
+#### Example
+
+If `hostname=myhost` is used
+
+**/etc/install.inf**
+```
+[...]
+SetHostname: 1
+SetHostnameUsed: 1
+Hostname: myhost
+[...]
+```
+
+## If `hostname` boot option is not used
 
-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.
+1. `linuxrc` doesn't write `/etc/install.inf::Hostname`, so it is not present.
+2. `linuxrc` writes `/etc/install.inf::SetHostnameUsed=0`.
+3. `linuxrc` sets the transient hostname to `install`.
 
-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.
+#### Example
 
-There is no `/etc/hostname` file in the installation environment.
+**/etc/install.inf**
+```
+[...]
+SetHostname: 1
+SetHostnameUsed: 0
+[...]
+```
 
 ## rescue system
 
-linuxrc changes the hostname to `rescue`, which may be overridden by user (3).
+linuxrc changes the hostname to `rescue`, which may be overridden by user 
`hostname` boot option.
 
-This value is put into `/etc/hostname` of the rescue system. The value there 
may later
-be overridden by dhcp (2).
+This value is put into `/etc/hostname` of the rescue system. The value there
+may later be overridden by DHCP.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/linuxrc_repo.md 
new/linuxrc-7.0.14/linuxrc_repo.md
--- old/linuxrc-7.0.11/linuxrc_repo.md  2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/linuxrc_repo.md  2020-04-09 17:20:00.000000000 +0200
@@ -80,7 +80,7 @@
 mkdir -p /tmp/foo/etc/linuxrc.d
 cp content /tmp/foo/etc/linuxrc.d/
 cd /tmp/foo
-find . | cpio -o -H newc | xz --check=crc32 -c >>initrd_on_boot_medium
+find . | cpio --create --format=newc | xz --check=crc32 --to-stdout 
>>initrd_on_boot_medium
 ```
 
 ## 3. Multi-repository medium
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/net.c new/linuxrc-7.0.14/net.c
--- old/linuxrc-7.0.11/net.c    2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/net.c    2020-04-09 17:20:00.000000000 +0200
@@ -113,9 +113,6 @@
  *      0: ok
  *   != 0: error or abort
  *
- * Global vars changed:
- *  config.net.is_configured
- *
  * Does nothing if DHCP is active.
  *
  * FIXME: needs window mode or not?
@@ -199,9 +196,6 @@
 /*
  * Shut down all network interfaces.
  *
- * Global vars changed:
- *  config.net.is_configured
- *
  * config.net.device:    interface
  * /proc/net/route: configured interfaces
  */
@@ -214,12 +208,10 @@
   log_debug("%s: network down\n", device);
 
   if(config.test) {
-    config.net.is_configured = nc_none;
     return;
   }
 
   net_wicked_down(device);
-  config.net.is_configured = nc_none;
 
   // delete current config
   if(config.ifcfg.current) {
@@ -2395,6 +2387,7 @@
   slist_t *sl, *sl0, *slx;
   ifcfg_t *ifcfg;
   char *s, *t;
+  int try_shift = 0; // try keyword is optional, so position of following 
params can vary
 
   if(!str) return NULL;
 
@@ -2430,6 +2423,16 @@
   }
 
   s = slist_key(sl0, 1);
+  if(s && (strncmp(s, "try", sizeof "try" -1) == 0))
+  {
+    log_debug("Will try to detect interface with access to installation");
+
+    ifcfg->search = 1;
+    try_shift = 1;
+
+    s = slist_key(sl0, 2);
+  }
+
   if(s && !strncmp(s, "dhcp", sizeof "dhcp" - 1)) {
     str_copy(&ifcfg->type, s);
     ifcfg->dhcp = 1;
@@ -2441,13 +2444,13 @@
 
     if(s && *s && !(t = strchr(s, '='))) str_copy(&ifcfg->ip, s);
 
-    s = slist_key(sl0, 2);
+    s = slist_key(sl0, 2 + try_shift);
     if(!t && s && *s && !(t = strchr(s, '='))) str_copy(&ifcfg->gw, s);
 
-    s = slist_key(sl0, 3);
+    s = slist_key(sl0, 3 + try_shift);
     if(!t && s && *s && !(t = strchr(s, '='))) str_copy(&ifcfg->ns, s);
 
-    s = slist_key(sl0, 4);
+    s = slist_key(sl0, 4 + try_shift);
     if(!t && s && *s && !(t = strchr(s, '='))) str_copy(&ifcfg->domain, s);
   }
 
@@ -2486,11 +2489,14 @@
 
   str_copy(&dst->device, src->device);
   str_copy(&dst->type, src->type);
+
   dst->dhcp = src->dhcp;
   dst->used = src->used;
   dst->pattern = src->pattern;
   dst->ptp = src->ptp;
+  dst->search = src->search;
   dst->netmask_prefix = src->netmask_prefix;
+
   str_copy(&dst->vlan, src->vlan);
   str_copy(&dst->ip, src->ip);
   str_copy(&dst->gw, src->gw);
@@ -2520,10 +2526,10 @@
   if(ifcfg->vlan) strprintf(&buf, "%s  vlan = %s\n", buf, ifcfg->vlan);
   if(ifcfg->type) strprintf(&buf, "%s  type = %s\n", buf, ifcfg->type);
   strprintf(&buf,
-    "%s  dhcp = %u, pattern = %u, used = %u, prefix = %d, ptp = %u\n",
+    "%s  dhcp = %u, pattern = %u, used = %u, prefix = %d, ptp = %u, search = 
%u\n",
     buf,
     ifcfg->dhcp, ifcfg->pattern, ifcfg->used,
-    ifcfg->netmask_prefix, ifcfg->ptp
+    ifcfg->netmask_prefix, ifcfg->ptp, ifcfg->search
   );
   if(ifcfg->ip) strprintf(&buf, "%s  ip = %s\n", buf, ifcfg->ip);
   if(ifcfg->gw) strprintf(&buf, "%s  gw = %s\n", buf, ifcfg->gw);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/settings.c 
new/linuxrc-7.0.14/settings.c
--- old/linuxrc-7.0.11/settings.c       2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/settings.c       2020-04-09 17:20:00.000000000 +0200
@@ -181,6 +181,9 @@
     di_set_startshell,
     di_set_slp,
     di_inst_net_config,
+#if defined(__s390x__)
+    di_set_auto_config,
+#endif
     di_none
   };
 
@@ -302,6 +305,12 @@
       rc = 1;
       break;
 
+    case di_set_auto_config:
+      config.device_auto_config = 2;
+      util_device_auto_config();
+      rc = 1;
+      break;
+
     default:
       break;
   }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/url.c new/linuxrc-7.0.14/url.c
--- old/linuxrc-7.0.11/url.c    2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/url.c    2020-04-09 17:20:00.000000000 +0200
@@ -1776,7 +1776,7 @@
   char *hwaddr;
   hd_hw_item_t hw_items[3] = { hw_network_ctrl, hw_network, 0 };
   str_list_t *sl;
-  char *url_device;
+  char *url_device = NULL;
 
   if(!url || !url->scheme) return 1;
 
@@ -1806,8 +1806,8 @@
     hw_items[1] = 0;
   }
 
-  url_device = url->device;
-  if(!url_device) url_device = url->is.network ? config.ifcfg.manual->device : 
config.device;
+  str_copy(&url_device, url->device);
+  if(!url_device) str_copy(&url_device, url->is.network ? 
config.ifcfg.manual->device : config.device);
 
   for(found = 0, hd = sort_a_bit(fix_device_names(hd_list2(config.hd_data, 
hw_items, 0))); hd; hd = hd->next) {
     for(hwaddr = NULL, res = hd->res; res; res = res->next) {
@@ -1886,6 +1886,8 @@
     str_copy(&url->used.unique_id, NULL);
   }
 
+  str_copy(&url_device, NULL);
+
   return found ? 0 : 1;
 }
 
@@ -2413,7 +2415,7 @@
   hd_res_t *res;
   char *hwaddr;
   str_list_t *sl;
-  char *url_device;
+  char *url_device = NULL;
   hd_hw_item_t hw_items[] = { hw_network_ctrl, hw_network, 0 };
 
   if(!url || !url->is.network || config.ifcfg.if_up) return url_read_file(url, 
dir, src, dst, label, flags);
@@ -2429,7 +2431,7 @@
   LXRC_WAIT
 
   if(config.hd_data) {
-    url_device = url->device ?: config.ifcfg.manual->device;
+    str_copy(&url_device, url->device ?: config.ifcfg.manual->device);
 
     for(found = 0, hd = sort_a_bit(hd_list2(config.hd_data, hw_items, 0)); hd; 
hd = hd->next) {
       for(hwaddr = NULL, res = hd->res; res; res = res->next) {
@@ -2472,6 +2474,8 @@
       str_copy(&url->used.unique_id, NULL);
     }
 
+    str_copy(&url_device, NULL);
+
     LXRC_WAIT
 
     return found ? 0 : 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/util.c new/linuxrc-7.0.14/util.c
--- old/linuxrc-7.0.11/util.c   2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/util.c   2020-04-09 17:20:00.000000000 +0200
@@ -121,6 +121,7 @@
 static int cmp_alpha_s(const void *p0, const void *p1);
 static slist_t *get_kernel_list(char *dev);
 
+static int has_device_auto_config(void);
 
 void util_redirect_kmsg()
 {
@@ -1204,6 +1205,7 @@
   add_flag(&sl0, buf, config.self_update, "self_update");
   add_flag(&sl0, buf, config.repomd, "repomd");
   add_flag(&sl0, buf, config.norepo, "norepo");
+  add_flag(&sl0, buf, config.device_auto_config, "deviceautoconfig");
   if(*buf) slist_append_str(&sl0, buf);
 
   if(config.self_update_url) {
@@ -5672,3 +5674,50 @@
   util_reparse_blockdev_url(&config.url.install);
   util_reparse_blockdev_url(&config.url.instsys);
 }
+
+/*
+ * Apply S390 I/O device auto-config.
+ *
+ * Ask user before doing so, if requested.
+ */
+void util_device_auto_config()
+{
+  unsigned do_it = config.device_auto_config;
+
+  if(do_it && !has_device_auto_config()) do_it = 0;
+
+  if(do_it == 2) {
+    int win_old = config.win;
+    char *msg = config.device_auto_config_done ?
+      "Reapply I/O device auto-configuration?" : "Apply I/O device 
auto-configuration?";
+
+    if(!config.win) util_disp_init();
+    do_it = dia_yesno(msg, YES) == YES;
+    if(config.win && !win_old) util_disp_done();
+  }
+
+  if(do_it) {
+    log_info("applying I/O device auto-configuration\n");
+    util_run_script("device_auto_config");
+    config.device_auto_config_done = 1;
+  }
+}
+
+
+/*
+ * Check if S390 I/O device auto-config data is available.
+ */
+int has_device_auto_config()
+{
+  FILE *f;
+  int has_it = 0;
+
+  if((f = fopen("/sys/firmware/sclp_sd/config/data", "r"))) {
+    has_it = fgetc(f) != EOF;
+    fclose(f);
+  }
+
+  log_info("has I/O device auto-config data: %d\n", has_it);
+
+  return has_it;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-7.0.11/util.h new/linuxrc-7.0.14/util.h
--- old/linuxrc-7.0.11/util.h   2020-03-06 13:13:38.000000000 +0100
+++ new/linuxrc-7.0.14/util.h   2020-04-09 17:20:00.000000000 +0200
@@ -163,3 +163,5 @@
 
 void util_reparse_blockdev_url(url_t **url_ptr);
 void util_reparse_blockdev_urls(void);
+
+void util_device_auto_config(void);


Reply via email to