diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-04-14 13:46:12 +0000 |
commit | 1be510f9529cb082f802408b472a77d074b394c0 (patch) | |
tree | b175f9d5fcb107576dabc768e7bd04d4a3e491a0 /zarb-ml/mageia-dev/attachments/20111218/f1909ae7 | |
parent | fa5098cf210b23ab4f419913e28af7b1b07dafb2 (diff) | |
download | archives-master.tar archives-master.tar.gz archives-master.tar.bz2 archives-master.tar.xz archives-master.zip |
Diffstat (limited to 'zarb-ml/mageia-dev/attachments/20111218/f1909ae7')
-rw-r--r-- | zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment-0001.bin | 43 | ||||
-rw-r--r-- | zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment.bin | 43 |
2 files changed, 86 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment-0001.bin b/zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment-0001.bin new file mode 100644 index 000000000..1fa07f734 --- /dev/null +++ b/zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment-0001.bin @@ -0,0 +1,43 @@ +#!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +dracutfunctions=/usr/lib/dracut/dracut-functions +hostonly=1 + +check() { + local _rootdev _usrdev _needed + # No point trying to support lvm if the binaries are missing + type -P lvm >/dev/null || return 1 + + . $dracutfunctions + [[ $debug ]] && set -x + + is_lvm() { [[ $(get_fs_type /dev/block/$1) = LVM2_member ]]; } + + [[ $hostonly ]] && { + _rootdev=$(find_root_block_device) + if [[ $_rootdev ]]; then + # root lives on a block device, so we can be more precise about + # hostonly checking +echo "Checking / via $_rootdev" + check_block_and_slaves is_lvm "$_rootdev" && _needed=1 + else + # root is not on a block device, use the shotgun approach + blkid | grep -q LVM2_member && _needed=1 + fi + + [[ $_needed ]] || { + _usrdev=$(find_block_device /usr) + if [[ $_usrdev ]]; then +echo "Checking /usr via $_usrdev" + check_block_and_slaves is_lvm "$_usrdev" && _needed=1 + fi + } + } +echo "_needed=$_needed" + [[ $_needed ]] +} + +check +echo $? diff --git a/zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment.bin b/zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment.bin new file mode 100644 index 000000000..1fa07f734 --- /dev/null +++ b/zarb-ml/mageia-dev/attachments/20111218/f1909ae7/attachment.bin @@ -0,0 +1,43 @@ +#!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +dracutfunctions=/usr/lib/dracut/dracut-functions +hostonly=1 + +check() { + local _rootdev _usrdev _needed + # No point trying to support lvm if the binaries are missing + type -P lvm >/dev/null || return 1 + + . $dracutfunctions + [[ $debug ]] && set -x + + is_lvm() { [[ $(get_fs_type /dev/block/$1) = LVM2_member ]]; } + + [[ $hostonly ]] && { + _rootdev=$(find_root_block_device) + if [[ $_rootdev ]]; then + # root lives on a block device, so we can be more precise about + # hostonly checking +echo "Checking / via $_rootdev" + check_block_and_slaves is_lvm "$_rootdev" && _needed=1 + else + # root is not on a block device, use the shotgun approach + blkid | grep -q LVM2_member && _needed=1 + fi + + [[ $_needed ]] || { + _usrdev=$(find_block_device /usr) + if [[ $_usrdev ]]; then +echo "Checking /usr via $_usrdev" + check_block_and_slaves is_lvm "$_usrdev" && _needed=1 + fi + } + } +echo "_needed=$_needed" + [[ $_needed ]] +} + +check +echo $? |