Tom,
I found some time to just dive in. In the init image, under bin/fog.av, the code that selects the partition is this:
[CODE]part=$hd’1’;[/CODE]
If the OS is set to windows 7, then it simply selects the last partition of all the partitions.
[CODE] if [ “$osid” == “5” ]; then
win7partcnt=“0”;
parts=fogpartinfo --list-parts $hd 2>/dev/null
;
for prt in $parts
do
win7partcnt=expr ${win7partcnt} + 1
;
done
part=${hd}${win7partcnt};
fi
[/CODE]
To obtain the behavior I was speaking of, I added this simple bit to the fog.av script:
[CODE]
partNum=“1”;
partNum=`parted $hd -m print | grep 'boot' | sed -n 's/^\([0-9]\+\).*/\1/p'`;
part=$hd'1';
if [ -n "$partNum" ]
then
part=$hd$partNum;
fi
[/CODE]
This finds the boot partition on the selected hard drive, then uses that partition number, instead of just selecting partition 1. When will this not work? Dual boot machines would likely have a problem, but there’s a 50% (or 33%) chance they wouldn’t work in the original configuration anyway. But on dual partition (where one partition is a recovery partition) and single partition machines, this works great. I have a clamscan running on a previously offending computer now.
The code above is not a final solution. I will be creating a function under the funcs.sh script and applying it to the rest of the scritps as I see fit. I’ll probably also refine the sed portion a little bit.
Can you see any issue with this method which makes it worse off than just using $hd’1’?
I’ve only used git, but I can submit a pull request (or whatever the equivalent terminology is for svn) of my completed work if you see no issue so far.