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 anaconda_auto_updates() (product.img/updates.img) (#800107)

So, loader used to look for updates.img/product.img/RHUpdates under
whatever path it was given for the stage2 image. We need product.img for
variant installers (like the RHEL installer) so we need to look for
these things.

Add the anaconda_auto_updates() function to look for these things and
put them in the appropriate places. Also add unpack_updates_img() as a
helper for cleanly unpacking updates images.
---
dracut/anaconda-lib.sh | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index 49c4f9e..a045bab 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -1,5 +1,7 @@
#!/bin/bash

+command -v unpack_img >/dev/null || . /lib/img-lib.sh
+
# config_get SECTION KEY < FILE
# read an .ini-style config file, find the KEY in the given SECTION, and return
# the value provided for that key.
@@ -48,14 +50,16 @@ rulesfile="/etc/udev/rules.d/90-anaconda.rules"
# try to find a usable runtime image from the repo mounted at $mnt.
# if successful, move the mount(s) to $repodir/$isodir.
anaconda_live_root_dir() {
- local img="" iso="" mnt="$1" path="$2"; shift 2
+ local img="" iso="" srcdir="" mnt="$1" path="$2"; shift 2
img=$(find_runtime $mnt/$path)
if [ -n "$img" ]; then
info "anaconda: found $img"
[ "$mnt" = "$repodir" ] || mount --move $mnt $repodir
+ anaconda_auto_updates $repodir/$path/images
else
if [ "${path%.iso}" != "$path" ]; then
iso=$path
+ path=${path%/*.iso}
else
iso=$(find_iso $mnt/$path)
fi
@@ -65,6 +69,7 @@ anaconda_live_root_dir() {
iso=${isodir}/${iso#$mnt}
mount -o loop,ro $iso $repodir
img=$(find_runtime $repodir) || { warn "$iso has no suitable runtime"; }
+ anaconda_auto_updates $isodir/$path/images
fi
# FIXME: make rd.live.ram clever enough to do this for us
if [ "$1" = "--copy-to-ram" ]; then
@@ -78,6 +83,31 @@ anaconda_live_root_dir() {
[ -e "$img" ] && /sbin/dmsquash-live-root $img
}

+# find updates.img/product.img/RHUpdates and unpack/copy them so they'll
+# end up in the location(s) that anaconda expects them
+anaconda_auto_updates() {
+ local dir="$1"
+ if [ -d $dir/RHupdates ]; then
+ copytree $dir/RHupdates /updates
+ fi
+ if [ -e $dir/updates.img ]; then
+ unpack_updates_img $dir/updates.img /updates
+ fi
+ if [ -e $dir/product.img ]; then
+ unpack_updates_img $dir/product.img /updates/tmp/product
+ fi
+}
+
+# Unpack an image into the given dir.
+unpack_updates_img() {
+ local img="$1" tmpdir="/tmp/${1##*/}.$$" outdir="${2:+/updates}"
+ # NOTE: unpack_img $img $outdir can clobber existing subdirs in $outdir,
+ # which is why we use a tmpdir and copytree (which doesn't clobber)
+ unpack_img $img $tmpdir
+ copytree $tmpdir $outdir
+ rm -rf $tmpdir
+}
+
# These could probably be in dracut-lib or similar

copytree() {
--
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 08:18 PM.

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