Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 336058 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]
new /etc/init.d/device-mapper, non-working
device-mapper (text/plain), 3.02 KB, created by
Mads
on 2013-01-18 16:25:24 UTC
(
hide
)
Description:
new /etc/init.d/device-mapper, non-working
Filename:
MIME Type:
Creator:
Mads
Created:
2013-01-18 16:25:24 UTC
Size:
3.02 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2012 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/device-mapper.rc-2.02.95-r2,v 1.1 2012/05/27 07:05:22 robbat2 Exp $ > >depend() { > # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that > # means dmeventd is NOT notified, as it cannot be safely running > before dmeventd checkfs fsck > after modules >} > >dm_in_proc() { > local retval=0 > for x in devices misc ; do > grep -qs 'device-mapper' /proc/${x} > retval=$((${retval} + $?)) > done > return ${retval} >} > ># char **get_new_dm_volumes(void) ># ># Return dmsetup commands to setup volumes >get_new_dm_volumes() { > local volume params > declare -A dmsetup_cmds > > while read volume params ; do > # If it exists, skip it > dmvolume_exists "${volume%:}" && continue > > # Check if there's something defined already > if [[ ${dmsetup_cmds[$volume]} ]] ; then > dmsetup_cmds[$volume]="${dmsetup_cmds[$volume]}\\\\n${params}" > else > dmsetup_cmds[$volume]="echo -e ${params}" > fi > # Filter comments and blank lines > done < <(grep -v -e '^[[:space:]]*\(#\|$\)' /etc/dmtab) > > > # Iterate through dmsetup commands > echo "${!dmsetup_cmds[@]}" > for vol in "${!dmsetup_cmds[@]}" ; do > echo "${dmsetup_cmds[$vol]} | /sbin/dmsetup create ${vol%:} /dev/stdin" > done > > return 0 >} > ># int dmvolume_exists(volume) ># ># Return true if volume exists in DM table >dmvolume_exists() { > local x line volume=$1 > > [ -z "${volume}" ] && return 1 > > /sbin/dmsetup ls 2>/dev/null | \ > while read line ; do > for x in ${line} ; do > # the following conditonal return only breaks out > # of the while loop, as it is running in a pipe. > [ "${x}" = "${volume}" ] && return 1 > # We only want to check the volume name > break > done > done > > # if 1 was returned from the above loop, then indicate that > # volume exists > [ $? = 1 ] && return 0 > > # otherwise the loop exited normally and the volume does not > # exist > return 1 >} > ># int is_empty_dm_volume(volume) ># ># Return true if the volume exists in DM table, but is empty/non-valid >is_empty_dm_volume() { > local table volume=$1 > > set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:") > [ "${volume}" = "$1" -a -z "$2" ] >} > > >start() { > if [ -e /proc/modules ] && ! dm_in_proc ; then > modprobe dm-mod 2>/dev/null > fi > # Ensure the dirs exist for locking and running > checkpath -q -d -m 0700 -o root:root /run/lvm /run/lock/lvm > > local x volume > > 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 > eend 1 " Error creating volume: ${volume}" > # dmsetup still adds an empty volume in some cases, > # so lets remove it > is_empty_dm_volume "${volume}" && \ > /sbin/dmsetup remove "${volume}" 2>/dev/null > else > eend 0 > fi > done > fi >} >
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 Raw
Actions:
View
Attachments on
bug 438262
:
336058
|
336228
|
336244