summaryrefslogtreecommitdiffstats
path: root/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff
diff options
context:
space:
mode:
author Patrick J Volkerding <volkerdi@slackware.com>2010-05-19 08:58:23 +0000
committer Eric Hameleers <alien@slackware.com>2018-05-31 22:43:05 +0200
commitb76270bf9e6dd375e495fec92140a79a79415d27 (patch)
tree3dbed78b2279bf9f14207a16dc634b90995cbd40 /source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff
parent5a12e7c134274dba706667107d10d231517d3e05 (diff)
downloadcurrent-b76270bf9e6dd375e495fec92140a79a79415d27.tar.gz
current-b76270bf9e6dd375e495fec92140a79a79415d27.tar.xz
Slackware 13.1slackware-13.1
Wed May 19 08:58:23 UTC 2010 Slackware 13.1 x86_64 stable is released! Lots of thanks are due -- see the RELEASE_NOTES and the rest of the ChangeLog for credits. The ISOs are on their way to replication, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. We are taking pre-orders now at store.slackware.com, and offering a discount if you sign up for a subscription. Consider picking up a copy to help support the project. Thanks again to the Slackware community for testing, contributing, and generally holding us to a high level of quality. :-) Enjoy!
Diffstat (limited to 'source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff')
-rw-r--r--source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff b/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff
new file mode 100644
index 000000000..860347ebb
--- /dev/null
+++ b/source/a/lilo/lilo.use_major_minor_instead_lvm_name.diff
@@ -0,0 +1,47 @@
+--- lilo-22.8/geometry.c 2006-12-17 01:46:17.000000000 -0200
++++ lilo-22.8-new/geometry.c 2009-12-18 02:09:54.000000000 -0200
+@@ -903,24 +903,17 @@
+ void *next = NULL;
+ char dmdev[PATH_MAX+1];
+ char buf[PATH_MAX+1];
+- char *slash;
+ int result;
+
+ dev_open(&dev, device, -1);
+ strncpy(dmdev, dev.name, PATH_MAX);
+ dmdev[PATH_MAX] = 0;
++
+ do {
+ memset(buf, 0, PATH_MAX + 1);
+ if ((result = readlink(dmdev, buf, PATH_MAX)) < 0 && errno != EINVAL)
+ die("device-mapper: readlink(\"%s\") failed with: %s",buf,
+ strerror(errno));
+- if (result >= 0) {
+- if (buf[0] != '/' && (slash = strrchr(dmdev, '/')) != NULL)
+- slash++;
+- else
+- slash = dmdev;
+- strncpy(slash, buf, PATH_MAX - (slash-dmdev));
+- }
+ if (realpath(dmdev, buf) == NULL)
+ die("device-mapper: realpath(\"%s\") failed with: %s",dmdev,
+ strerror(errno));
+@@ -930,13 +923,11 @@
+
+ if (!(dmt = dm_task_create(DM_DEVICE_TABLE)))
+ die("device-mapper: dm_task_create(DM_DEVICE_TABLE) failed");
+- slash = strrchr(dmdev, '/');
+- if (slash)
+- slash++;
+- else
+- slash = dmdev;
+- if (!dm_task_set_name(dmt, slash))
+- die("device-mapper: dm_task_set_name(\"%s\") failed",dmdev);
++ // Using device name is flawed. Better to use device major and minor
++ if (!dm_task_set_major(dmt, MAJOR(device)))
++ die("device-mapper: dm_task_set_major(DM_DEVICE_TABLE) failed");
++ if (!dm_task_set_minor(dmt, MINOR(device)))
++ die("device-mapper: dm_task_set_minor(DM_DEVICE_TABLE) failed");
+ if (!dm_task_run(dmt))
+ die("device-mapper: dm_task_run(DM_DEVICE_TABLE) failed");
+