SVN 4103 Cloud 4848 Lenovo L420 manufacturer base image
-
Getting a strange error while uploading a non-resizable Win7 image. The video of it is below. I believe that this image trying to be captured is based on a manufacturer-image.
It’s a Lenovo L420. FYI I’ve taken images from this model in my building successfully using scratch-images. Another building is getting this error.
Do the @Developers know if this has been solved in the latest?
Video:
https://drive.google.com/file/d/0B30HraDw5zU5emxIUlJhSG5CWU9ncHFxQjdtYXZwMHMwTkww/view?usp=sharing -
Looking at the actual file from this revision here: http://sourceforge.net/p/freeghost/code/4103/tree/trunk/src/buildroot/package/fog/scripts/usr/share/fog/lib/funcs.sh#l903
Line 896 is what sets the count:
local count=`sfdisk -d "${disk}" 2>/dev/null | \ awk /start=\ *[1-9]/'{print $4+0}' | sort -n | head -n1`;
Then it’s checked to see if it’s under two MB on line 904:
if [ "$count" -gt 2048 ]; then count=2048; fi
Looking at the latest revision’s copy of this file, I can see that the code is still the same here:
local count=`sfdisk -d "${disk}" 2>/dev/null | \ awk /start=\ *[1-9]/'{print $4+0}' | sort -n | head -n1`; local has_grub=`dd if=$1 bs=512 count=1 2>&1 | grep GRUB`; if [ "$has_grub" != "" ]; then local hasgrubfilename=`hasGrubFileName "${imagePath}" "${disk_number}"`; touch "$hasgrubfilename"; fi # Ensure that no more than 1MiB of data is copied (already have this size used elsewhere) if [ "$count" -gt 2048 ]; then count=2048; fi
-
The “Hack note” is especially interesting in svn 4103 of this file: trunk / src / buildroot / package / fog / scripts / usr / share / fog / lib / funcs.sh
saveGRUB() { local disk="$1"; local disk_number="$2"; local imagePath="$3"; # Determine the number of sectors to copy # Hack Note: print $4+0 causes the column to be interpretted as a number # so the comma is tossed local count=`sfdisk -d "${disk}" 2>/dev/null | \ awk /start=\ *[1-9]/'{print $4+0}' | sort -n | head -n1`; local has_grub=`dd if=$1 bs=512 count=1 2>&1 | grep GRUB`; if [ "$has_grub" != "" ]; then local hasgrubfilename=`hasGrubFileName "${imagePath}" "${disk_number}"`; touch "$hasgrubfilename"; fi # Ensure that no more than 1MiB of data is copied (already have this size used elsewhere) if [ "$count" -gt 2048 ]; then count=2048; fi local mbrfilename=`MBRFileName "${imagePath}" "${disk_number}"`; dd if="$disk" of="$mbrfilename" count="${count}" bs=512 &>/dev/null; }
-
So on line 904, we have this:
if [ "$count" -gt 2048 ]; then count=2048; fi
which is basically saying
if sectors of the MBR is greater than 2048, then set the sector count to 2048.
But the error in the above video says “Integer expression expected”. So we can assume what
count
contains in this instance is not an integer… -
@Developers What do you think of this?
—edited—
if [ "$count" -eq "$count" ] 2>/dev/null then if [ "$count" -gt 2048 ]; then count=2048; fi else echo "ERROR: The sector count of the MBR was not returned properly, assuming 2048." count=2048; fi
-
So, in a debug upload, in the variable dump, the HD is listed as
/dev/sda
as usual.However,
sfdisk -d /dev/sda
has no useful output. -
Could one of the @Developers help me understand what is done with the files inside of
/trunk/src/buildroot/package/fog/scripts/usr/share/fog/lib
during installation ?
The only place I can find them on my server is in that location.What is done with those during the installation? Where do they go? Where are they placed?
-
Those are nothing more than the source files to what/how our inits work. They’re not installed anywhere and nothing is done with them during installation.