]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- create subvolume instead of snapshot for initial system 389/head
authorArvin Schnell <aschnell@suse.de>
Mon, 29 Jan 2018 10:36:25 +0000 (11:36 +0100)
committerArvin Schnell <aschnell@suse.de>
Mon, 29 Jan 2018 10:36:25 +0000 (11:36 +0100)
client/installation-helper.cc
package/snapper.changes

index 13da6442d62317bf38df1eff9f506ee0497d909e..da22de24c1b809eff3770789bde911923fcc2015 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2015 Novell, Inc.
+ * Copyright (c) 2018 SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -90,18 +91,30 @@ step1(const string& device, const string& description, const string& cleanup,
 
     btrfs.createConfig();
 
-    cout << "creating snapshot" << endl;
+    cout << "creating subvolume" << endl;
 
     Snapper snapper("root", tmp_mount.getFullname());
 
     SCD scd;
     scd.read_only = false;
+    scd.empty = true;
     scd.description = description;
     scd.cleanup = cleanup;
     scd.userdata = userdata;
 
     Snapshots::iterator snapshot = snapper.createSingleSnapshot(scd);
 
+    cout << "again copying config-file" << endl;
+
+    string ris = tmp_mount.getFullname() + snapshot->snapshotDir();
+
+    mkdir((ris + "/etc").c_str(), 0777);
+    mkdir((ris + "/etc/snapper").c_str(), 0777);
+    mkdir((ris + "/etc/snapper/configs").c_str(), 0777);
+
+    system(("/bin/cp " + tmp_mount.getFullname() + "/etc/snapper/configs/root " + ris +
+           "/etc/snapper/configs").c_str());
+
     cout << "setting default subvolume" << endl;
 
     snapper.getFilesystem()->setDefault(snapshot->getNum());
@@ -132,6 +145,8 @@ step2(const string& device, const string& root_prefix, const string& default_sub
        subvol_option += "/";
     subvol_option += ".snapshots";
 
+    mkdir((root_prefix + "/.snapshots").c_str(), 0777);
+
     SDir s_dir(root_prefix + "/.snapshots");
     if (!s_dir.mount(device, "btrfs", 0, "subvol=" + subvol_option))
     {
index ed7b214380c0a7d29592e6a73e95ea3e1def57c8..a5cc4518ee4291deefbf1ed3c2d2c1828e8a83c7 100644 (file)
@@ -1,9 +1,15 @@
+-------------------------------------------------------------------
+Mon Jan 29 11:32:56 CET 2018 - aschnell@suse.com
+
+- create subvolume instead of snapshot for initial system
+  (bsc#1077240)
+- version 0.5.4
+
 -------------------------------------------------------------------
 Fri Jan 26 14:36:20 CET 2018 - aschnell@suse.com
 
 - improved error handling for systemd services
   (gh#openSUSE/snapper#382)
-- version 0.5.4
 
 -------------------------------------------------------------------
 Wed Jan 10 14:33:11 CET 2018 - aschnell@suse.com