diff options
author | Will Woods <wwoods@redhat.com> | 2012-04-27 16:21:36 -0400 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2012-05-01 17:17:25 -0400 |
commit | 5013f0dd67222e45ca4028c89f7dde6ff47cf2ec (patch) | |
tree | 9c1dfdb234206c856997657a7d92eb562fa7dbb6 /dracut/anaconda-lib.sh | |
parent | 055b006303aba52086ee7e39913ccf65a6e98252 (diff) | |
download | anaconda-5013f0dd67222e45ca4028c89f7dde6ff47cf2ec.tar.gz anaconda-5013f0dd67222e45ca4028c89f7dde6ff47cf2ec.tar.xz anaconda-5013f0dd67222e45ca4028c89f7dde6ff47cf2ec.zip |
dracut: add copytree, rename dev_is_mounted->find_mount
copytree() is a function for copying/merging directory trees - useful
for stuff like updates images.
dev_is_mounted is confusingly similar to dracut-lib's 'ismounted', so
it's been renamed for clarity.
Diffstat (limited to 'dracut/anaconda-lib.sh')
-rwxr-xr-x | dracut/anaconda-lib.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh index 115456db5..476c6c82d 100755 --- a/dracut/anaconda-lib.sh +++ b/dracut/anaconda-lib.sh @@ -80,6 +80,12 @@ anaconda_live_root_dir() { # These could probably be in dracut-lib or similar +copytree() { + local src="$1" dest="$2" + mkdir -p "$dest"; dest=$(readlink -f -q "$dest") + ( cd "$src"; cp -a . -t "$dest" ) +} + disk_to_dev_path() { case "$1" in CDLABEL=*|LABEL=*) echo "/dev/disk/by-label/${1#*LABEL=}" ;; @@ -89,7 +95,7 @@ disk_to_dev_path() { esac } -dev_is_mounted() { +find_mount() { local dev mnt etc wanted_dev="$(readlink -e -q $1)" while read dev mnt etc; do [ "$dev" = "$wanted_dev" ] && echo $mnt && return 0 |