grub-install: Improve support for partitioned loop devices.
PATCH 1/1 grub-install: Improve support for partitioned loop devices.
* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect /dev/loopX as being the parent of /dev/loopXpY.
--- ChangeLog | 5 +++++ grub-core/osdep/linux/getroot.c | 13 +++++++++++++ 2 files changed, 18 insertions(+)
ChangeLog +5 -0
@@ -1,3 +1,8 @@ +2014-01-26 Mike Gilbert <[email protected]> + grub-install: Improve support for partitioned loop devices. + + * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect + /dev/loopX as being the parent of /dev/loopXpY. 2014-01-25 Andrey Borzenkov <[email protected]>
grub-core/osdep/linux/getroot.c +13 -0
@@ -883,6 +883,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, *pp ='\0' ;return path; } + +/* If this is a loop device */ +if ((strncmp ("loop" , p,4 ) ==0 ) && p[4 ] >='0' && p[4 ] <='9' ) + { +char *pp = p +4 ; +while (*pp >='0' && *pp <='9' ) + pp++; +if (*pp =='p' ) + *is_part =1 ; +/* /dev/loop[0-9]+p[0-9]* */ + *pp ='\0' ; +return path; + } }return path;
Signature · 1 line
1.8.5.3
В Sat, 25 Jan 2014 20:41:00 -0500
Mike Gilbert <[email protected]> пишет:
Quoted 2 lines
*
grub-core/osdep/linux/getroot.c(grub_util_part_to_disk): Detect/dev/loopXas being the parent of/dev/loopXpY.
Those devices are normally device-mapper ones (created by kpartx) and grub already detects parent by following device-mapper tree. What exact problem are you trying to solve?
Quoted 42 lines
--- ChangeLog | 5 +++++ grub-core/osdep/linux/getroot.c | 13 +++++++++++++ 2 files changed, 18 insertions(+)ChangeLog +5
-0@@ -1,3 +1,8 @@ +2014-01-26 Mike Gilbert <[email protected]> + grub-install: Improve support for partitioned loop devices. + + * grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect + /dev/loopX as being the parent of /dev/loopXpY. 2014-01-25 Andrey Borzenkov <[email protected]>grub-core/osdep/linux/getroot.c +13
-0@@ -883,6 +883,19 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st, *pp ='\0' ;return path; } + +/* If this is a loop device */ +if ((strncmp ("loop" , p,4 ) ==0 ) && p[4 ] >='0' && p[4 ] <='9' ) + { +char *pp = p +4 ; +while (*pp >='0' && *pp <='9' ) + pp++; +if (*pp =='p' ) + *is_part =1 ; +/* /dev/loop[0-9]+p[0-9]* */ + *pp ='\0' ; +return path; + } }return path;
Quoted 9 lines · Andrey Borzenkov
В Sat, 25 Jan 2014 20:41:00 -0500
Mike Gilbert <[email protected]> пишет:Quoted 2 lines
*
grub-core/osdep/linux/getroot.c(grub_util_part_to_disk): Detect/dev/loopXas being the parent of/dev/loopXpY.Those devices are normally device-mapper ones (created by kpartx) and grub already detects parent by following device-mapper tree. What exact problem are you trying to solve?
The kernel supports partitioned loop devices without device mapper. These can be set up using losetup -P, or by calling partx from util-linux.
В Sun, 26 Jan 2014 01:20:09 -0500
Mike Gilbert <[email protected]> пишет:
Quoted 7 lines · Andrey Borzenkov
Quoted 6 lines
В Sat, 25 Jan 2014 20:41:00 -0500
Mike Gilbert <[email protected]> пишет:Quoted 2 lines
*
grub-core/osdep/linux/getroot.c(grub_util_part_to_disk): Detect/dev/loopXas being the parent of/dev/loopXpY.
Quoted 7 lines
Quoted 3 lines
Those devices are normally device-mapper ones (created by kpartx) and grub already detects parent by following device-mapper tree. What exact problem are you trying to solve?
The kernel supports partitioned loop devices without device mapper. These can be set up using losetup -P, or by calling partx from util-linux.
Thank you, was not aware of it.