commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 01/02: fix /proc/swaps inside d-i


From: Samuel Thibault
Subject: [hurd] 01/02: fix /proc/swaps inside d-i
Date: Thu, 24 Mar 2016 16:17:41 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch master
in repository hurd.

commit d09d9f3c8f5755bb1f91df782a44f17949664e0c
Author: Samuel Thibault <address@hidden>
Date:   Thu Mar 24 10:38:00 2016 +0000

    fix /proc/swaps inside d-i
    
    patches/git-update.patch: Cherry-pick patches from upstream
---
 debian/changelog                |  7 +++
 debian/patches/git-update.patch | 97 +++++++++++++++++++++++++++++++++++++++++
 debian/patches/series           |  1 +
 3 files changed, 105 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 3e41eb2..834e53e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+hurd (1:0.7.git20160320-2) UNRELEASED; urgency=medium
+
+  * patches/git-update.patch: Cherry-pick patches from upstream to fix
+    /proc/swaps inside d-i.
+
+ -- Samuel Thibault <address@hidden>  Thu, 24 Mar 2016 10:36:52 +0000
+
 hurd (1:0.7.git20160320-1) unstable; urgency=medium
 
   * New upstream snapshot.
diff --git a/debian/patches/git-update.patch b/debian/patches/git-update.patch
new file mode 100644
index 0000000..2b86734
--- /dev/null
+++ b/debian/patches/git-update.patch
@@ -0,0 +1,97 @@
+commit b235bd2724ad4cf9150b0f571ead70fbfa34da84
+Author: Samuel Thibault <address@hidden>
+Date:   Thu Mar 24 11:00:14 2016 +0100
+
+    Fix swap information numbers
+    
+    * procfs/rootdir.c (rootdir_gc_swaps): Fix default_pager_storage_info call
+    parameter order.
+    * sutils/swapon.c (main): Likewise.
+
+diff --git a/procfs/rootdir.c b/procfs/rootdir.c
+index dd693c8..951c071 100644
+--- a/procfs/rootdir.c
++++ b/procfs/rootdir.c
+@@ -548,7 +548,7 @@ rootdir_gc_swaps (void *hook, char **contents, ssize_t 
*contents_len)
+       goto out_fclose;
+     }
+ 
+-  err = default_pager_storage_info (defpager, &free, &nfree, &size, &nsize,
++  err = default_pager_storage_info (defpager, &size, &nsize, &free, &nfree,
+                                   &names, &names_len);
+   if (err)
+     goto out;
+diff --git a/sutils/swapon.c b/sutils/swapon.c
+index ae830ba..1d0d435 100644
+--- a/sutils/swapon.c
++++ b/sutils/swapon.c
+@@ -571,7 +571,7 @@ main (int argc, char *argv[])
+ 
+       get_def_pager();
+ 
+-      err = default_pager_storage_info (def_pager, &free, &nfree, &size, 
&nsize,
++      err = default_pager_storage_info (def_pager, &size, &nsize, &free, 
&nfree,
+                                       &names, &names_len);
+       if (err)
+       error (3, 0, "Can not get default pager storage information");
+commit 0715d1b22a6f0008b70fe4b1881045f65521ac19
+Author: Samuel Thibault <address@hidden>
+Date:   Thu Mar 24 11:33:36 2016 +0100
+
+    Use swapon path as pager partition path
+    
+    When /dev/hd* entries are parted-partition storeio, the store name is only
+    the disk name, thus not unique.  We should just use the path being used
+    instead.
+    
+    * sutils/swapon.c (swaponoff): Use `file' instead of `store->name' to
+    default_pager_paging_file.
+    (main): Drop hardcoded "/dev/".
+    * procfs/rootdir.c (rootdir_gc_swaps): Drop hardcoded "/dev/".
+
+diff --git a/procfs/rootdir.c b/procfs/rootdir.c
+index 951c071..8e7c659 100644
+--- a/procfs/rootdir.c
++++ b/procfs/rootdir.c
+@@ -557,7 +557,7 @@ rootdir_gc_swaps (void *hook, char **contents, ssize_t 
*contents_len)
+   name = names;
+   for (i = 0; i < nfree; i++)
+     {
+-      fprintf (m, "/dev/%s\tpartition\t%zu\t%zu\t-1\n",
++      fprintf (m, "%s\tpartition\t%zu\t%zu\t-1\n",
+              name, size[i] >> 10, (size[i] - free[i]) >> 10);
+       name = argz_next (names, names_len, name);
+     }
+diff --git a/sutils/swapon.c b/sutils/swapon.c
+index 1d0d435..40f5a20 100644
+--- a/sutils/swapon.c
++++ b/sutils/swapon.c
+@@ -424,9 +424,7 @@ swaponoff (const char *file, int add, int skipnotexisting)
+     {
+       /* The default pager does not support the new protocol.
+        We tried it in a previous call (below) and got MIG_BAD_ID.  */
+-      char pname[sizeof "/dev/" + strlen (store->name) + 1];
+-      strcpy (stpcpy (pname, "/dev/"), store->name);
+-      err = default_pager_paging_file (def_pager, dev_master, pname, add);
++      err = default_pager_paging_file (def_pager, dev_master, file, add);
+     }
+   else
+     {
+@@ -439,7 +437,7 @@ swaponoff (const char *file, int add, int skipnotexisting)
+         runs[j++] = store->runs[i].length;
+       }
+       err = default_pager_paging_storage (def_pager, store->port,
+-                                        runs, j, store->name, add);
++                                        runs, j, file, add);
+       if (err == MIG_BAD_ID)
+       {
+         /* The default pager does not support the new protocol.
+@@ -580,7 +578,7 @@ main (int argc, char *argv[])
+       name = names;
+       for (i = 0; i < nfree; i++)
+       {
+-        printf ("/dev/%s\tpartition\t%zuM\t%zuM\t-1\n",
++        printf ("%s\tpartition\t%zuM\t%zuM\t-1\n",
+                 name, size[i] >> 20, (size[i] - free[i]) >> 20);
+         name = argz_next (names, names_len, name);
+       }
diff --git a/debian/patches/series b/debian/patches/series
index 4198bd7..732ffd2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -28,3 +28,4 @@ crash-logging.patch
 using_std.patch
 netdde_log.patch
 libports-iterate-refcount.patch
+git-update.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]