Solved bsdinstall installerconfig copy files to chrooted new system

Hello,

I'm using a custom ISO with a bsdinstall installerconfig script.

What I know is that installerconfig is splitted by bsdinstall and everything behind the shebang (included itself) is executed after installation in the chrooted new system freshly installed. And that works pretty well ;)

But, I can't achieve a file copy from my custom ISO to the new system ! Hence I'm limited to the old school cat in the second part of my installerconfig...
cat > /my/new/system/file.sh << EOL
And I have to escape my $ to make them print on the final file...

Anyone with a clever idea ?

I appreciate your time on reading,
B
 
OK, I re (re) RTFM bsdinstall(8)...

For the record, the first part of installerconfig called PREAMBLE is:
[...] interpreted as a sh(1) script run at the very beginning of the install [...]
.
Which led me to just write cp /my/customiso/file.sh /mnt/etc/file.sh in the preamble, but I was wrong, /mnt is nothing and readonly on this step...

Then I read bsdinstall script content.

No way to get the new system to RW without "rewriting" a part of bsdinstall script (between the execution of /tmp/bsdinstall-installscript-aa and /tmp/bsdinstall-installscript-ab).

So I ended up altering /usr/libexec/bsdinstall/script on my custom ISO with cp /my/customiso/file.sh $BSDINSTALL_CHROOT/etc/file.sh just before it copies itself bsdinstall-installscript-ab to the new system...
 
Back
Top