Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 336244 Details for
Bug 438262
sys-fs/lvm2-2.02.97 /etc/init.d/device-mapper does not support multi-line volumes in /etc/dmtab
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
new device-mapper init.d in patch form
lvm2-initdscript.patch (text/plain), 2.44 KB, created by
Mads
on 2013-01-20 19:48:38 UTC
(
hide
)
Description:
new device-mapper init.d in patch form
Filename:
MIME Type:
Creator:
Mads
Created:
2013-01-20 19:48:38 UTC
Size:
2.44 KB
patch
obsolete
>--- device-mapper.old 2013-01-18 12:18:58.534133771 +0100 >+++ device-mapper 2013-01-20 20:43:40.361380673 +0100 >@@ -19,19 +19,55 @@ > return ${retval} > } > >+# char **build_dmsetup_command(volume) >+# >+# Returns complete dmsetup command given single volume name >+build_dmsetup_command() { >+ local count dmsetup_cmd >+ >+ # Number of lines mentioning volume name >+ count=$(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | grep -c ${1}) >+ >+ # If there's just one line: >+ if [ ${count} -eq 1 ] ; then >+ echo "echo $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \ >+ grep ${1} | awk '{$1=""; print $0}') | /sbin/dmsetup create ${1}" >+ >+ # For all cases with more lines: >+ elif [ ${count} -gt 1 ] ; then >+ for c in $( seq 1 ${count} ) ; do >+ if [ ${c} -eq 1 ] ; then >+ # Heavy escaping in awk-statement because we cannot use apostrophes >+ dmsetup_cmd="echo -e $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \ >+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})" >+ else >+ # Append starting with newline >+ dmsetup_cmd="${dmsetup_cmd}\\\\n \ >+ $(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \ >+ grep ${1} | awk NR==${c}\ \{\$1=\"\"\;\ print\ \$0\})" >+ fi >+ done >+ echo "${dmsetup_cmd} | /sbin/dmsetup create ${1}" >+ fi >+ >+ return 0 >+} >+ > # char **get_new_dm_volumes(void) > # >-# Return dmsetup commands to setup volumes >+# Return unique volumes from /etc/dmtab > get_new_dm_volumes() { >- local volume params >+ local volume > > # Filter comments and blank lines > grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab | \ >- while read volume params ; do >+ awk '{ print $1 }' | \ >+ uniq | \ >+ while read volume ; do > # If it exists, skip it > dmvolume_exists "${volume%:}" && continue >- # Assemble the command to run to create volume >- echo "echo ${params} | /sbin/dmsetup create ${volume%:}" >+ >+ echo "${volume%:}" > done > > return 0 >@@ -88,15 +124,15 @@ > if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then > [ -n "$(get_new_dm_volumes)" ] && \ > einfo " Setting up device-mapper volumes:" >- >+ > get_new_dm_volumes | \ > while read x ; do > [ -n "${x}" ] || continue >- >+ > volume="${x##* }" >- >+ > ebegin " Creating volume: ${volume}" >- if ! eval "${x}" >/dev/null 2>/dev/null ; then >+ if ! eval $(build_dmsetup_command ${volume}) >/dev/null 2>/dev/null ; then > eend 1 " Error creating volume: ${volume}" > # dmsetup still adds an empty volume in some cases, > # so lets remove it
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 438262
:
336058
|
336228
| 336244