Hello community,

here is the log from the commit of package linuxrc for openSUSE:Factory checked 
in at 2014-02-21 13:48:22
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-02-07 
10:26:19.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes     2014-02-21 
13:48:24.000000000 +0100
@@ -1,0 +2,21 @@
+Tue Feb 18 14:38:57 CET 2014 - [email protected]
+
+- update copyright string
+- write complete static network config for wicked
+- make 'textmode' equivalent to textmod=1 (bnc #864316)
+
+-------------------------------------------------------------------
+Mon Feb 17 17:34:20 CET 2014 - [email protected]
+
+- wicked: write static ifcfg files
+
+-------------------------------------------------------------------
+Mon Feb 17 13:10:36 CET 2014 - [email protected]
+
+- make wicked (for dhcp) the default
+- Revert "Fix for bnc #571990. Don't prompt for DHCP unless a Layer 2 NIC has 
been selected."
+- Fix wasn't complete.
+- This reverts commit 06f06163a49be544842f025df941966c823eed94.
+- Fix for bnc #571990. Don't prompt for DHCP unless a Layer 2 NIC has been 
selected.
+
+-------------------------------------------------------------------

Old:
----
  linuxrc-4.2.6.tar.bz2

New:
----
  linuxrc-4.2.9.tar.bz2

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

Other differences:
------------------
++++++ linuxrc.spec ++++++
--- /var/tmp/diff_new_pack.fh6J4j/_old  2014-02-21 13:48:25.000000000 +0100
+++ /var/tmp/diff_new_pack.fh6J4j/_new  2014-02-21 13:48:25.000000000 +0100
@@ -25,9 +25,9 @@
 Summary:        SUSE Installation Program
 License:        GPL-3.0+
 Group:          System/Boot
-Version:        4.2.6
+Version:        4.2.9
 Release:        0
-Source:         linuxrc-4.2.6.tar.bz2
+Source:         linuxrc-4.2.9.tar.bz2
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description

++++++ linuxrc-4.2.6.tar.bz2 -> linuxrc-4.2.9.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.6/VERSION new/linuxrc-4.2.9/VERSION
--- old/linuxrc-4.2.6/VERSION   2014-02-05 15:38:57.000000000 +0100
+++ new/linuxrc-4.2.9/VERSION   2014-02-18 14:38:52.000000000 +0100
@@ -1 +1 @@
-4.2.6
+4.2.9
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.6/changelog new/linuxrc-4.2.9/changelog
--- old/linuxrc-4.2.6/changelog 2014-02-05 15:38:58.000000000 +0100
+++ new/linuxrc-4.2.9/changelog 2014-02-18 14:38:53.000000000 +0100
@@ -1,4 +1,19 @@
-2014-02-05:    HEAD
+2014-02-18:    HEAD
+       - update copyright string
+       - write complete static network config for wicked
+       - make 'textmode' equivalent to textmod=1 (bnc #864316)
+
+2014-02-17:    4.2.8
+       - wicked: write static ifcfg files
+
+2014-02-17:    4.2.7
+       - make wicked (for dhcp) the default
+       - Revert "Fix for bnc #571990. Don't prompt for DHCP unless a Layer 2 
NIC has been selected."
+       - Fix wasn't complete.
+       - This reverts commit 06f06163a49be544842f025df941966c823eed94.
+       - Fix for bnc #571990. Don't prompt for DHCP unless a Layer 2 NIC has 
been selected.
+
+2014-02-05:    4.2.6
        - recognnize s390 point-to-point devices
        - this is a merge of commit 44607df402171569048c79df95a17e8b28aeb0ab
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.6/file.c new/linuxrc-4.2.9/file.c
--- old/linuxrc-4.2.6/file.c    2014-01-31 13:17:17.000000000 +0100
+++ new/linuxrc-4.2.9/file.c    2014-02-18 11:40:30.000000000 +0100
@@ -728,7 +728,8 @@
         break;
 
       case key_textmode:
-        config.textmode = f->nvalue;
+        if(!*f->value) config.textmode = 1;
+        if(f->is.numeric) config.textmode = f->nvalue;
         break;
 
       case key_username:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.6/linuxrc.c new/linuxrc-4.2.9/linuxrc.c
--- old/linuxrc-4.2.6/linuxrc.c 2014-02-03 14:44:50.000000000 +0100
+++ new/linuxrc-4.2.9/linuxrc.c 2014-02-18 14:33:09.000000000 +0100
@@ -737,7 +737,7 @@
   config.efi = -1;
   config.udev_mods = 1;
   config.devtmpfs = 1;
-  config.wicked = 0;
+  config.wicked = 1;
 
   config.scsi_rename = 0;
   config.scsi_before_usb = 1;
@@ -799,7 +799,7 @@
     if (config.linemode)
       putchar('\n');
     printf(
-      "\n>>> %s installation program v" LXRC_FULL_VERSION " (c) 1996-2012 SUSE 
Linux Products GmbH <<<\n",
+      "\n>>> %s installation program v" LXRC_FULL_VERSION " (c) 1996-2014 SUSE 
Linux Products GmbH <<<\n",
       config.product
     );
     if (config.linemode)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.6/net.c new/linuxrc-4.2.9/net.c
--- old/linuxrc-4.2.6/net.c     2014-01-31 11:52:28.000000000 +0100
+++ new/linuxrc-4.2.9/net.c     2014-02-18 14:31:46.000000000 +0100
@@ -90,6 +90,8 @@
 static int net_dhcp6(void);
 
 static void net_ask_domain(void);
+static int write_ifcfg(void);
+static char *inet2str(inet_t *inet, int type);
 
 
 /*
@@ -441,6 +443,12 @@
     config.net.is_configured = nc_none;
   }
 
+  // FIXME: for now, delete all ethernet config files
+  if(config.wicked) {
+    system("rm -f /etc/sysconfig/network/ifcfg-e*");
+    system("rm -f /etc/sysconfig/network/ifroute-e*");
+  }
+
   if(!config.net.is_configured) return;
 
   /* build list of configured interfaces */
@@ -568,7 +576,10 @@
   if(config.net.ipv4) err4 = net_activate4();
   if(config.net.ipv6) err6 = net_activate6();
 
-  if(!err4 || !err6) net_setup_nameserver();
+  if(!err4 || !err6) {
+    net_setup_nameserver();
+    if(!config.net.dhcp_active) write_ifcfg();
+  }
 
   // at least one should have worked
   return err4 && err6 ? 1 : 0;
@@ -2990,3 +3001,111 @@
 }
 
 
+char *inet2str(inet_t *inet, int type)
+{
+  static char buf[INET6_ADDRSTRLEN];
+  const char *s = NULL;
+
+  if(!inet) return NULL;
+
+  if(type == 4 && config.net.ipv4 && inet->ipv4) {
+    s = inet_ntop(AF_INET, &inet->ip, buf, sizeof buf);
+  }
+  else if(type == 6 && config.net.ipv6 && inet->ipv6) {
+    s = inet_ntop(AF_INET6, &inet->ip6, buf, sizeof buf);
+  }
+
+
+  return (char *) s;
+}
+
+
+int write_ifcfg()
+{
+  char *fname, *s;
+  FILE *fp, *fp2;
+
+  if(!config.wicked) return 0;
+
+  if(!config.net.device) return 0;
+
+  if(!config.net.hostname.ok) return 0;
+
+  if(asprintf(&fname, "/etc/sysconfig/network/ifcfg-%s", config.net.device) == 
-1) fname = NULL;
+
+  if((fp = fopen(fname, "w"))) {
+    fprintf(fp, "BOOTPROTO='static'\n");
+    fprintf(fp, "STARTMODE='auto'\n");
+
+    if((s = inet2str(&config.net.hostname, 4))) {
+      fprintf(fp, "IPADDR='%s/%u'\n", s, config.net.hostname.prefix4); 
+    }
+
+    if((s = inet2str(&config.net.hostname, 6))) {
+      fprintf(fp, "IPADDR='%s/%u'\n", s, config.net.hostname.prefix6); 
+    }
+
+    fclose(fp);
+  }
+
+  free(fname);
+
+  if(config.net.gateway.ok) {
+    if(asprintf(&fname, "/etc/sysconfig/network/ifroute-%s", 
config.net.device) == -1) fname = NULL;
+
+    if((fp = fopen(fname, "w"))) {
+      if((s = inet2str(&config.net.gateway, 4))) {
+        fprintf(fp, "default %s - %s\n", s, config.net.device);
+      }
+
+      if((s = inet2str(&config.net.gateway, 6))) {
+        fprintf(fp, "default %s - %s\n", s, config.net.device);
+      }
+
+      fclose(fp);
+    }
+
+    free(fname);
+  }
+
+  if((fp = fopen("/etc/sysconfig/network/config", "r"))) {
+    if((fp2 = fopen("/etc/sysconfig/network/config.tmp", "w"))) {
+      char buf[1024];
+      unsigned u, first;
+
+      while(fgets(buf, sizeof buf, fp)) {
+        if(
+          !strncmp(buf, "NETCONFIG_DNS_STATIC_SEARCHLIST=", sizeof 
"NETCONFIG_DNS_STATIC_SEARCHLIST=" - 1) &&
+          config.net.domain
+        ) {
+          fprintf(fp2, "NETCONFIG_DNS_STATIC_SEARCHLIST=\"%s\"\n", 
config.net.domain);
+        }
+        else if(
+          !strncmp(buf, "NETCONFIG_DNS_STATIC_SERVERS=", sizeof 
"NETCONFIG_DNS_STATIC_SERVERS=" - 1) &&
+          config.net.nameserver[0].ok
+        ) {
+          fprintf(fp2, "NETCONFIG_DNS_STATIC_SERVERS=\"");
+          for(u = 0, first = 1; u < config.net.nameservers; u++) {
+            if(config.net.nameserver[u].ok) {
+              fprintf(fp2, "%s%s", first ? "" : " ", 
config.net.nameserver[u].name);
+              first = 0;
+            }
+          }
+          fprintf(fp2, "\"\n");
+        }
+        else {
+          fputs(buf, fp2);
+        }
+      }
+
+      fclose(fp2);
+    }
+
+    fclose(fp);
+
+    rename("/etc/sysconfig/network/config.tmp", 
"/etc/sysconfig/network/config");
+  }
+
+  return 0;
+}
+

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to