I have a customized Ubuntu ISO, where I have all my required packages being installed, from the /pool/extras/
directory. Now, I want to be able to copy one of the packages (.deb
) from this /pool/extras
directory and save it to another location, say to the home directory of a user that I know exists (/home/myuser/
).
I tried adding this in the preseed
d-i preseed/late_command string if [ -f /media/cdrom/pool/extras/mypkg.deb ]; then cp -f /media/cdrom/pool/extras/mypkg.deb /home/myuser; fi
But this didn't seem to work!, is this approach correct ? or is there any other way that I can get the package (at a later stage, maybe) from /pool/extras
?
I have at least a suggestion for you. I know that this works, because I work on a project with Ubuntu 14.4 and this mechanism works for me.
First the preesed.cfg preseed-lat command
The file that we call script here contains the code that gats executed while the
installation:
something like
as you see this approach requires a webserver. If you have an ISO as your case ju can store both files in the root of your ISO and use the following
In this case the script has to be in the same directory then the preseed.cfg
In the example above the script file juust copies run.sh to the profile.d directory in wich every sh file is being executed when a user is logging in.
Depending on what you want to do you can either use the script file itself to copy your files with sh-shell commands or use the sh file in profile.d with bash after the user has loggd in and delet it if thae actions are done.
Finally, the ISO way didnt work for me, so the workaround I used is, via
dpkg
:In my
.deb
package, in thepostinst
script (bash
), I added a section like:surprisingly enough, when I logged the path, it was indeed
/media/cdrom/pool/extras/mypkg.deb
(as used in thelate_command
string!) :(Not sure why it didn't work via
d-i preseed/late_command