I am trying to do some automatic installation and I need to run some commands as early as possible. So I modified my USB Installation medium (Ubuntu 16.04) and added:
menuentry "Install automatically" {
set gfxpayload=keep
linux /casper/vmlinuz.efi file=/cdrom/auto.seed preseed/early_command=/cdrom/early.sh boot=casper auto=true automatic-ubiquity debug-ubiquity quiet splash ---
initrd /casper/initrd.lz
}
this is explained here: https://wiki.ubuntu.com/UbiquityAutomation and here https://wiki.ubuntu.com/DesktopCDOptions
The file early.sh is on my USB stick as my auto.seed file (which is loaded just fine). But it seems my early.sh script is never run.
I just want to copy a file to the live system:
#!/bin/bash
cp /cdrom/wlan /root/etc/NetworkManager/system-connections/wlan;
chmod 0600 /root/etc/NetworkManager/system-connections/wlan;
I have prefixed it with /root as explained in the links above. I have even tried:
#!/bin/bash
touch /root/test
When I stop the installation before partman is running, I get the usual Live Desktop and I am expecting to open a console and see /root/test
. But I don't.
I was looking at /var/log/syslog and I can see the boot parameters but no further log lines about early_command
My preseed file contains lines like this:
d-i preseed/early_command string in-target touch /root/test
How can I debug this situation? It is annoying to start over and over again.
I think with ubiquity early_command and late_command are simply not working. So now I am using something like
These commands work fine and I setup my wifi and do other fixes to my installation before reboot.