1

All,

I have a shell script which is attempting to both copy and install a .deb as part of a late_command. I used what I found from this link as a guide.

https://gist.github.com/moonwitch/11100762

Here are the echo commands appending things to the end of lubuntu.seed

echo "d-i preseed/late_command string \ " >> "$WORK_DIR/preseed/lubuntu.seed"
echo "cp /cdrom/pool/extras/my.deb . ; \ " >> "$WORK_DIR/preseed/lubuntu.seed"
echo "d-i preseed/late_command string in-target dpkg -i /cdrom/pool/extras/my.deb ; " >> "$WORK_DIR/preseed/lubuntu.seed"

What really honks me off is the cp command doesn't appear to leave the file on the target no matter what I do. There are some other things I would like to copy and unzip.

I'm working with Ubuntu 15 32-bit. Really don't care about tools that "used to work" with earlier releases. I have spent 3 days searching through every discussion and every example/tool was for a really old version of Ubuntu. Haven't found one which still works today. Some kind of run, but they don't fully function.

My current problem is due to the fact I'm not a packager person, but this has to get done and I didn't get out of the way fast enough.

What I need is an actual functioning cp statement which copies a file from the CD to the target and leaves it there through reboot. So far nothing has.

Thank you

Satya
  • 8,693
  • 5
  • 34
  • 55
user3450148
  • 851
  • 5
  • 13

1 Answers1

1

This is the line I used for the late command:

d-i preseed/late_command string cp /cdrom/somefile /target/system/folder && cp /cdrom/someshellscript.sh /target/system/folder && chroot /target chmod a+x /target/system/folder/someshellscript.sh && chroot /target sh /system/folder/someshellscript.sh

I appended the line above to my preseed file. This line basically copies some script from the cdrom or iso to some folder in the target system. During installation the /target folder is the "target" systems root system (get it?).

So for me I copied all the files I need from the CD or iso to some folder like root or opt or even tmp in the target system. Then I changed root to /target and executed all the regular linux commands. Wrote a shell script that executes after all the copying is done to do what I want it to do.

Note:

Inside my shell script, I unset all of the installer's environment stuff:

unset DEBCONF_REDIR 

unset DEBCONF_FRONTEND

unset DEBIAN_HAS_FRONTEND

unset DEBIAN_FRONTEND

Then proceed accordingly.

Hope this helps.

kittykittybangbang
  • 2,380
  • 4
  • 16
  • 27
NOOBIE
  • 43
  • 3
  • Thanks for replying. I guess I should have came back and deleted this. I solved the problem about a week after asking. Needed to be a ubiquity late command, not a d-i to actually work. – user3450148 Aug 29 '15 at 18:46