Skip to content

Commit

Permalink
contextualize from hdd
Browse files Browse the repository at this point in the history
  • Loading branch information
jblomer committed May 7, 2014
1 parent 125889c commit e076fa3
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions hepix/extra/hepix_functions
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,25 @@ getResourcesFromCD() {
context_disk_found=""
mount_dir=$(mktemp -d)

for dev in /dev/sr{0,1} /dev/{xv,v,h,s}d{c,d,b}; do
for dev in /dev/sr{0,1} /dev/{xv,v,h,s}d{c,d,b}{,1}; do
if [ -e "${dev}" ] ; then
rdisk=$dev
logger -t $0 "Attempting to mount contextualization image from $rdisk"
mount -t iso9660 ${rdisk} $mount_dir > /dev/null 2>&1
if [ 0 -eq $? ]; then
if [ -e "$mount_dir/prolog.sh" -o -e "$mount_dir/context.sh" ]; then
cp -r $mount_dir/* $CONTEXT_DIR/
chmod 700 $CONTEXT_DIR
context_disk_found="indeed"
break
else
umount $mount_dir >/dev/null 2>&1
fi
fi
fstype=$(blkid $rdisk | awk '{print $4}' | sed s/TYPE=// | tr -d \")
if [ "x$fstype" = "xiso9660" -o "x$fstype" = "xvfat" ]; then
logger -t $0 "Attempting to mount contextualization image from $rdisk"

mount -o ro ${rdisk} $mount_dir > /dev/null 2>&1
if [ 0 -eq $? ]; then
if [ -e "$mount_dir/prolog.sh" -o -e "$mount_dir/context.sh" ]; then
cp -r $mount_dir/* $CONTEXT_DIR/
chmod 700 $CONTEXT_DIR
context_disk_found="indeed"
break
else
umount $mount_dir >/dev/null 2>&1
fi
fi
fi
fi
done
if [ -z "${rdisk}" ]; then
Expand Down

0 comments on commit e076fa3

Please sign in to comment.