Hello.
I got a point of interest, but Google and mans couldn't help. Either they don't know or I ain't able to understand.
I try to preseed Stretch, one of tasks is to copy some stuff from installation media during setup. The stuff is as large as 15 GB, thus I'd like to avoid wget.
I found three places to run cp in preseed, but all of them are a bit out of point:
preseed/early_command and partman/early_command are run before partitioning.
preseed/late_command is run after installation media is unmounted.
Thus, I cannot cp from installation media to new system because there's no place where both of them are accessible.
Now I Alt+F2 and run commands by hands while setup does it's magic, but the way doesn't seem to be unattended.
Did someone do something like this? Maybe you can help me with my task?
Thanks in advance.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Debian Installer and copy files
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Debian Installer and copy files
I've not tried this but does copying the files to /tmp as an early_command then copying it out again as a late_command work?
deadbang
Re: Debian Installer and copy files
Well... As there is no storage available at the moment of early_command, root is mounted as a kind of ram-disk.Head_on_a_Stick wrote:I've not tried this but does copying the files to /tmp as an early_command then copying it out again as a late_command work?
I tried your advice and can confirm: while my VM had 4 GB of RAM, "cp -R /cdrom/10GBdir /tmp/" made busybox totally unusable ("cannot fork" error on any command), and after I increased RAM to 16 GB the same cp worked like a charm.
Thus I cannot transfer stuff this way if it is greater than RAM size.
But your idea helped me.
First of all, I disabled disk eject.
Code: Select all
d-i cdrom-detect/eject boolean false
Code: Select all
d-i partman/early_command string \
mount | grep 'iso9660' | sed 's/\(.*\)\son\s\(.*\)\stype.*/\1 \2/' > /tmp/mnt.dd
And, after all, I mounted back the installation disk and copied all I needed:
Code: Select all
d-i preseed/late_command string \
mount `cat /tmp/mnt.dd`; \
media=`sed 's/.*\s\(.*\)/\1/' /tmp/mnt.dd`; \
cp -R $media/somestuff /target/srv; \
umount $media; \
unset media