Hello community,

here is the log from the commit of package linuxrc for openSUSE:Factory checked 
in at 2014-04-26 11:45:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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-04-14 
06:43:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.linuxrc.new/linuxrc.changes     2014-04-26 
11:45:21.000000000 +0200
@@ -1,0 +2,24 @@
+Fri Apr 25 10:14:48 CEST 2014 - snw...@suse.de
+
+- signature checking of compressed driver updates now works (bnc #836366)
+- support unpacking of tar archives
+- support xz compression
+- reworked filesystem type detection, added tar
+- apply timeout option to wicked
+- 4.2.20
+
+-------------------------------------------------------------------
+Tue Apr 22 10:44:29 CEST 2014 - snw...@suse.de
+
+- Fix for bnc #843438.
+- Add KVM detection on s390x.
+- If running under KVM on s390x, only offer a virtio network device.
+- remove linuxrc-revert-chzdev.patch
+
+-------------------------------------------------------------------
+Mon Apr 14 06:27:44 UTC 2014 - mp...@suse.com
+
+- Temporarily revert the changes made to use chzdev until the code
+  is more mature. linuxrc-revert-chzdev.patch.
+
+-------------------------------------------------------------------

Old:
----
  linuxrc-4.2.18.tar.bz2

New:
----
  linuxrc-4.2.20.tar.bz2

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

Other differences:
------------------
++++++ linuxrc.spec ++++++
--- /var/tmp/diff_new_pack.EZYUIq/_old  2014-04-26 11:45:22.000000000 +0200
+++ /var/tmp/diff_new_pack.EZYUIq/_new  2014-04-26 11:45:22.000000000 +0200
@@ -25,9 +25,9 @@
 Summary:        SUSE Installation Program
 License:        GPL-3.0+
 Group:          System/Boot
-Version:        4.2.18
+Version:        4.2.20
 Release:        0
-Source:         linuxrc-4.2.18.tar.bz2
+Source:         linuxrc-4.2.20.tar.bz2
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description

++++++ linuxrc-4.2.18.tar.bz2 -> linuxrc-4.2.20.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/VERSION new/linuxrc-4.2.20/VERSION
--- old/linuxrc-4.2.18/VERSION  2014-04-11 14:25:05.000000000 +0200
+++ new/linuxrc-4.2.20/VERSION  2014-04-25 10:14:44.000000000 +0200
@@ -1 +1 @@
-4.2.18
+4.2.20
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/auto2.c new/linuxrc-4.2.20/auto2.c
--- old/linuxrc-4.2.18/auto2.c  2014-03-26 08:09:51.000000000 +0100
+++ new/linuxrc-4.2.20/auto2.c  2014-04-24 14:35:53.000000000 +0200
@@ -420,14 +420,14 @@
 #endif
         err = url_read_file_anywhere(
           url, NULL, NULL, file_name, NULL,
-          URL_FLAG_UNZIP + URL_FLAG_NODIGEST + URL_FLAG_PROGRESS + 
(config.secure ? URL_FLAG_CHECK_SIG : 0)
+          URL_FLAG_NODIGEST + URL_FLAG_PROGRESS + (config.secure ? 
URL_FLAG_CHECK_SIG : 0)
         );
 
         if(err && !config.sig_failed) {
           str_copy(&url->path, path2);
           err = url_read_file_anywhere(
             url, NULL, NULL, file_name, NULL,
-            URL_FLAG_UNZIP + URL_FLAG_NODIGEST + URL_FLAG_PROGRESS + 
(config.secure ? URL_FLAG_CHECK_SIG : 0)
+            URL_FLAG_NODIGEST + URL_FLAG_PROGRESS + (config.secure ? 
URL_FLAG_CHECK_SIG : 0)
           );
         }
         fprintf(stderr, "err2 = %d\n", err);
@@ -1091,7 +1091,7 @@
     "driverupdate",
     file_name = strdup(new_download()),
     "Loading Driver Update",
-    URL_FLAG_UNZIP + URL_FLAG_NODIGEST + URL_FLAG_KEEP_MOUNTED + 
(config.secure ? URL_FLAG_CHECK_SIG : 0)
+    URL_FLAG_NODIGEST + URL_FLAG_KEEP_MOUNTED + (config.secure ? 
URL_FLAG_CHECK_SIG : 0)
   );
 
   if(!err) err = util_mount_ro(file_name, config.mountpoint.update, NULL);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/changelog new/linuxrc-4.2.20/changelog
--- old/linuxrc-4.2.18/changelog        2014-04-11 14:25:07.000000000 +0200
+++ new/linuxrc-4.2.20/changelog        2014-04-25 10:14:46.000000000 +0200
@@ -1,4 +1,24 @@
-2014-04-11:    HEAD
+2014-04-24:    HEAD
+       - Merge branch 'netx'
+       - minor corrections
+       - fix some bugs in last patch and add logging
+       - Signature checking of compressed driver updates now works (bnc 
#836366).
+       - We do this by delaying the uncompression and handling it in 
util_mount().
+       - Before we uncompressed while downloading.
+       - support unpacking of tar archives
+       - support xz compression
+       - reworked filesystem type detection, added tar
+       - apply timeout option to wicked
+
+2014-04-22:    4.2.19
+       - fix compiler warning
+       - Merge pull request #7 from openSUSE/s390xkvm
+       - Fix for bnc #843438.
+       - Fix for bnc #843438.
+         Add KVM detection on s390x.
+         If running under KVM on s390x, only offer a virtio network device.
+
+2014-04-11:    4.2.18
        - simplify s390x hypervisor detection code
        - fix include
        - passing ssl_verify option to yast (bnc #807799)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/dialog.c new/linuxrc-4.2.20/dialog.c
--- old/linuxrc-4.2.18/dialog.c 2014-03-20 12:59:45.000000000 +0100
+++ new/linuxrc-4.2.20/dialog.c 2014-04-24 14:35:36.000000000 +0200
@@ -104,6 +104,7 @@
   { di_390net_escon,    "ESCON"         },
   { di_390net_iucv,     "Inter-User Communication Vehicle (IUCV)"          },
   { di_390net_hsi,      "Hipersockets"           },
+  { di_390net_virtio,   "VirtIO Ethernet CCW Device"},
   { di_390net_sep,      "#--------------------" },
   
   { di_ctc_compat,      "Compatibility mode (default)"      },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/dialog.h new/linuxrc-4.2.20/dialog.h
--- old/linuxrc-4.2.18/dialog.h 2013-12-04 12:07:39.000000000 +0100
+++ new/linuxrc-4.2.20/dialog.h 2014-04-24 14:35:36.000000000 +0200
@@ -85,6 +85,7 @@
   di_390net_escon,
   di_390net_iucv,
   di_390net_hsi,
+  di_390net_virtio,
   di_390net_eth,
   di_390net_qdio,
   di_390net_lcs,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/file.c new/linuxrc-4.2.20/file.c
--- old/linuxrc-4.2.18/file.c   2014-04-11 14:04:54.000000000 +0200
+++ new/linuxrc-4.2.20/file.c   2014-04-24 14:35:53.000000000 +0200
@@ -33,7 +33,6 @@
 #include "auto2.h"
 #include "rootimage.h"
 #include "display.h"
-#include "fstype.h"
 #include "keyboard.h"
 #include "url.h"
 
@@ -887,7 +886,7 @@
             for(sl = config.partitions; sl; sl = sl->next) {
               if(sl->key) {
                 sprintf(buf, "/dev/%s", sl->key);
-                t = fstype(buf);
+                t = util_fstype(buf, NULL);
                 if(t && !strcmp(t, "swap")) {
                   if(!--i) {
                     char *argv[2] = { };
@@ -909,7 +908,7 @@
           if(strstr(s, "/dev/") != s) {
             sprintf(s = buf, "/dev/%s", f->value);
           }
-          t = fstype(s);
+          t = util_fstype(s, NULL);
           if(t && !strcmp(t, "swap")) {
             argv[1] = s;
             fprintf(stderr, "swapon %s\n", s);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/fstype.c new/linuxrc-4.2.20/fstype.c
--- old/linuxrc-4.2.18/fstype.c 2013-11-18 14:06:40.000000000 +0100
+++ new/linuxrc-4.2.20/fstype.c 2014-04-24 14:35:53.000000000 +0200
@@ -17,7 +17,7 @@
  *  detect *fat and then assume vfat, so perhaps /etc/filesystems isnt
  *  so useful anymore.]
  *
- * 1999-02-22 Arkadiusz Mi�kiewicz <mis...@pld.org.pl>
+ * 1999-02-22 Arkadiusz Miśkiewicz <mis...@pld.org.pl>
  * added Native Language Support
  *
  * 2000-12-01 Sepp Wijnands <mrr...@garbage-coderz.net>
@@ -44,385 +44,411 @@
 
 #include "global.h"
 
-#define ALL_TYPES
-
-#define SIZE(a) (sizeof(a)/sizeof(a[0]))
+/*
+ * Most file system types can be recognized by a `magic' number
+ * in the superblock.  Note that the order of the tests is
+ * significant: by coincidence a filesystem can have the
+ * magic numbers for several file system types simultaneously.
+ * For example, the romfs magic lives in the 1st sector;
+ * xiafs does not touch the 1st sector and has its magic in
+ * the 2nd sector; ext2 does not touch the first two sectors.
+ */
 
-/* Most file system types can be recognized by a `magic' number
-   in the superblock.  Note that the order of the tests is
-   significant: by coincidence a filesystem can have the
-   magic numbers for several file system types simultaneously.
-   For example, the romfs magic lives in the 1st sector;
-   xiafs does not touch the 1st sector and has its magic in
-   the 2nd sector; ext2 does not touch the first two sectors. */
-
-static inline unsigned short
-swapped(unsigned short a) {
-     return (a>>8) | (a<<8);
+static inline unsigned short swapped(unsigned short a)
+{
+  return (a>>8) | (a<<8);
 }
 
-static inline int
-assemble4le(unsigned char *p) {
-       return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24));
+
+static inline int assemble4le(unsigned char *p)
+{
+  return (p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24));
 }
 
 /*
-    char *guess_fstype_from_superblock(const char *device);
+  char *guess_fstype_from_superblock(const char *device);
 
-    Probes the device and attempts to determine the type of filesystem
-    contained within.
+  Probes the device and attempts to determine the type of filesystem
+  contained within.
 
-    Original routine by <jmorr...@bogomips.ww.ubc.ca>; made into a function
-    for mount(8) by Mike Grupenhoff <kash...@umiacs.umd.edu>.
-    Corrected the test for xiafs - aeb
-    Read the superblock only once - aeb
-    Added a very weak heuristic for vfat - aeb
-    Added iso9660, minix-v2, romfs, qnx4, udf, vxfs, swap - aeb
-    Added a test for high sierra (iso9660) - quin...@bucknell.edu
-    Added ufs from a patch by jj. But maybe there are several types of ufs?
-    Added ntfs from a patch by Richard Russon.
-    Added xfs - 2000-03-21 Martin K. Petersen <m...@linuxcare.com>
-    Added cramfs, hfs, hpfs, adfs - Sepp Wijnands <mrr...@garbage-coderz.net>
-    Added ext3 - Andrew Morton
-    Added jfs - Christoph Hellwig
-    Added sysv - Tim Launchbury
+  Original routine by <jmorr...@bogomips.ww.ubc.ca>; made into a function
+  for mount(8) by Mike Grupenhoff <kash...@umiacs.umd.edu>.
+  Corrected the test for xiafs - aeb
+  Read the superblock only once - aeb
+  Added a very weak heuristic for vfat - aeb
+  Added iso9660, minix-v2, romfs, qnx4, udf, vxfs, swap - aeb
+  Added a test for high sierra (iso9660) - quin...@bucknell.edu
+  Added ufs from a patch by jj. But maybe there are several types of ufs?
+  Added ntfs from a patch by Richard Russon.
+  Added xfs - 2000-03-21 Martin K. Petersen <m...@linuxcare.com>
+  Added cramfs, hfs, hpfs, adfs - Sepp Wijnands <mrr...@garbage-coderz.net>
+  Added ext3 - Andrew Morton
+  Added jfs - Christoph Hellwig
+  Added sysv - Tim Launchbury
 */
 
-#ifdef ALL_TYPES
-/* udf magic - I find that trying to mount garbage as an udf fs
-   causes a very large kernel delay, almost killing the machine.
-   So, we do not try udf unless there is positive evidence that it
-   might work. Try iso9660 first, it is much more likely.
-   Strings below taken from ECMA 167. */
-static char
-*udf_magic[] = { "BEA01", "BOOT2", "CD001", "CDW02", "NSR02",
-                "NSR03", "TEA01" };
-
-static int
-may_be_udf(const char *id) {
-    char **m;
-
-    for (m = udf_magic; m - udf_magic < (ssize_t) SIZE(udf_magic); m++)
-       if (!strncmp(*m, id, 5))
-         return 1;
-    return 0;
+/*
+ * udf magic - I find that trying to mount garbage as an udf fs
+ * causes a very large kernel delay, almost killing the machine.
+ *  So, we do not try udf unless there is positive evidence that it
+ *  might work. Try iso9660 first, it is much more likely.
+ *  Strings below taken from ECMA 167.
+ */
+static int may_be_udf(const char *id)
+{
+  char *udf_magic[] = {
+    "BEA01", "BOOT2", "CD001", "CDW02", "NSR02", "NSR03", "TEA01"
+  };
+  char **m;
+
+  for(m = udf_magic; m - udf_magic < sizeof udf_magic / sizeof *udf_magic; 
m++) {
+    if(!strncmp(*m, id, 5)) return 1;
+  }
+
+  return 0;
 }
-#endif
 
-static int
-may_be_swap(const char *s) {
-       return (strncmp(s-10, "SWAP-SPACE", 10) == 0 ||
-               strncmp(s-10, "SWAPSPACE2", 10) == 0);
+
+static int may_be_swap(const char *s)
+{
+  return !strncmp(s - 10, "SWAP-SPACE", 10) || !strncmp(s - 10, "SWAPSPACE2", 
10);
 }
 
-static int is_reiserfs_magic_string (struct reiserfs_super_block * rs)
+
+static int is_reiserfs_magic_string(struct reiserfs_super_block * rs)
 {
-    return (!strncmp (rs->s_magic, REISERFS_SUPER_MAGIC_STRING, 
-                     strlen ( REISERFS_SUPER_MAGIC_STRING)) ||
-           !strncmp (rs->s_magic, REISER2FS_SUPER_MAGIC_STRING, 
-                     strlen ( REISER2FS_SUPER_MAGIC_STRING)));
+  return
+    !strncmp(rs->s_magic, REISERFS_SUPER_MAGIC_STRING, 
strlen(REISERFS_SUPER_MAGIC_STRING)) ||
+    !strncmp(rs->s_magic, REISER2FS_SUPER_MAGIC_STRING, 
strlen(REISER2FS_SUPER_MAGIC_STRING));
 }
 
-char *
-fstype(const char *device) {
-    int fd;
-    char *type = NULL;
-    union {
-       struct minix_super_block ms;
-       struct ext_super_block es;
-       struct ext2_super_block e2s;
-       struct vxfs_super_block vs;
-    } sb;                      /* stuff at 1024 */
+
+char *fstype(const char *device)
+{
+  int fd;
+  char *type = NULL;
+  struct stat64 statbuf;
+
+  /*
+   * opening and reading an arbitrary unknown path can have
+   * undesired side effects - first check that `device' refers
+   * to a block device
+   */
+  if(
+    stat64(device, &statbuf) ||
+    !(S_ISBLK(statbuf.st_mode) || S_ISREG(statbuf.st_mode))
+  ) {
+    return 0;
+  }
+
+  fd = open(device, O_RDONLY | O_LARGEFILE);
+  /* try harder */
+  if(fd < 0 && errno == ENOMEDIUM) fd = open(device, O_RDONLY | O_LARGEFILE);
+  if(fd < 0) {
+    if(config.debug) perror(device);
+    return 0;
+  }
+
+  /*
+   * do seeks and reads in disk order, otherwise a very short
+   * partition may cause a failure because of read error
+   */
+
+  if(!type) {
     union {
-       struct xiafs_super_block xiasb;
-       char romfs_magic[8];
-       char qnx4fs_magic[10];  /* ignore first 4 bytes */
-       long bfs_magic;
-       struct ntfs_super_block ntfssb;
-       struct fat_super_block fatsb;
-       struct xfs_super_block xfsb;
-       struct cramfs_super_block cramfssb;
-       unsigned char data[512];
+      struct xiafs_super_block xiasb;
+      char romfs_magic[8];
+      char qnx4fs_magic[10];   /* ignore first 4 bytes */
+      long bfs_magic;
+      struct ntfs_super_block ntfssb;
+      struct fat_super_block fatsb;
+      struct xfs_super_block xfsb;
+      struct cramfs_super_block cramfssb;
+      unsigned char data[512];
     } xsb;
-#ifdef ALL_TYPES
-    struct ufs_super_block ufssb;
-#endif
+
+    /* block 0 */
+    if(
+      lseek(fd, 0, SEEK_SET) == 0 &&
+      read(fd, &xsb, sizeof xsb) == sizeof xsb
+    ) {
+      if(xiafsmagic(xsb.xiasb) == _XIAFS_SUPER_MAGIC) {
+        type = "xiafs";
+      }
+      else if(!strncmp(xsb.romfs_magic, "-rom1fs-", 8)) {
+        type = "romfs";
+      }
+      else if(!strncmp(xsb.xfsb.s_magic, XFS_SUPER_MAGIC, 4)) {
+        type = "xfs";
+      }
+      else if(!strncmp(xsb.qnx4fs_magic+4, "QNX4FS", 6)) {
+        type = "qnx4";
+      }
+      else if(xsb.bfs_magic == 0x1badface) {
+        type = "bfs";
+      }
+      else if(!strncmp(xsb.ntfssb.s_magic, NTFS_SUPER_MAGIC, sizeof 
xsb.ntfssb.s_magic)) {
+        type = "ntfs";
+      }
+      else if(
+        cramfsmagic(xsb.cramfssb) == CRAMFS_SUPER_MAGIC ||
+        cramfsmagic(xsb.cramfssb) == CRAMFS_SUPER_MAGIC_BIG
+      ) {
+        type = "cramfs";
+      }
+      else if(
+        xsb.data[0x1fe] == 0x55 &&
+        xsb.data[0x1ff] == 0xaa &&
+        xsb.data[0x0b] == 0 && /* bytes per sector, bits 0-7 */
+        (
+          (    /* FAT12/16 */
+            xsb.data[0x26] == 0x29 && (
+              !strncmp(xsb.fatsb.s_fs, "FAT12   ", 8) ||
+              !strncmp(xsb.fatsb.s_fs, "FAT16   ", 8)
+            )
+          ) ||
+          (    /* FAT32 */
+            xsb.data[0x42] == 0x29 &&
+            !strncmp(xsb.fatsb.s_fs2, "FAT32   ", 8)
+          )
+        )
+      ) {
+        type = "vfat";
+      }
+    }
+  }
+
+  if(!type) {
+    char buf[6];
+
+    if(
+      lseek(fd, 0, SEEK_SET) == 0 &&
+      read(fd, buf, sizeof buf) == sizeof buf
+    ) {
+      if(!memcmp(buf, "070701", 6) || !memcmp(buf, "\xc7\x71", 2)) type = 
"cpio";
+      else if(!memcmp(buf, "hsqs", 4) || !memcmp(buf, "sqsh", 4)) type = 
"squashfs";
+      else if(!memcmp(buf, "\xed\xab\xee\xdb", 4) && buf[4] >= 3) type = "rpm";
+    }
+  }
+
+  if(!type) {  /* sector 1 */
+    struct sysv_super_block svsb;
+
+    if(
+      lseek(fd, 512 , SEEK_SET) == 512 &&
+      read(fd, &svsb, sizeof svsb) == sizeof svsb &&
+      sysvmagic(svsb) == SYSV_SUPER_MAGIC
+    ) {
+      type = "sysv";
+    }
+  }
+
+  if(!type) {  /* block 1 */
     union {
-       struct iso_volume_descriptor iso;
-       struct hs_volume_descriptor hs;
-    } isosb;
-    struct reiserfs_super_block reiserfssb;    /* block 64 or 8 */
-    struct jfs_super_block jfssb;              /* block 32 */
-#ifdef ALL_TYPES
+      struct minix_super_block ms;
+      struct ext_super_block es;
+      struct ext2_super_block e2s;
+      struct vxfs_super_block vs;
+    } sb;
+
+    if(
+      lseek(fd, 1024, SEEK_SET) == 1024 &&
+      read(fd, &sb, sizeof sb) == sizeof sb
+    ) {
+      /*
+       * ext2 has magic in little-endian on disk, so "swapped" is
+       * superfluous; however, there have existed strange byteswapped
+       * PPC ext2 systems
+       */
+      if(
+        ext2magic(sb.e2s) == EXT2_SUPER_MAGIC ||
+        ext2magic(sb.e2s) == EXT2_PRE_02B_MAGIC ||
+        ext2magic(sb.e2s) == swapped(EXT2_SUPER_MAGIC)
+      ) {
+        type = "ext2";
+
+        if(
+          (assemble4le(sb.e2s.s_feature_compat) & 
EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
+          assemble4le(sb.e2s.s_journal_inum) != 0
+        ) {
+          type = "ext3";
+
+          if((assemble4le(sb.e2s.s_feature_incompat) & 
EXT4_FEATURE_INCOMPAT_EXTENTS)) {
+            type = "ext4";
+          }
+        }
+      }
+      else if(
+        minixmagic(sb.ms) == MINIX_SUPER_MAGIC ||
+        minixmagic(sb.ms) == MINIX_SUPER_MAGIC2 ||
+        minixmagic(sb.ms) == MINIX2_SUPER_MAGIC ||
+        minixmagic(sb.ms) == MINIX2_SUPER_MAGIC2
+      ) {
+        type = "minix";
+      }
+      else if(extmagic(sb.es) == EXT_SUPER_MAGIC) {
+        type = "ext";
+      }
+      else if(vxfsmagic(sb.vs) == VXFS_SUPER_MAGIC) {
+        type = "vxfs";
+      }
+    }
+  }
+
+  if(!type) {  /* block 1 */
     struct hfs_super_block hfssb;
-    struct hpfs_super_block hpfssb;
-    struct sysv_super_block svsb;
-#endif
-    struct stat64 statbuf;
 
-    /* opening and reading an arbitrary unknown path can have
-       undesired side effects - first check that `device' refers
-       to a block device */
-    if (stat64 (device, &statbuf) || !(S_ISBLK(statbuf.st_mode) || 
S_ISREG(statbuf.st_mode)))
-      return 0;
-
-    fd = open(device, O_RDONLY | O_LARGEFILE);
-    /* try harder */
-    if (fd < 0 && errno == ENOMEDIUM) fd = open(device, O_RDONLY | 
O_LARGEFILE);
-    if (fd < 0) {
-      if(config.debug) perror(device);
-      return 0;
-    }
-
-    /* do seeks and reads in disk order, otherwise a very short
-       partition may cause a failure because of read error */
-
-    if (!type) {
-        /* block 0 */
-        if (lseek(fd, 0, SEEK_SET) != 0
-            || read(fd, (char *) &xsb, sizeof(xsb)) != sizeof(xsb))
-             goto io_error;
-
-        if (xiafsmagic(xsb.xiasb) == _XIAFS_SUPER_MAGIC)
-             type = "xiafs";
-#ifdef ALL_TYPES
-        else if(!strncmp(xsb.romfs_magic, "-rom1fs-", 8))
-             type = "romfs";
-#endif
-        else if(!strncmp(xsb.xfsb.s_magic, XFS_SUPER_MAGIC, 4))
-             type = "xfs";
-#ifdef ALL_TYPES
-        else if(!strncmp(xsb.qnx4fs_magic+4, "QNX4FS", 6))
-             type = "qnx4";
-        else if(xsb.bfs_magic == 0x1badface)
-             type = "bfs";
-        else if(!strncmp(xsb.ntfssb.s_magic, NTFS_SUPER_MAGIC,
-                         sizeof(xsb.ntfssb.s_magic)))
-             type = "ntfs";
-#endif
-        else if(cramfsmagic(xsb.cramfssb) == CRAMFS_SUPER_MAGIC ||
-                cramfsmagic(xsb.cramfssb) == CRAMFS_SUPER_MAGIC_BIG)
-             type = "cramfs";
-        else if(
-                xsb.data[0x1fe] == 0x55 &&
-                xsb.data[0x1ff] == 0xaa &&
-                xsb.data[0x0b] == 0 && /* bytes per sector, bits 0-7 */
-                (
-                  (    /* FAT12/16 */
-                    xsb.data[0x26] == 0x29 && (
-                      !strncmp(xsb.fatsb.s_fs, "FAT12   ", 8) ||
-                      !strncmp(xsb.fatsb.s_fs, "FAT16   ", 8)
-                    )
-                  ) ||
-                  (    /* FAT32 */
-                    xsb.data[0x42] == 0x29 &&
-                    !strncmp(xsb.fatsb.s_fs2, "FAT32   ", 8)
-                  )
-                )
-              )
-              type = "vfat";
+    /*
+     * also check if block size is equal to 512 bytes,
+     * since the hfs driver currently only has support
+     * for block sizes of 512 bytes long, and to be
+     * more accurate (sb magic is only a short int)
+     */
+    if(
+      lseek(fd, 0x400, SEEK_SET) == 0x400 &&
+      read(fd, &hfssb, sizeof hfssb) == sizeof hfssb &&
+      (
+        (hfsmagic(hfssb) == HFS_SUPER_MAGIC && hfsblksize(hfssb) == 0x20000) ||
+        (swapped(hfsmagic(hfssb)) == HFS_SUPER_MAGIC && hfsblksize(hfssb) == 
0x200)
+      )
+    ) {
+      type = "hfs";
     }
+  }
+
+  if(!type) {  /* block 8 */
+    struct ufs_super_block ufssb;
 
-    if(!type) {
-      char buf[7];
+    if(
+      lseek(fd, 8192, SEEK_SET) == 8192 &&
+      read(fd, &ufssb, sizeof ufssb) == sizeof ufssb &&
+      ufsmagic(ufssb) == UFS_SUPER_MAGIC       /* also test swapped version? */
+    ) {
+      type = "ufs";
+    }
+  }
+
+  if(!type) {  /* block 8 */
+    struct reiserfs_super_block reiserfssb;
+
+    if(
+      lseek(fd, REISERFS_OLD_DISK_OFFSET_IN_BYTES, SEEK_SET) == 
REISERFS_OLD_DISK_OFFSET_IN_BYTES &&
+      read(fd, &reiserfssb, sizeof(reiserfssb)) == sizeof(reiserfssb) &&
+      is_reiserfs_magic_string(&reiserfssb)
+    ) {
+      type = "reiserfs";
+    }
+  }
 
-      if(
-        lseek(fd, 0, SEEK_SET) != 0 ||
-        read(fd, buf, sizeof buf - 1) != sizeof buf - 1
-      ) goto io_error;
+  if(!type) {  /* block 8 */
+    struct hpfs_super_block hpfssb;
 
-      buf[sizeof buf - 1] = 0;
-      if(!strcmp(buf, "070701")) type = "cpio";
-      else if(!memcmp(buf, "hsqs", 4) || !memcmp(buf, "sqsh", 4)) type = 
"squashfs";
-      else if(!memcmp(buf, "\xed\xab\xee\xdb", 4) && buf[4] >= 3) type = "rpm";
+    if(
+      lseek(fd, 0x2000, SEEK_SET) == 0x2000 &&
+      read(fd, &hpfssb, sizeof hpfssb) == sizeof hpfssb &&
+      hpfsmagic(hpfssb) == HPFS_SUPER_MAGIC
+    ) {
+      type = "hpfs";
+    }
+  }
+
+  if(!type) {  /* block 32 */
+    struct jfs_super_block jfssb;
+
+    if(
+      lseek(fd, JFS_SUPER1_OFF, SEEK_SET) == JFS_SUPER1_OFF &&
+      read(fd, &jfssb, sizeof jfssb) == sizeof jfssb &&
+      !strncmp(jfssb.s_magic, JFS_MAGIC, 4)
+    ) {
+      type = "jfs";
     }
+  }
 
-#ifdef ALL_TYPES
-    if (!type) {
-           /* sector 1 */
-           if (lseek(fd, 512 , SEEK_SET) != 512
-               || read(fd, (char *) &svsb, sizeof(svsb)) != sizeof(svsb))
-                   goto io_error;
-           if (sysvmagic(svsb) == SYSV_SUPER_MAGIC )
-                   type = "sysv";
-    }
-#endif
-
-    if (!type) {
-        unsigned ntype = 0;
-        char *type_str[] = { "ext2", "ext3", "ext4" };
-
-       /* block 1 */
-       if (lseek(fd, 1024, SEEK_SET) != 1024 ||
-           read(fd, (char *) &sb, sizeof(sb)) != sizeof(sb))
-               goto io_error;
-
-       /* ext2 has magic in little-endian on disk, so "swapped" is
-          superfluous; however, there have existed strange byteswapped
-          PPC ext2 systems */
-       if (ext2magic(sb.e2s) == EXT2_SUPER_MAGIC ||
-           ext2magic(sb.e2s) == EXT2_PRE_02B_MAGIC ||
-           ext2magic(sb.e2s) == swapped(EXT2_SUPER_MAGIC)) {
-               ntype = 2;
-
-            /* maybe even ext3? */
-            if ((assemble4le(sb.e2s.s_feature_compat)
-                 & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
-                assemble4le(sb.e2s.s_journal_inum) != 0)
-                    ntype = 3;
-
-            /* maybe ext4 */
-            if((assemble4le(sb.e2s.s_feature_incompat)
-                 & EXT4_FEATURE_INCOMPAT_EXTENTS) && ntype == 3)
-                    ntype = 4;
-
-             if(ntype) type = type_str[ntype - 2];
-       }
-
-       else if (minixmagic(sb.ms) == MINIX_SUPER_MAGIC ||
-                minixmagic(sb.ms) == MINIX_SUPER_MAGIC2 ||
-                minixmagic(sb.ms) == MINIX2_SUPER_MAGIC ||
-                minixmagic(sb.ms) == MINIX2_SUPER_MAGIC2)
-               type = "minix";
-
-#ifdef ALL_TYPES
-       else if (extmagic(sb.es) == EXT_SUPER_MAGIC)
-               type = "ext";
-#endif
-
-       else if (vxfsmagic(sb.vs) == VXFS_SUPER_MAGIC)
-               type = "vxfs";
-    }
-
-#ifdef ALL_TYPES
-    if (!type) {
-       /* block 1 */
-        if (lseek(fd, 0x400, SEEK_SET) != 0x400
-            || read(fd, (char *) &hfssb, sizeof(hfssb)) != sizeof(hfssb))
-             goto io_error;
-
-        /* also check if block size is equal to 512 bytes,
-           since the hfs driver currently only has support
-           for block sizes of 512 bytes long, and to be
-           more accurate (sb magic is only a short int) */
-        if ((hfsmagic(hfssb) == HFS_SUPER_MAGIC &&
-            hfsblksize(hfssb) == 0x20000) ||
-            (swapped(hfsmagic(hfssb)) == HFS_SUPER_MAGIC &&
-             hfsblksize(hfssb) == 0x200))
-             type = "hfs";
-    }
-#endif
-
-#ifdef ALL_TYPES
-    if (!type) {
-        /* block 8 */
-        if (lseek(fd, 8192, SEEK_SET) != 8192
-            || read(fd, (char *) &ufssb, sizeof(ufssb)) != sizeof(ufssb))
-             goto io_error;
-
-        if (ufsmagic(ufssb) == UFS_SUPER_MAGIC) /* also test swapped version? 
*/
-             type = "ufs";
-    }
-#endif
-
-    if (!type) {
-       /* block 8 */
-       if (lseek(fd, REISERFS_OLD_DISK_OFFSET_IN_BYTES, SEEK_SET) !=
-                               REISERFS_OLD_DISK_OFFSET_IN_BYTES
-           || read(fd, (char *) &reiserfssb, sizeof(reiserfssb)) !=
-               sizeof(reiserfssb))
-           goto io_error;
-       if (is_reiserfs_magic_string(&reiserfssb))
-           type = "reiserfs";
-    }
-
-#ifdef ALL_TYPES
-    if (!type) {
-       /* block 8 */
-        if (lseek(fd, 0x2000, SEEK_SET) != 0x2000
-            || read(fd, (char *) &hpfssb, sizeof(hpfssb)) != sizeof(hpfssb))
-             goto io_error;
-
-        if (hpfsmagic(hpfssb) == HPFS_SUPER_MAGIC)
-             type = "hpfs";
-    }
-#endif
-
-    if (!type) {
-        /* block 32 */
-        if (lseek(fd, JFS_SUPER1_OFF, SEEK_SET) != JFS_SUPER1_OFF
-            || read(fd, (char *) &jfssb, sizeof(jfssb)) != sizeof(jfssb))
-             goto io_error;
-        if (!strncmp(jfssb.s_magic, JFS_MAGIC, 4))
-             type = "jfs";
-    }
-
-    if (!type) {
-        /* block 32 */
-        if (lseek(fd, 0x8000, SEEK_SET) != 0x8000
-            || read(fd, (char *) &isosb, sizeof(isosb)) != sizeof(isosb))
-             goto io_error;
-
-        if(strncmp(isosb.iso.id, ISO_STANDARD_ID, sizeof(isosb.iso.id)) == 0
-           || strncmp(isosb.hs.id, HS_STANDARD_ID, sizeof(isosb.hs.id)) == 0)
-             type = "iso9660";
-#ifdef ALL_TYPES
-        else if (may_be_udf(isosb.iso.id))
-             type = "udf";
-#endif
-    }
-
-    if (!type) {
-       /* block 64 */
-       if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) !=
-               REISERFS_DISK_OFFSET_IN_BYTES
-           || read(fd, (char *) &reiserfssb, sizeof(reiserfssb)) !=
-               sizeof(reiserfssb))
-           goto io_error;
-       if (is_reiserfs_magic_string(&reiserfssb))
-           type = "reiserfs";
-    }
-
-    if (!type) {
-        char buf[8];
-        if (
-            lseek(fd, 0x10040, SEEK_SET) == 0x10040 &&
-            read(fd, buf, sizeof buf) == sizeof buf &&
-            !memcmp(buf, "_BHRfS_M", sizeof buf)
-        ) {
-            type = "btrfs";
-        }
+  if(!type) {  /* block 32 */
+    union {
+      struct iso_volume_descriptor iso;
+      struct hs_volume_descriptor hs;
+    } isosb;
+
+    if(
+      lseek(fd, 0x8000, SEEK_SET) == 0x8000 &&
+      read(fd, &isosb, sizeof isosb) == sizeof isosb
+    ) {
+      if(
+        !strncmp(isosb.iso.id, ISO_STANDARD_ID, sizeof(isosb.iso.id)) ||
+        !strncmp(isosb.hs.id, HS_STANDARD_ID, sizeof(isosb.hs.id))
+      ) {
+        type = "iso9660";
+      }
+      else if(may_be_udf(isosb.iso.id)) {
+        type = "udf";
+      }
+    }
+  }
+
+  if(!type) {  /* block 64 */
+    struct reiserfs_super_block reiserfssb;
+
+    if(
+      lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) == 
REISERFS_DISK_OFFSET_IN_BYTES &&
+      read(fd, &reiserfssb, sizeof reiserfssb) == sizeof reiserfssb &&
+      is_reiserfs_magic_string(&reiserfssb)
+    ) {
+      type = "reiserfs";
+    }
+  }
+
+  if(!type) {
+    char buf[8];
+
+    if(
+      lseek(fd, 0x10040, SEEK_SET) == 0x10040 &&
+      read(fd, buf, sizeof buf) == sizeof buf &&
+      !memcmp(buf, "_BHRfS_M", sizeof buf)
+    ) {
+      type = "btrfs";
+    }
+  }
+
+  if(!type) {
+    char buf[6];
+
+    if(
+      lseek(fd, 0x101, SEEK_SET) == 0x101 &&
+      read(fd, buf, sizeof buf) == sizeof buf &&
+      !memcmp(buf, "ustar", 6 /* with \0 */)
+    ) {
+      type = "tar";
+    }
+  }
+
+  if(!type) {
+    /*
+     * perhaps the user tries to mount the swap space
+     * on a new disk; warn her before she does mke2fs on it
+     */
+    int pagesize = getpagesize();
+    int rd;
+    char buf[pagesize + 32768];
+
+    rd = pagesize;
+    if(rd < 8192) rd = 8192;
+    if(rd > sizeof buf) rd = sizeof buf;
+    if(
+      lseek(fd, 0, SEEK_SET) == 0 &&
+      read(fd, buf, rd) == rd &&
+      (
+        may_be_swap(buf + pagesize) ||
+        may_be_swap(buf + 4096) ||
+        may_be_swap(buf + 8192)
+      )
+    ) {
+      type = "swap";
     }
+  }
 
-    if (!type) {
-           /* perhaps the user tries to mount the swap space
-              on a new disk; warn her before she does mke2fs on it */
-           int pagesize = getpagesize();
-           int rd;
-           char buf[pagesize + 32768];
-
-           rd = pagesize;
-           if (rd < 8192)
-                   rd = 8192;
-           if (rd > (int) sizeof(buf))
-                   rd = sizeof(buf);
-           if (lseek(fd, 0, SEEK_SET) != 0
-               || read(fd, buf, rd) != rd)
-                   goto io_error;
-           if (may_be_swap(buf+pagesize) ||
-               may_be_swap(buf+4096) || may_be_swap(buf+8192))
-                   type = "swap";
-    }
-
-    close (fd);
-    return(type);
-
-io_error:
-//    if (errno)
-//      perror(device);
-//    else
-//      fprintf(stderr, "fstype: error while guessing filesystem type\n");
-    close(fd);
-    return 0;
+  close(fd);
+
+  return type;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/global.h new/linuxrc-4.2.20/global.h
--- old/linuxrc-4.2.18/global.h 2014-04-11 09:49:55.000000000 +0200
+++ new/linuxrc-4.2.20/global.h 2014-04-24 14:35:53.000000000 +0200
@@ -368,7 +368,7 @@
   unsigned kexec_reboot:1;     /* kexec to installed system (just passed to 
yast) */
   unsigned nomodprobe:1;       /* disable modprobe */
   unsigned y2gdb:1;            /* pass to yast */
-  unsigned squash:1;           /* convert cpio/rpm to squashfs after download 
*/
+  unsigned squash:1;           /* convert archive files to squashfs after 
download */
   unsigned keepinstsysconfig:1;        /* don't reload instsys config data */
   unsigned device_by_id:1;     /* use /dev/disk/by-id device names */
   unsigned usesax2:1;          /* just passed to yast */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/install.c new/linuxrc-4.2.20/install.c
--- old/linuxrc-4.2.18/install.c        2013-12-03 11:41:26.000000000 +0100
+++ new/linuxrc-4.2.20/install.c        2014-04-24 14:35:53.000000000 +0200
@@ -45,7 +45,6 @@
 #include "install.h"
 #include "settings.h"
 #include "auto2.h"
-#include "fstype.h"
 #include "url.h"
 
 #ifndef MNT_DETACH
@@ -427,7 +426,7 @@
 
       sprintf(buf, "%s (%s)", sl->key, blk_ident(long_dev(sl->key)));
 
-      type = fstype(long_dev(sl->key));
+      type = util_fstype(long_dev(sl->key), NULL);
 
       if(type && !strcmp(type, "swap")) {
         values1[item_cnt1] = strdup(sl->key);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/linuxrc.c new/linuxrc-4.2.20/linuxrc.c
--- old/linuxrc-4.2.18/linuxrc.c        2014-04-11 14:23:16.000000000 +0200
+++ new/linuxrc-4.2.20/linuxrc.c        2014-04-24 14:35:53.000000000 +0200
@@ -44,6 +44,7 @@
 #include "scsi_rename.h"
 #include "checkmedia.h"
 #include "url.h"
+#include <sys/utsname.h>
 
 #if defined(__alpha__) || defined(__ia64__)
 #define SIGNAL_ARGS    int signum, int x, struct sigcontext *scp
@@ -96,6 +97,7 @@
   { "scsi_rename", scsi_rename_main      },
   { "lndir",       util_lndir_main       },
   { "extend",      util_extend_main      },
+  { "fstype",      util_fstype_main      },
 };
 #endif
 
@@ -712,6 +714,13 @@
       config.hwp.hypervisor = "Unknown";
     }
   }
+  else {
+    struct utsname utsinfo;
+
+    uname(&utsinfo);
+    if(!strncmp(utsinfo.machine, "s390x", sizeof "s390x" - 1 )) 
config.hwp.hypervisor="KVM";
+    else config.hwp.hypervisor="Reallyunknown";
+  }
   #endif
 
   /* add cmdline to info file */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/net.c new/linuxrc-4.2.20/net.c
--- old/linuxrc-4.2.18/net.c    2014-04-11 13:49:26.000000000 +0200
+++ new/linuxrc-4.2.20/net.c    2014-04-24 14:35:53.000000000 +0200
@@ -1353,7 +1353,7 @@
      IUCV is available for use unless the driver is already loaded. So,
      if we're running on z/VM we always load it, no matter what.       */
   #if defined(__s390__) || defined(__s390x__)
-  if(strncmp(config.hwp.hypervisor,"z/VM",4)==0) {
+  if(!strncmp(config.hwp.hypervisor, "z/VM", sizeof "z/VM" - 1 )) {
      dia_info(&win, "We are running on z/VM", MSGTYPE_INFO);
      dia_info(&win, "Loading the IUCV network driver", MSGTYPE_INFO);
      mod_modprobe("netiucv","");
@@ -1871,9 +1871,12 @@
 
   net_apply_ethtool(config.net.device, config.net.hwaddr);
 
-  // FIXME: config.net.dhcp_timeout
-
-  sprintf(cmd, "wicked ifup %s", config.net.device);
+  if(config.net.dhcp_timeout_set) {
+    sprintf(cmd, "wicked ifup --timeout %d %s", config.net.dhcp_timeout, 
config.net.device);
+  }
+  else {
+    sprintf(cmd, "wicked ifup %s", config.net.device);
+  }
 
   sprintf(file, "/var/run/wicked/leaseinfo.%s.dhcp.ipv4", config.net.device);
 
@@ -2440,7 +2443,8 @@
     break;
   default:
     return -1;
-  } else {     /* no hd_t entry -> ask */
+  }
+  else {       /* no hd_t entry -> ask */
     dia_item_t di;
     dia_item_t items[] = {
       di_390net_osa,
@@ -2451,14 +2455,18 @@
       di_390net_iucv,
       di_none
     };
-  
+    if(!strncmp(config.hwp.hypervisor, "KVM", sizeof "KVM" - 1)) {
+      items[0] = di_390net_virtio;
+      items[1] = di_none;
+    }
+
     IFNOTAUTO(config.hwp.type) {
       di = dia_menu2("Please select the type of your network device.", 60, 0, 
items, config.hwp.type?:di_390net_iucv);
       config.hwp.type = di;
-    } else di = config.hwp.type;
+    }
+    else di = config.hwp.type;
   }
-       
-  
+
   /* hwcfg parms common to all devices */
   config.hwp.startmode="auto";
   config.hwp.module_options="";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/url.c new/linuxrc-4.2.20/url.c
--- old/linuxrc-4.2.18/url.c    2014-03-26 08:09:51.000000000 +0100
+++ new/linuxrc-4.2.20/url.c    2014-04-24 14:35:53.000000000 +0200
@@ -158,7 +158,7 @@
           free(buf);
         }
         url_data->err = 103;
-        snprintf(url_data->err_buf, url_data->err_buf_len, "gzip: command 
terminated");
+        snprintf(url_data->err_buf, url_data->err_buf_len, "%s: command 
terminated", url_data->compressed);
       }
       // fprintf(stderr, "close = %d\n", i);
     }
@@ -217,17 +217,17 @@
     (url_data->buf.len == url_data->buf.max || url_data->flush) &&
     url_data->buf.len >= 11
   ) {
-    if(
-      url_data->unzip &&
-      url_data->buf.data[0] == 0x1f &&
-      url_data->buf.data[1] == 0x8b
-    ) {
-      url_data->gzip = 1;
+    if(url_data->unzip) {
+      str_copy(&url_data->compressed, compress_type(url_data->buf.data));
+    }
 
-      if((url_data->buf.data[3] & 0x08)) {
-        i = strnlen((char *) url_data->buf.data + 10, url_data->buf.len - 10);
-        if(i < url_data->buf.len - 10) {
-          url_data->orig_name = strdup((char *) url_data->buf.data + 10);
+    if(url_data->compressed) {
+      if(!strcmp(url_data->compressed, "gzip")) {
+        if((url_data->buf.data[3] & 0x08)) {
+          i = strnlen((char *) url_data->buf.data + 10, url_data->buf.len - 
10);
+          if(i < url_data->buf.len - 10) {
+            url_data->orig_name = strdup((char *) url_data->buf.data + 10);
+          }
         }
       }
     }
@@ -256,7 +256,7 @@
   if(url_data->buf.len == url_data->buf.max || url_data->flush) {
     if(!url_data->file_opened) {
       url_data->file_opened = 1;
-      if(url_data->gzip) {
+      if(url_data->compressed) {
         url_data->tmp_file = strdup("/tmp/foo_XXXXXX");
         tmp = mkstemp(url_data->tmp_file);
         if(tmp > 0) {
@@ -267,7 +267,9 @@
             dup2(fd, 1);
             dup2(tmp, 2);
             url_data->pipe_fd = fd;
-            url_data->f = popen("gzip -dc", "w");
+            char cmd[64];
+            snprintf(cmd, sizeof cmd, "%s -dc", url_data->compressed);
+            url_data->f = popen(cmd, "w");
             dup2(fd1, 1);
             dup2(fd2, 2);
             url_data->zp_total = url_data->image_size << 10;
@@ -913,6 +915,7 @@
   free(url_data->tmp_file);
   free(url_data->buf.data);
   free(url_data->label);
+  free(url_data->compressed);
 
   free(url_data);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/url.h new/linuxrc-4.2.20/url.h
--- old/linuxrc-4.2.18/url.h    2013-11-18 14:06:40.000000000 +0100
+++ new/linuxrc-4.2.20/url.h    2014-04-24 14:35:53.000000000 +0200
@@ -17,12 +17,12 @@
   unsigned zp_now, zp_total;
   unsigned z_progress:1;
   unsigned flush:1;
-  unsigned gzip:1;
   unsigned cramfs:1;
   unsigned file_opened:1;
   unsigned unzip:1;
   unsigned label_shown:1;
   unsigned optional:1;
+  char *compressed;            // program name used for compression, if any
   char *label;
   int percent;
   int pipe_fd;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/util.c new/linuxrc-4.2.20/util.c
--- old/linuxrc-4.2.18/util.c   2014-04-11 13:51:30.000000000 +0200
+++ new/linuxrc-4.2.20/util.c   2014-04-24 14:35:53.000000000 +0200
@@ -2400,6 +2400,36 @@
 }
 
 
+int util_fstype_main(int argc, char **argv)
+{
+  char *s, buf[64], *compr, *archive;
+
+  argv++; argc--;
+
+  if(!argc) return fprintf(stderr, "usage: fstype blockdevice\n"), 1;
+
+  while(argc--) {
+    s = fstype(*argv);
+    if(
+      !s &&
+      (compr = compressed_archive(*argv, &archive))
+    ) {
+      if(archive) {
+        snprintf(buf, sizeof buf, "%s.%s", archive, compr);
+        s = buf;
+      }
+      else {
+        s = compr;
+      }
+    }
+    printf("%s: %s\n", *argv, s ?: "unknown fs");
+    argv++;
+  }
+
+  return 0;
+}
+
+
 /*
  * Return fs name. If we have to load a module first, return it in *module.
  */
@@ -2420,6 +2450,7 @@
 
     if(
       !strcmp(type, "cpio") ||
+      !strcmp(type, "tar") ||
       !strcmp(type, "rpm") ||
       (config.ntfs_3g && !strcmp(type, "ntfs"))
     ) {
@@ -2596,6 +2627,7 @@
 int util_mount(char *dev, char *dir, unsigned long flags, slist_t *file_list)
 {
   char *type, *loop_dev, *cmd = NULL, *module, *tmp_dev, *cpio_opts = NULL, 
*s, *buf = NULL;
+  char *compr = NULL;
   int err = -1;
   struct stat64 sbuf;
 
@@ -2630,9 +2662,15 @@
   type = util_fstype(dev, &module);
   if(module) mod_modprobe(module, NULL);
 
+  if(!type) compr = compressed_archive(dev, &type);
+
+  fprintf(stderr, "%s: type = %s.%s\n", dev, type ?: "", compr ?: "");
+
+  LXRC_WAIT
+
   if(
     type &&
-    (!strcmp(type, "cpio") || !strcmp(type, "rpm"))
+    (!strcmp(type, "cpio") || !strcmp(type, "tar") || !strcmp(type, "rpm"))
   ) {
     char *buf = NULL;
     char *msg;
@@ -2654,9 +2692,18 @@
     }
 
     if(!strcmp(type, "cpio")) {
-      strprintf(&buf, "cd %s ; cpio %s < %s", dir, cpio_opts, dev);
+      if(compr) {
+        strprintf(&buf, "cd %s ; %s -dc %s | cpio %s", dir, compr, dev, 
cpio_opts);
+      }
+      else {
+        strprintf(&buf, "cd %s ; cpio %s < %s", dir, cpio_opts, dev);
+      }
       msg = "cpio";
     }
+    else if(!strcmp(type, "tar")) {
+      strprintf(&buf, "cd %s ; tar -xpf %s", dir, dev);
+      msg = "tar";
+    }
     else {
       strprintf(&buf, "cd %s ; rpm2cpio %s | cpio %s", dir, dev, cpio_opts);
       msg = "rpm unpacking";
@@ -4649,3 +4696,74 @@
   ) config.net.ptp = 1;
 }
 
+
+/*
+ * buf: at least 6 bytes
+ */
+char *compress_type(void *buf)
+{
+  if(!memcmp(buf, "\x1f\x8b", 2)) {
+    return "gzip";
+  }
+
+  if(!memcmp(buf, "\xfd""7zXZ", 6) /* yes, including final \0 */) {
+    return "xz";
+  }
+
+  return NULL;
+}
+
+
+char *compressed_file(char *name)
+{
+  int fd;
+  char buf[8];
+  char *compr = NULL;
+
+  fd = open(name, O_RDONLY | O_LARGEFILE);
+
+  if(fd >= 0) {
+    if(read(fd, buf, sizeof buf) == sizeof buf) {
+      compr = compress_type(buf);
+    }
+
+    close(fd);
+  }
+  else {
+    if(config.debug) perror(name);
+  }
+
+  return compr;
+}
+
+
+char *compressed_archive(char *name, char **archive)
+{
+  char *compr = compressed_file(name);
+  char buf1[64], buf2[0x108];
+  FILE *f;
+  char *type = NULL;
+
+  if(!archive) return compr;
+
+  if(compr) {
+    snprintf(buf1, sizeof buf1, "%s -dc %s", compr, name);
+
+    if((f = popen(buf1, "r"))) {
+      if(fread(buf2, 1, sizeof buf2, f) == sizeof buf2) {
+        if(!memcmp(buf2, "070701", 6)) type = "cpio";
+        if(!memcmp(buf2, "\xc7\x71", 2)) type = "cpio";
+        if(!memcmp(buf2 + 0x101, "ustar", 6 /* with \0 */)) type = "tar";
+      }
+
+      pclose(f);
+    }
+  }
+
+  *archive = type;
+
+  if(config.debug) fprintf(stderr, "%s = %s.%s\n", name, type ?: "", compr ?: 
"");
+
+  return compr;
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/linuxrc-4.2.18/util.h new/linuxrc-4.2.20/util.h
--- old/linuxrc-4.2.18/util.h   2014-04-11 13:39:52.000000000 +0200
+++ new/linuxrc-4.2.20/util.h   2014-04-24 14:35:53.000000000 +0200
@@ -77,6 +77,7 @@
 void util_free_mem(void);
 void util_update_meminfo(void);
 
+int util_fstype_main(int argc, char **argv);
 char *util_fstype(char *dev, char **module);
 int util_mount(char *dev, char *dir, unsigned long flags, slist_t *file_list);
 int util_mount_ro(char *dev, char *dir, slist_t *file_list);
@@ -154,3 +155,7 @@
 
 void check_ptp(void);
 
+char *compress_type(void *buf);
+char *compressed_file(char *name);
+char *compressed_archive(char *name, char **archive);
+

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to