Hello community,

here is the log from the commit of package kiwi for openSUSE:Factory checked in 
at 2016-02-09 16:48:59
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kiwi (Old)
 and      /work/SRC/openSUSE:Factory/.kiwi.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kiwi"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kiwi/kiwi.changes        2016-01-28 
17:18:34.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.kiwi.new/kiwi.changes   2016-02-09 
16:49:01.000000000 +0100
@@ -1,0 +2,117 @@
+Fri Feb  5 16:02:19 CET 2016 - [email protected]
+
+- v7.03.53 released
+  
+-------------------------------------------------------------------
+Fri Feb  5 16:00:16 CET 2016 - [email protected]
+  
+- Fixed disk bundler for install stick target
+  
+  The bundler looked up the wrong extension. This fixes #542
+  
+-------------------------------------------------------------------
+Fri Feb  5 15:43:12 CET 2016 - [email protected]
+  
+- Preserve package cache only if it exists
+  
+-------------------------------------------------------------------
+Fri Feb  5 09:56:08 CET 2016 - [email protected]
+  
+- v7.03.52 released
+  
+-------------------------------------------------------------------
+Fri Feb  5 09:44:31 CET 2016 - [email protected]
+  
+- Fixed use of noglob shell option
+  
+-------------------------------------------------------------------
+Wed Feb  3 15:55:40 CET 2016 - [email protected]
+  
+- v7.03.51 released
+  
+-------------------------------------------------------------------
+Wed Feb  3 12:27:11 CET 2016 - [email protected]
+  
+- Fixed updateRootDeviceFstab
+  
+  Support by-label mount entries for btrfs subvolumes
+  This fixes bnc#964474
+  
+-------------------------------------------------------------------
+Tue Feb  2 16:33:03 CET 2016 - [email protected]
+  
+- Don't add kernel filesystems to fstab
+  
+  Systems with systemd which this kiwi version aims for, doesn't
+  need proc, sysfs, debugfs and friends to be part of the fstab
+  This fixes bnc#964472
+  
+-------------------------------------------------------------------
+Mon Feb  1 09:02:57 CET 2016 - [email protected]
+  
+- Update rhel6 template
+  
+  Added Vagrantfile to build via dice
+  
+-------------------------------------------------------------------
+Mon Feb  1 09:02:23 CET 2016 - [email protected]
+  
+- Update rhel6 template
+  
+  delete unused oracle linux build target
+  
+-------------------------------------------------------------------
+Fri Jan 29 13:43:57 CET 2016 - [email protected]
+  
+- v7.03.50 released
+  
+-------------------------------------------------------------------
+Wed Jan 27 16:16:35 CET 2016 - [email protected]
+  
+- Allow system to be installed on btrfs snapshot
+  
+  This fixes (bnc#946648)
+  
+-------------------------------------------------------------------
+Wed Jan 27 15:15:54 CET 2016 - [email protected]
+  
+- Put kiwi_btrfs_root_is_snapshot to boot profile
+  
+  This is related to (bnc#946648)
+  
+-------------------------------------------------------------------
+Wed Jan 27 14:57:07 CET 2016 - [email protected]
+  
+- Evaluate kiwi_btrfs_root_is_snapshot in boot code
+  
+  If set it's required to mount the subvolumes like it is
+  done with lvm volumes. In addition this patch fixes the
+  update of the fstab file which has to contain an entry
+  for each subvolume excluding snapshots and the toplevel
+  This is related to (bnc#946648)
+  
+-------------------------------------------------------------------
+Wed Jan 27 14:46:19 CET 2016 - [email protected]
+  
+- Added get/set(er) for btrfs_root_is_snapshot attr
+  
+  This is related to (bnc#946648)
+  
+-------------------------------------------------------------------
+Wed Jan 27 14:40:42 CET 2016 - [email protected]
+  
+- Added btrfs_root_is_snapshot attribute
+  
+  This is related to (bnc#946648)
+  
+-------------------------------------------------------------------
+Wed Jan 20 12:16:46 CET 2016 - [email protected]
+  
+- Fixed pxe type setup for s390 SLE12-community-JeOS
+  
+-------------------------------------------------------------------
+Wed Jan 20 12:01:47 CET 2016 - [email protected]
+  
+- Added util-linux to SLE12-community-JeOS for s390
+  
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ kiwi.spec ++++++
--- /var/tmp/diff_new_pack.YqHHrK/_old  2016-02-09 16:49:03.000000000 +0100
+++ /var/tmp/diff_new_pack.YqHHrK/_new  2016-02-09 16:49:03.000000000 +0100
@@ -27,7 +27,7 @@
 Name:           kiwi
 License:        GPL-2.0
 Group:          System/Management
-Version:        7.03.49
+Version:        7.03.53
 Provides:       kiwi-schema = 6.2
 Provides:       kiwi-image:aci
 Provides:       kiwi-image:lxc

++++++ kiwi-docu.tar.bz2 ++++++

++++++ kiwi-repo.tar.bz2 ++++++

++++++ kiwi.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/.revision new/kiwi/.revision
--- old/kiwi/.revision  2015-12-17 09:28:28.000000000 +0100
+++ new/kiwi/.revision  2015-12-17 09:28:28.000000000 +0100
@@ -1 +1 @@
-93052054fee85c16a6b1236a5d23144c77542f3a
+46c29b431f98d68f651a34cc0059c3d689ebf874
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIBoot.pm new/kiwi/modules/KIWIBoot.pm
--- old/kiwi/modules/KIWIBoot.pm        2015-12-22 09:39:43.000000000 +0100
+++ new/kiwi/modules/KIWIBoot.pm        2016-01-29 11:53:03.000000000 +0100
@@ -301,6 +301,7 @@
         $type{bootpartition}          = $xmltype -> getBootPartition();
         $type{bootpartsize}           = $xmltype -> getBootPartitionSize();
         $type{boottimeout}            = $xmltype -> getBootTimeout();
+        $type{btrfs_root_is_snapshot} = $xmltype -> getBtrfsRootIsSnapshot();
         $type{cmdline}                = $xmltype -> getKernelCmdOpts();
         $type{filesystem}             = $xmltype -> getFilesystem();
         $type{firmware}               = $xmltype -> getFirmwareType();
@@ -2682,7 +2683,10 @@
             if ($FSTypeRW eq 'btrfs') {
                 if (! KIWIGlobals
                     -> instance()
-                    -> setupBTRFSSubVolumes ($loopdir,\%lvmparts)) {
+                    -> setupBTRFSSubVolumes (
+                        $loopdir,\%lvmparts,
+                        $type->{btrfs_root_is_snapshot},$root
+                    )) {
                     $this -> cleanStack ();
                     return;
                 }
@@ -2702,13 +2706,12 @@
         $kiwi -> info ("Copying system image tree on disk");
         my $btrfs_sub_vol = '';
         my $rsync_cmd = 'rsync -aHXA --one-file-system ';
-        if (-e $loopdir.'/@') {
-            # /.../
-            # if we found the special btrfs subvolume named @ we
-            # sync only this volume and not the other nested sub
-            # volumes
-            # ----
-            $btrfs_sub_vol = '/@';
+        if (-e $loopdir.'/@/.snapshots') {
+            # sync target is a btrfs snapshot
+            $btrfs_sub_vol = '/@/.snapshots/1/snapshot/';
+        } elsif (-e $loopdir.'/@') {
+            # sync target is a btrfs toplevel
+            $btrfs_sub_vol = '/@/';
         }
         $status = KIWIQX::qxx (
             $rsync_cmd.$system.'/ '.$loopdir.$btrfs_sub_vol.' 2>&1'
@@ -3722,9 +3725,28 @@
         my $bootpath = '/boot';
         if (($type ne 'iso') && (! $this->{needBootP})) {
             if (($typeinfo->{filesystem} eq 'btrfs') && ($this->{sysdisk})) {
-                my $volumes = $this->{sysdisk} -> getVolumes();
-                if (($volumes) && (keys %{$volumes} > 0)) {
-                    $bootpath = '/@/boot';
+                my $volIDs = $this->{sysdisk} -> getVolumeIDs();
+                if ($volIDs) {
+                    my $boot_is_on_volume = 0;
+                    for my $id (@{$volIDs}) {
+                        my $name = $this->{sysdisk} -> getVolumeName($id);
+                        my $mount= $this->{sysdisk} -> 
getVolumeMountPoint($id);
+                        my $path = $name;
+                        if ($mount) {
+                            $path = $mount;
+                        }
+                        $path =~ s/^\/+//;
+                        if (($path eq 'boot') || ($path eq 'boot/grub2')) {
+                            $boot_is_on_volume = 1;
+                            last;
+                        }
+                    }
+                    my $snapshot = $typeinfo->{btrfs_root_is_snapshot};
+                    if ((! $boot_is_on_volume) && ($snapshot eq 'true')) {
+                        $bootpath = '/@/.snapshots/1/snapshot/boot';
+                    } else {
+                        $bootpath = '/@/boot';
+                    }
                 }
             }
         }
@@ -4423,10 +4445,30 @@
         my $bootpath = '/boot';
         if ((! $iso) && (! $this->{needBootP})) {
             if (($type->{filesystem} eq 'btrfs') && ($this->{sysdisk})) {
-                my $volumes = $this->{sysdisk} -> getVolumes();
-                if (($volumes) && (keys %{$volumes} > 0)) {
-                    $bootpath = '/@/boot';
-                    $fodir = '/@/boot/grub2/themes/';
+                my $volIDs = $this->{sysdisk} -> getVolumeIDs();
+                if ($volIDs) {
+                    my $boot_is_on_volume = 0;
+                    for my $id (@{$volIDs}) {
+                        my $name = $this->{sysdisk} -> getVolumeName($id);
+                        my $mount= $this->{sysdisk} -> 
getVolumeMountPoint($id);
+                        my $path = $name;
+                        if ($mount) {
+                            $path = $mount;
+                        }
+                        $path =~ s/^\/+//;
+                        if (($path eq 'boot') || ($path eq 'boot/grub2')) {
+                            $boot_is_on_volume = 1;
+                            last;
+                        }
+                    }
+                    my $snapshot = $type->{btrfs_root_is_snapshot};
+                    if ((! $boot_is_on_volume) && ($snapshot eq 'true')) {
+                        $bootpath = '/@/.snapshots/1/snapshot/boot';
+                        $fodir = '/@/.snapshots/1/snapshot/boot/grub2/themes/';
+                    } else {
+                        $bootpath = '/@/boot';
+                        $fodir = '/@/boot/grub2/themes/';
+                    }
                 }
             }
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIConfig.sh 
new/kiwi/modules/KIWIConfig.sh
--- old/kiwi/modules/KIWIConfig.sh      2015-12-22 09:39:43.000000000 +0100
+++ new/kiwi/modules/KIWIConfig.sh      2016-02-05 09:43:10.000000000 +0100
@@ -716,11 +716,13 @@
         /base-system/ /.broken /.buildenv .bash_history /.kconfig /.profile
         /etc/mtab
     "
-    set -o noglob on
+    # disable globbing
+    set -o noglob
     for entry in $files;do
         echo $entry >> .gitignore
     done
-    set -o noglob off
+    # enable globbing
+    set +o noglob
     git init && git add -A && \
     git commit -m "deployed"
     popd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIGlobals.pm 
new/kiwi/modules/KIWIGlobals.pm
--- old/kiwi/modules/KIWIGlobals.pm     2016-01-14 12:53:24.000000000 +0100
+++ new/kiwi/modules/KIWIGlobals.pm     2016-02-05 16:02:11.000000000 +0100
@@ -992,7 +992,10 @@
     my $this   = shift;
     my $path   = shift;
     my $vols   = shift;
+    my $snapshot = shift;
+    my $device = shift;
     my $kiwi   = $this->{kiwi};
+    my @UmountStack = @{$this->{UmountStack}};
     my %phash  = ();
     my @paths  = ();
     if ($vols) {
@@ -1013,24 +1016,30 @@
         }
     }
     if (! %phash) {
-        return $path;
+        return $this;
     }
     $kiwi -> info ("Creating btrfs pool\n");
     my $data = KIWIQX::qxx ('btrfs subvolume create '.$path.'/@ 2>&1');
     my $code = $? >> 8;
-    if ($code == 0) {
-        my $rootID=0;
-        $data = KIWIQX::qxx ("btrfs subvolume list $path 2>&1");
-        if ($data =~ /^ID (\d+) /) {
-            $rootID=$1;
+    if ($snapshot eq 'true') {
+        if ($code == 0) {
+            $data = KIWIQX::qxx (
+                'btrfs subvolume create '.$path.'/@/.snapshots 2>&1'
+            );
+            $code = $? >> 8;
         }
-        if ($rootID) {
+        if ($code == 0) {
             $data = KIWIQX::qxx (
-                "btrfs subvolume set-default $rootID $path 2>&1"
+                'mkdir -p '.$path.'/@/.snapshots/1 2>&1'
+            );
+            $code = $? >> 8;
+        }
+        if ($code == 0) {
+            my $snapshot_path = "$path/@/.snapshots/1/snapshot";
+            $data = KIWIQX::qxx (
+                "btrfs subvolume snapshot $path/@ $snapshot_path 2>&1"
             );
             $code = $? >> 8;
-        } else {
-            $code = 1;
         }
     }
     if ($code == 0) {
@@ -1050,6 +1059,19 @@
                     );
                     $code = $? >> 8;
                 }
+                if ($snapshot eq 'true') {
+                    my $snapshot_path = "$path/@/.snapshots/1/snapshot";
+                    my $subvol = "-o subvol=@/$vol";
+                    KIWIQX::qxx ("mkdir -p $snapshot_path/$vol");
+                    $data = KIWIQX::qxx (
+                        "mount $device $snapshot_path/$vol $subvol 2>&1"
+                    );
+                    $code = $? >> 8;
+                    if ($code == 0) {
+                        push @UmountStack,"umount $snapshot_path/$vol";
+                        $this->{UmountStack} = \@UmountStack;
+                    }
+                }
                 if ($code == 0) {
                     $kiwi -> done();
                 } else {
@@ -1059,13 +1081,59 @@
             }
         }
     }
+    if ($code == 0) {
+        if ($snapshot eq 'true') {
+            $this -> setupBtrfsDefaultVolume($path, '@/.snapshots/1/snapshot');
+        } else {
+            $this -> setupBtrfsDefaultVolume($path, '@');
+        }
+    }
     if ($code != 0) {
         $kiwi -> error ("Failed to create btrfs subvolume: $data\n");
         $kiwi -> failed();
         return;
     }
-    $path.='/@';
-    return $path;
+    return $this;
+}
+
+#==========================================
+# setupBtrfsDefaultVolume
+#------------------------------------------
+sub setupBtrfsDefaultVolume {
+    # /.../
+    # set default volume for btrfs tree
+    # ----
+    my $this = shift;
+    my $path = shift;
+    my $default_volume = shift;
+    my $kiwi = $this->{kiwi};
+    if (! $default_volume) {
+        $default_volume = '@';
+    }
+    $kiwi -> info("Setting btrfs default volume to: $default_volume\n");
+    my $rootID=0;
+    my $data = KIWIQX::qxx ("btrfs subvolume list $path 2>&1");
+    my $code = $? >> 8;
+    if ($code == 0) {
+        foreach my $line (split('\n', $data)) {
+            my @elements = split(' ', $line);
+            my $volume_path = $elements[8];
+            my $volume_id = $elements[1];
+            if ($volume_path eq $default_volume) {
+                $rootID = $volume_id;
+                last;
+            }
+        }
+        if ($rootID) {
+            $data = KIWIQX::qxx (
+                "btrfs subvolume set-default $rootID $path 2>&1"
+            );
+            $code = $? >> 8;
+        } else {
+            $code = 1;
+        }
+    }
+    return $code;
 }
 
 #==========================================
@@ -1933,7 +2001,7 @@
     # Globals (generic)
     #------------------------------------------
     my %data;
-    $data{Version}         = "7.03.49";
+    $data{Version}         = "7.03.53";
     $data{Publisher}       = "SUSE LINUX GmbH";
     $data{Preparer}        = "KIWI - http://opensuse.github.com/kiwi";;
     $data{ConfigName}      = "config.xml";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIImage.pm 
new/kiwi/modules/KIWIImage.pm
--- old/kiwi/modules/KIWIImage.pm       2015-11-30 12:44:35.000000000 +0100
+++ new/kiwi/modules/KIWIImage.pm       2016-01-29 11:53:03.000000000 +0100
@@ -3445,7 +3445,7 @@
         if (($fstype) && ($fstype eq 'btrfs')) {
             $extend = KIWIGlobals
                 -> instance()
-                -> setupBTRFSSubVolumes ($extend);
+                -> setupBTRFSSubVolumes ($extend,undef,'false',$device);
             if (! $extend) {
                 $this -> cleanLuks();
                 return;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIImageCreator.pm 
new/kiwi/modules/KIWIImageCreator.pm
--- old/kiwi/modules/KIWIImageCreator.pm        2015-09-21 16:23:18.000000000 
+0200
+++ new/kiwi/modules/KIWIImageCreator.pm        2016-01-29 11:53:02.000000000 
+0100
@@ -2119,6 +2119,15 @@
         $kiwi -> done();
     }
     #==========================================
+    # btrfs_root_is_snapshot
+    #------------------------------------------
+    my $btrfs_root_is_snapshot = $systemType -> getBtrfsRootIsSnapshot();
+    if ($btrfs_root_is_snapshot) {
+        $kiwi -> info ("--> btrfs_root_is_snapshot: $btrfs_root_is_snapshot");
+        $bootType -> setBtrfsRootIsSnapshot ($btrfs_root_is_snapshot);
+        $kiwi -> done();
+    }
+    #==========================================
     # fsmountoptions
     #------------------------------------------
     my $fsmountoptions = $systemType -> getFSMountOptions();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWILinuxRC.sh 
new/kiwi/modules/KIWILinuxRC.sh
--- old/kiwi/modules/KIWILinuxRC.sh     2016-01-14 12:50:28.000000000 +0100
+++ new/kiwi/modules/KIWILinuxRC.sh     2016-02-03 12:26:58.000000000 +0100
@@ -3500,6 +3500,28 @@
     echo "USERCONTROL='no'"    >> $niface
 }
 #======================================
+# getBtrfsSubVolumes
+#--------------------------------------
+function getBtrfsSubVolumes {
+    local IFS=$IFS_ORIG
+    local prefix=$1
+    btrfs subvol list $prefix | \
+        grep -v .snapshots/ | grep -v @$ | cut -f9 -d ' '
+}
+#======================================
+# mountBtrfsSubVolumes
+#--------------------------------------
+function mountBtrfsSubVolumes {
+    local IFS=$IFS_ORIG
+    local mountDevice=$1
+    local prefix=$2
+    local syspath
+    for subvol in $(getBtrfsSubVolumes "$prefix"); do
+        syspath=$(echo $subvol | tr -d @)
+        mount $mountDevice $prefix/$syspath -o subvol=$subvol
+    done
+}
+#======================================
 # setupDefaultFstab
 #--------------------------------------
 function setupDefaultFstab {
@@ -3507,21 +3529,35 @@
     # Update or create new /etc/fstab file with the default entries
     # ----
     local IFS=$IFS_ORIG
-    local prefix=$1
-    local nfstab=$prefix/etc/fstab
-    mkdir -p $prefix/etc
-    grep -q devpts $nfstab || \
-        echo "devpts  /dev/pts          devpts  mode=0620,gid=5 0 0"  >> 
$nfstab
-    grep -q proc $nfstab || \
-        echo "proc    /proc             proc    defaults        0 0"  >> 
$nfstab
-    grep -q sysfs $nfstab || \
-        echo "sysfs   /sys              sysfs   noauto          0 0"  >> 
$nfstab
-    grep -q debugfs $nfstab || test -e /sys/kernel/debug && \
-        echo "debugfs /sys/kernel/debug debugfs noauto          0 0"  >> 
$nfstab
-    grep -q usbfs $nfstab || test -e /proc/bus/usb && \
-        echo "usbfs   /proc/bus/usb     usbfs   noauto          0 0"  >> 
$nfstab
-    grep -q /run $nfstab || test -e /run && \
-        echo "tmpfs   /run              tmpfs   noauto          0 0"  >> 
$nfstab
+    local prefix=/mnt
+    local config_tmp=$1
+    local nfstab=$config_tmp/etc/fstab
+    mkdir -p $config_tmp/etc
+    if [ -e "$prefix/etc/fstab" ];then
+        cp $prefix/etc/fstab $config_tmp/etc
+    else
+        touch $config_tmp/etc/fstab
+    fi
+    if [ ! -e "$prefix/bin/systemd" ];then
+        grep -q devpts $nfstab || \
+            echo "devpts  /dev/pts          devpts  mode=0620,gid=5 0 0" \
+        >> $nfstab
+        grep -q proc $nfstab || \
+            echo "proc    /proc             proc    defaults        0 0" \
+        >> $nfstab
+        grep -q sysfs $nfstab || \
+            echo "sysfs   /sys              sysfs   noauto          0 0" \
+        >> $nfstab
+        grep -q debugfs $nfstab || test -e /sys/kernel/debug && \
+            echo "debugfs /sys/kernel/debug debugfs noauto          0 0" \
+        >> $nfstab
+        grep -q usbfs $nfstab || test -e /proc/bus/usb && \
+            echo "usbfs   /proc/bus/usb     usbfs   noauto          0 0" \
+        >> $nfstab
+        grep -q /run $nfstab || test -e /run && \
+            echo "tmpfs   /run              tmpfs   noauto          0 0" \
+        >> $nfstab
+    fi
 }
 #======================================
 # updateRootDeviceFstab
@@ -3537,6 +3573,10 @@
     local nfstab=$config_tmp/etc/fstab
     local diskByID=$(getDiskID $rdev)
     local opts=defaults
+    local devicepersistency="by-uuid"
+    if [ ! -z "$kiwi_devicepersistency" ];then
+        devicepersistency=$kiwi_devicepersistency
+    fi
     #======================================
     # check for custom options
     #--------------------------------------
@@ -3570,6 +3610,7 @@
         local volpath
         local mpoint
         local mppath
+        local syspath
         for i in $(cat /.profile | grep -E 'kiwi_LVM_|kiwi_allFreeVolume');do
             variable=$(echo $i|cut -f1 -d=)
             volume=$(echo $i| cut -f3- -d_ | cut -f1 -d=)
@@ -3589,10 +3630,17 @@
             fi
         done
     elif [ "$FSTYPE" = "btrfs" ];then
-        local fsuuid=$(blkid $rdev -s UUID -o value)
-        for subvol in $(btrfs subvol list $prefix |grep -v @ |cut -f9 -d' ');do
-            echo "UUID=$fsuuid /$subvol btrfs subvol=@/$subvol 0 0" >> $nfstab
-        done
+        if [ "$kiwi_btrfs_root_is_snapshot" = "true" ];then
+            if [ $devicepersistency = "by-label" ];then
+                local device="LABEL=$(blkid $rdev -s LABEL -o value)"
+            else
+                local device="UUID=$(blkid $rdev -s UUID -o value)"
+            fi
+            for subvol in $(getBtrfsSubVolumes "$prefix"); do
+                syspath=$(echo $subvol | tr -d @)
+                echo "$device $syspath btrfs subvol=$subvol 0 0" >> $nfstab
+            done
+        fi
     fi
 }
 #======================================
@@ -6957,6 +7005,10 @@
                 kiwiMount "/dev/$kiwi_lvmgroup/$volume" "$prefix/$mpoint"
             fi
         done
+    elif [ "$FSTYPE" = "btrfs" ];then
+        if [ "$kiwi_btrfs_root_is_snapshot" = "true" ];then
+            mountBtrfsSubVolumes $mountDevice $prefix
+        fi
     fi
     return $?
 }
@@ -10010,8 +10062,15 @@
     local mpoint
     local mppath
     local volbase
+    local top=@
     btrfs subvolume create $root/@ || return
-    local rootid=$(btrfs subvolume list $root | cut -f2 -d ' ')
+    if [ "$kiwi_btrfs_root_is_snapshot" = "true" ];then
+        btrfs subvolume create $root/.snapshots
+        btrfs subvolume create $root/.snapshots/1
+        btrfs subvolume snapshot $root/@ $root/.snapshots/1/snapshot
+        top=.snapshots/1/snapshot
+    fi
+    local rootid=$(btrfs subvolume list $root | grep $top | cut -f2 -d ' ')
     btrfs subvolume set-default $rootid $root || return
     for i in $(cat /.profile | grep -E 'kiwi_LVM_|kiwi_allFreeVolume');do
         variable=$(echo $i|cut -f1 -d=)
@@ -10029,6 +10088,9 @@
         btrfs subvolume create $root/@/$mpoint || return
     done
     umount $root && mount $imageRootDevice $root
+    if [ "$kiwi_btrfs_root_is_snapshot" = "true" ];then
+        mountBtrfsSubVolumes $imageRootDevice $root
+    fi
 }
 #======================================
 # restoreLVMMetadata
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIManagerZypper.pm 
new/kiwi/modules/KIWIManagerZypper.pm
--- old/kiwi/modules/KIWIManagerZypper.pm       2015-09-10 15:20:52.000000000 
+0200
+++ new/kiwi/modules/KIWIManagerZypper.pm       2016-02-05 15:42:08.000000000 
+0100
@@ -480,10 +480,12 @@
     #
     my $this = shift;
     my $kiwi = $this->{kiwi};
-    $kiwi -> loginfo("Restoring Zypper package cache");
-    KIWIQX::qxx(
-        "mv /var/cache/kiwi/packs /var/cache/kiwi/packages &>/dev/null"
-    );
+    if (-e '/var/cache/kiwi/packs') {
+        $kiwi -> loginfo("Restoring Zypper package cache");
+        KIWIQX::qxx(
+            "mv /var/cache/kiwi/packs /var/cache/kiwi/packages &>/dev/null"
+        );
+    }
     return $this;
 }
 
@@ -499,10 +501,12 @@
     # ---
     my $this = shift;
     my $kiwi = $this->{kiwi};
-    $kiwi -> loginfo("Preserving Zypper package cache");
-    KIWIQX::qxx(
-        "mv /var/cache/kiwi/packages /var/cache/kiwi/packs"
-    );
+    if (-e '/var/cache/kiwi/packages') {
+        $kiwi -> loginfo("Preserving Zypper package cache");
+        KIWIQX::qxx(
+            "mv /var/cache/kiwi/packages /var/cache/kiwi/packs"
+        );
+    }
     return $this;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIProfileFile.pm 
new/kiwi/modules/KIWIProfileFile.pm
--- old/kiwi/modules/KIWIProfileFile.pm 2015-10-19 12:55:49.000000000 +0200
+++ new/kiwi/modules/KIWIProfileFile.pm 2016-01-29 11:53:02.000000000 +0100
@@ -64,6 +64,7 @@
         kiwi_bootprofile
         kiwi_bootkernel
         kiwi_boot_timeout
+        kiwi_btrfs_root_is_snapshot
         kiwi_cmdline
         kiwi_compressed
         kiwi_cpio_name
@@ -380,6 +381,8 @@
         $type -> getCompressed();
     $data{kiwi_boot_timeout} =
         $type -> getBootTimeout();
+    $data{kiwi_btrfs_root_is_snapshot} =
+        $type -> getBtrfsRootIsSnapshot();
     $data{kiwi_wwid_wait_timeout} =
         $type -> getWWIDWaitTimeout();
     $data{kiwi_hybrid} =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIResult.pm 
new/kiwi/modules/KIWIResult.pm
--- old/kiwi/modules/KIWIResult.pm      2015-11-17 12:53:24.000000000 +0100
+++ new/kiwi/modules/KIWIResult.pm      2016-02-05 15:58:24.000000000 +0100
@@ -409,7 +409,7 @@
     }
     if ($buildinfo->exists('main','install.stick')) {
         $install = 1;
-        $ret |= $this -> __bundleExtension ('install.raw');
+        $ret |= $this -> __bundleExtension ('raw.install.raw');
     }
     if ($buildinfo->exists('main','install.pxe')) {
         $install = 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWISchema.rnc 
new/kiwi/modules/KIWISchema.rnc
--- old/kiwi/modules/KIWISchema.rnc     2016-01-14 12:50:28.000000000 +0100
+++ new/kiwi/modules/KIWISchema.rnc     2016-01-29 11:36:30.000000000 +0100
@@ -1636,6 +1636,11 @@
             "extlinux" | "grub" | "grub2" | "syslinux" |
             "zipl" | "yaboot" | "uboot" | "berryboot" | "grub2_s390x_emu"
         }
+    k.type.btrfs_root_is_snapshot =
+        ## Tell kiwi to install the system into a btrfs snapshot
+        ## The snapshot layout is compatible with the snapper management
+        ## toolkit. By default no snapshots are used
+        attribute btrfs_root_is_snapshot { xsd:boolean }
     k.type.target_blocksize =
         ## Specifies the image blocksize in bytes which has to match
         ## the logical (SSZ) blocksize of the target storage device.
@@ -1876,6 +1881,7 @@
         k.type.bootpartsize.attribute? &
         k.type.bootprofile.attribute? &
         k.type.boottimeout.attribute? &
+        k.type.btrfs_root_is_snapshot? &
         k.type.checkprebuilt.attribute? &
         k.type.compressed.attribute? &
         k.type.container.attribute? &
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWISchema.rng 
new/kiwi/modules/KIWISchema.rng
--- old/kiwi/modules/KIWISchema.rng     2016-01-14 12:50:28.000000000 +0100
+++ new/kiwi/modules/KIWISchema.rng     2016-01-29 11:36:30.000000000 +0100
@@ -2145,6 +2145,14 @@
         </choice>
       </attribute>
     </define>
+    <define name="k.type.btrfs_root_is_snapshot">
+      <attribute name="btrfs_root_is_snapshot">
+        <a:documentation>Tell kiwi to install the system into a btrfs snapshot
+The snapshot layout is compatible with the snapper management
+toolkit. By default no snapshots are used</a:documentation>
+        <data type="boolean"/>
+      </attribute>
+    </define>
     <define name="k.type.target_blocksize">
       <attribute name="target_blocksize">
         <a:documentation>Specifies the image blocksize in bytes which has to 
match
@@ -2587,6 +2595,9 @@
           <ref name="k.type.boottimeout.attribute"/>
         </optional>
         <optional>
+          <ref name="k.type.btrfs_root_is_snapshot"/>
+        </optional>
+        <optional>
           <ref name="k.type.checkprebuilt.attribute"/>
         </optional>
         <optional>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIXML.pm new/kiwi/modules/KIWIXML.pm
--- old/kiwi/modules/KIWIXML.pm 2015-09-21 16:23:18.000000000 +0200
+++ new/kiwi/modules/KIWIXML.pm 2016-01-29 11:36:35.000000000 +0100
@@ -3913,6 +3913,7 @@
         'bootpartsize',
         'bootprofile',
         'boottimeout',
+        'btrfs_root_is_snapshot',
         'checkprebuilt',
         'compressed',
         'container',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/modules/KIWIXMLTypeData.pm 
new/kiwi/modules/KIWIXMLTypeData.pm
--- old/kiwi/modules/KIWIXMLTypeData.pm 2015-09-21 16:23:18.000000000 +0200
+++ new/kiwi/modules/KIWIXMLTypeData.pm 2016-01-29 11:36:35.000000000 +0100
@@ -62,6 +62,7 @@
     #     bootpartsize           = ''
     #     bootprofile            = ''
     #     boottimeout            = ''
+    #     btrfs_root_is_snapshot = ''
     #     checkprebuilt          = ''
     #     compressed             = ''
     #     devicepersistency      = ''
@@ -172,6 +173,7 @@
         volid
         wwid_wait_timeout
         zipl_targettype
+        btrfs_root_is_snapshot
     );
     $this->{supportedKeywords} = \%keywords;
     my %boolKW = map { ($_ => 1) } qw(
@@ -188,6 +190,7 @@
         primary
         ramonly
         sizeadd
+        btrfs_root_is_snapshot
     );
     $this->{boolKeywords} = \%boolKW;
     if (! $this -> p_isInitHashRef($init) ) {
@@ -237,6 +240,7 @@
     $this->{volid}                  = $init->{volid};
     $this->{wwid_wait_timeout}      = $init->{wwid_wait_timeout};
     $this->{target_blocksize}       = $init->{target_blocksize};
+    $this->{btrfs_root_is_snapshot} = $init->{btrfs_root_is_snapshot};
     $this->{zfsoptions}             = $init->{zfsoptions};
     # Set default values
     if (! $init->{bootloader} ) {
@@ -262,6 +266,9 @@
         $this->{sizeunit} = 'M';
         $this->{defaultsizeunit} = 1;
     }
+    if (! $init->{btrfs_root_is_snapshot} ) {
+        $this->{btrfs_root_is_snapshot} = 'false';
+    }
     return $this;
 }
 
@@ -332,6 +339,17 @@
 }
 
 #==========================================
+# getBtrfsRootIsSnapshot
+#------------------------------------------
+sub getBtrfsRootIsSnapshot {
+    # ...
+    # Return the configured btrfs root is snapshot value
+    # ---
+    my $this = shift;
+    return $this->{btrfs_root_is_snapshot};
+}
+
+#==========================================
 # getBootPartitionSize
 #------------------------------------------
 sub getBootPartitionSize {
@@ -925,6 +943,12 @@
             $element -> setAttribute('bootloader', $loader);
         }
     }
+    my $btrfs_root_is_snapshot = $this -> getBtrfsRootIsSnapshot();
+    if ($btrfs_root_is_snapshot) {
+        $element -> setAttribute(
+            'btrfs_root_is_snapshot', $btrfs_root_is_snapshot
+        );
+    }
     my $target_blocksize = $this -> getTargetBlockSize();
     if ($target_blocksize) {
         $element -> setAttribute('target_blocksize', $target_blocksize);
@@ -1226,6 +1250,23 @@
 }
 
 #==========================================
+# setBtrfsRootIsSnapshot
+#------------------------------------------
+sub setBtrfsRootIsSnapshot {
+    # ...
+    # Set the configuration for the btrfs root is snapshot feature
+    # ---
+    my $this = shift;
+    my $btrfs_root_is_snapshot = shift;
+    my %settings = (
+        attr   => 'btrfs_root_is_snapshot',
+        value  => $btrfs_root_is_snapshot,
+        caller => 'setBtrfsRootIsSnapshot'
+    );
+    return $this -> p_setBooleanValue(\%settings);
+}
+
+#==========================================
 # setBootPartitionSize
 #------------------------------------------
 sub setBootPartitionSize {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/template/ix86/rhel-06.6-JeOS/Vagrantfile 
new/kiwi/template/ix86/rhel-06.6-JeOS/Vagrantfile
--- old/kiwi/template/ix86/rhel-06.6-JeOS/Vagrantfile   1970-01-01 
01:00:00.000000000 +0100
+++ new/kiwi/template/ix86/rhel-06.6-JeOS/Vagrantfile   2016-02-02 
16:42:55.000000000 +0100
@@ -0,0 +1,14 @@
+VAGRANTFILE_API_VERSION = "2"
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  # synced folder containing the rhel DVD iso file
+  config.vm.synced_folder "/image/CDs/", "/image/CDs"
+
+  config.vm.provider "docker" do |d|
+    d.image = "schaefi/kiwi-build-box:latest"
+    d.create_args = ["-privileged=true", "-i", "-t"]
+    # start the sshd in foreground to keep the container in running state
+    d.cmd = ["/usr/sbin/sshd", "-D"]
+    d.has_ssh = true
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/template/ix86/rhel-06.6-JeOS/config.xml 
new/kiwi/template/ix86/rhel-06.6-JeOS/config.xml
--- old/kiwi/template/ix86/rhel-06.6-JeOS/config.xml    2015-12-17 
09:35:24.000000000 +0100
+++ new/kiwi/template/ix86/rhel-06.6-JeOS/config.xml    2016-02-02 
16:42:55.000000000 +0100
@@ -9,7 +9,6 @@
     <profiles>
         <profile name="RedHat" description="Build for RHEL" import="true"/>
         <profile name="CentOS" description="Build for CentOS"/>
-        <profile name="Oracle" description="Build for Oracle Linux"/>
     </profiles>
     <strip type="delete">
         <file name="/usr/lib*/python2.6"/>
@@ -56,7 +55,7 @@
         <source path="iso:///image/CDs/rhel-server-6.6-x86_64-dvd.iso"/>
     </repository>
 <!-- Don't remove the following repos, they contain tools needed by kiwi -->
-    <repository type="rpm-md" priority="1" profiles="RedHat,Oracle">
+    <repository type="rpm-md" priority="1" profiles="RedHat">
         <source path="obs://Virtualization:/Appliances/RedHat_RHEL-6"/>
     </repository>
     <repository type="rpm-md" priority="1" profiles="CentOS">
@@ -118,9 +117,6 @@
     <packages type="image" profiles="RedHat">
         <package name="redhat-logos" bootinclude="true" bootdelete="true"/>
     </packages>
-    <packages type="image" profiles="Oracle">
-        <package name="oracle-logos" bootinclude="true" bootdelete="true"/>
-    </packages>
     <packages type="bootstrap">
         <package name="filesystem"/>
         <package name="basesystem"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kiwi/template/s390/suse-SLE12-community-JeOS/config.xml 
new/kiwi/template/s390/suse-SLE12-community-JeOS/config.xml
--- old/kiwi/template/s390/suse-SLE12-community-JeOS/config.xml 2015-10-08 
10:16:59.000000000 +0200
+++ new/kiwi/template/s390/suse-SLE12-community-JeOS/config.xml 2016-01-20 
12:16:36.000000000 +0100
@@ -30,7 +30,7 @@
                 <oem-swapsize>512</oem-swapsize>
             </oemconfig>
         </type>
-        <type image="pxe" filesystem="ext3" boot="netboot/suse-SLES12" 
bootloader="zipl"/>
+        <type image="pxe" filesystem="ext3" boot="netboot/suse-SLES12"/>
     </preferences>
     <users group="root">
         <user password="$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0" home="/root" 
name="root"/>
@@ -65,6 +65,7 @@
         <package name="kexec-tools"/>
         <package name="less"/>
         <package name="patch"/>
+        <package name="util-linux"/>
     </packages>
     <packages type="bootstrap">
         <package name="filesystem"/>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm 
new/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm
--- old/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm     2015-09-21 
16:23:20.000000000 +0200
+++ new/kiwi/tests/unit/lib/Test/kiwiXMLTypeData.pm     2016-01-29 
11:36:35.000000000 +0100
@@ -1956,6 +1956,7 @@
         . 'bootfilesystem="fat32" '
         . 'bootkernel="xenk" '
         . 'bootloader="grub2" '
+        . 'btrfs_root_is_snapshot="false" '
         . 'target_blocksize="4096" '
         . 'zipl_targettype="FBA" '
         . 'bootpartsize="512" '


Reply via email to