FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 04-27-2012, 11:31 PM
Will Woods
 
Default 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.
---
dracut/anaconda-lib.sh | 8 +++++++-
dracut/fetch-kickstart-disk | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index 115456d..476c6c8 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
diff --git a/dracut/fetch-kickstart-disk b/dracut/fetch-kickstart-disk
index 9650241..3172049 100755
--- a/dracut/fetch-kickstart-disk
+++ b/dracut/fetch-kickstart-disk
@@ -11,7 +11,7 @@ path="${2:-/ks.cfg}"
[ -b "$dev" ] || exit 1

info "anaconda: fetching kickstart from $dev:$path"
-mnt="$(dev_is_mounted $dev)"
+mnt="$(find_mount $dev)"

if [ -n "$mnt" ]; then
cp $mnt$path /tmp/ks.cfg
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:24 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org