Postdownloadscript help
-
Hi,
i’ll try the postdownloadscripts for driver installation.
[CODE]#!/bin/sh
This file serves as a starting point to call your custom postimaging scripts.
<SCRIPTNAME> should be changed to the script you’re planning to use.
Syntax of post download scripts are
#. ${postdownpath}<SCRIPTNAME>
if [ $osid == “5” -o $osid == “6” -o $osid == “7” ]; then #only handling Win7/8/8.1
clearScreen;
mkdir /ntfs &>/dev/null
ntfs-3g -o force,rw $part /ntfs #mount image (remember this is mounting partition [U][B]after[/B][/U] new image is deployed)
mkdir /fog &>/dev/null
mount -o nolock,proto=tcp $storageip:/fog/ /fog #this is a share created on server under /fog which contains drivers, software etc… (just add /fog to exports but you could use existing location i.e. /images and if you do, do not need to do this mount as /images is still mounted at this point)
dots “Mounting Device”;
if [ “$?” = “0” ]; then
echo “Done”;
. ${postdownpath}fog.drivers # run fog.drivers script
umount /ntfs; # unmount when all is done
else
echo “Failed To Mount Device”;
sleep 30;
fi
fi
[/CODE]And
[CODE]#!/bin/sh
ceol=
tput el
;
machine=dmidecode -s system-product-name
; # Gets machine model
machine=“${machine%”${machine##*[![:space:]]}“}” #Removes Trailing Space
system64=“/ntfs/Windows/SysWOW64/regedit.exe”; # dirty way to determine if it’s 64bit or not
if [ -f “$system64” ]; then
setarch=“x64”
else
setarch=“x86”
fiif [ $osid == “5” ]; then
osn=“Win7”
elif [ $osid == “6” ]; then
osn=“Win8”
elif [ $osid == “7” ]; then
osn=“Win8.1”
fi
#############################################
dots “Preparing Drivers”;
mkdir /ntfs/Windows/DRV &>/dev/null;
echo -n “In Progress”;rsync -aqz “/fog/Drivers/$osn/${machine}/$setarch” /ntfs/Windows/DRV &>/dev/null;
#if you wanted to use driver.cab use this line below.
#i.e. /fog/Drivers/Win7/Latitude E5410/E5410-Win7-A07-KTT4G.CAB
cabextract -d /ntfs/Windows/DRV “/fog/Drivers/$osn/${machine}”/*.CAB &>/dev/null;#if you wanted to mix both cab and extracted use these:
rsync -aqz --exclude='.CAB’ “/fog/Drivers/$osn/${machine}/$setarch” /ntfs/Windows/DRV &>/dev/null;
cabextract -d /ntfs/Windows/DRV “/fog/Drivers/$osn/${machine}”/.CAB &>/dev/null;#this next bit adds driver location on pc to devicepath in registry (so sysprep uses it to reference)
remember to make devicepath= match the path you’ve used locally
#also do not remove %SystemRoot%\inf
#and to add more locations just use ; in between each location
regfile=“/ntfs/Windows/System32/config/SOFTWARE”
key=“\Microsoft\Windows\CurrentVersion\DevicePath”
devpath=“%SystemRoot%\inf;%SystemRoot%\DRV”;
reged -e “$regfile” &>/dev/null <<EOFREG
ed $key
$devpath
q
y
EOFREG
echo -e “\b\b\b\b\b\b\b\b\b\b\b${ceol}Done”; # this just removes “In Progress and replaces it with done :-)”[/CODE]my drivers are on a second drive on the server and the mount path is /partages/Drivers, and i make a “ln” to /fog/Drivers
and i try with Hp Elitebook 8560w - /partages/Drivers/Win7/HP EliteBook 8560w/x64
The script create the DRV drivers on the fresh fog machine but don’t transfert the drivers.
What’s wrong with my code ?
help a noob plz
Olivier
-
Do you see any error messages???
-
No error message
and no error log
-
reason you don’t see any error logs is - [FONT=Consolas]&>/dev/null remove this temporarily from the end of the lines, you are best to do a download debug so you can see each step, if it does fail do the process manually[/FONT]
-
i remove “- [FONT=Consolas]&>/dev/null” and still no error log. how can i do the process manually ?[/FONT]
-
Is it possible errors come from the link directory ?
-
- [FONT=Consolas]&>/dev/null does not create log it stops it from supressing prints i.e. error messages/warnings.
most likely educated guess link directory… i would change all [/FONT][FONT=Consolas]/fog/Drivers paths direct in script to [/FONT]/partages/Drivers (or wherever you have your drivers directory)
also it’s case sensitive with model name (i never added any handling for directories) so best thing to do to rule that out is copy Model Name from FOG-> Hardware inventory
and when i said manually i meant remove disable postscripts … On fog do… basic tasks-> advanced ->download deploy let it image and before it boots (when postscripts normally runs) press ctrl +C to go to command/terminal then do each line individually
[FONT=Consolas]mkdir /ntfs &>/dev/null[/FONT]
[FONT=Consolas]ntfs-3g -o force,rw $part /ntfs[/FONT][FONT=Consolas]if it fails see what $part echo’s at (echo $part;)[/FONT]
-
“rsync: change_dir “/fog/Drivers/Win7/3113CW3” failed: no such files or directory(2)” Here the error i have
[CODE]root@Fog:/fog/Drivers/Win7/3113CW3# ls
x64 x86
[/CODE]and in x64 i have my ethernet drivers
and my postdownloadscripts and /fog/Drivers are with 777 -R Chmod
-
This post is deleted! -
mount : mounting 192.168.123.6:/fog on /fog : permission denied
and This rsync lacks old-style --compress due to its external zlib
and after i have
“rsync: change_dir “/fog/Drivers/Win7/3113CW3” failed: no such files or directory(2)” -
looks like /fog it not mountable - have you added /fog to exports?
1 edit: /etc/exports
2. add this line: /fog *(ro,sync,no_wdelay,insecure_locks,no_root_squash,insecure,fsid=4)
3. save file
4. run: exportfs -aother thing to note: make sure fsid=4 is correct, as long as you haven’t modified the exports it should be but if not just make sure it’s the next unique number
also if you’re going to use /fog directory you will need to manually add this into exports everytime you upgrade as fog overwrites exports (removing this line in the process)
-
Oh nice, thanks.
fog mounted !!still have the others errors lol
“This rsync lacks old-style --compress due to its external zlib”
“rsync: change_dir “/fog/Drivers/Win7/3113CW3” failed: no such files or directory(2)” -
[quote=“TheKoR, post: 44040, member: 24285”]Oh nice, thanks.
fog mounted !!still have the others errors lol
“This rsync lacks old-style --compress due to its external zlib”
“rsync: change_dir “/fog/Drivers/Win7/3113CW3” failed: no such files or directory(2)”[/quote]Have you verified that this path exists? /fog/Drivers/Win7/3113CW3
Keep in mind that Linux is case sensitive for directories, and a lot of other stuff (it gives me woes sometimes!).
So, your script probably should be case-sensitive too. -
Hi wayne,
sorted this out in the end through chat - was down to link to /fog… used existing location instead and change script to match and all working but ur response was my first response too
-
[quote=“Lee Rowlett, post: 44082, member: 28”]Hi wayne,
sorted this out in the end through chat - was down to link to /fog… used existing location instead and change script to match and all working but ur response was my first response too :)[/quote]
Awesome. That’s good.
AND, I’d like to say something about FOG in general…
FOG was an experiment for me. I was relentlessly pursuing an alternative for imaging. My work was using Ghost & Deploy Studio. My boss was considering Acronis Snap Deploy… which is really expensive.
I set out to prove that FOG would work in our environment. Now, mind you, I’ve taken a Linux class at college, we only worked in Terminal. But, I wasn’t savvy at it at all. I was “Comfortable” being an average user with Linux, nothing special really (still not anything special).
So, I spent weeks putting together FOG on Fedora in a VM. I learned sooo much about Linux during those weeks. I’ve slowly started helping people on here where I can. I’ve since become so comfortable that I’ve gone totally Fedora at home (using it now).
I’ve plummeted into learning C++, using Fedora. I’ve always said I wanted to learn it, but this was the prime moment because I was using Linux (I’m very, very proficient with VB.NET). I’ve been following online tutorials, doing online exercise problems, writing code, compiling, learned how to run executables from Terminal, Became really reliant on GREP and other Terminal commands in general.
And today, it really hit me. FOG opened the door to all of this for me, honestly. Just today, I blew through Terminal at work on OSX 10.6.8, navigating through directories like a pro, unpacking files, using CAT, GREP, all due to my recent learning of Linux.
SO,
Point of this little story is, an AMAZING solution like FOG, So amazing that it draws in people like me, ultimately, increases the numbers in the Linux community inevitably. That’s how good FOG is. -
Thanks guy for help.
We don’t really use fog like many of you.
We are refurbisher, we buy lot of used professional stuff and sell to end customer with low cost.
When i came in the company, they used a old Ghost server and we test fog, loved and adopted !
I am not really good in english, and sometimes, it’s hard to follow technicals threads, but i learn lot of thing on linux.
You are all devoted to this project, and it’s nice to be able to discuss and improve the project with you.