Running a script just before installation of Debian finishes using preseed
Asked Answered
P

1

6

I am trying to run a script just before the installation of Debian Wheezy finishes. I am aware of "d-i preseed/late-command", viz. used run commands before the installation finishes. But I am facing a problem. I cannot figure out where to copy my script in the iso file. I tried following two approaches:

  1. I tried to copy my script inside the root directory of initrd.gz (/install.386/initrd.gz) file and did the following changes in preseed.cfg: d-i preseed/late-command in-target sh /my_script.sh
  2. I also tried to copy my script in the root directory of the iso file and did the following changes in preseed.cfg: d-i preseed/late-command in-target sh /media/cdrom/my_script.sh

So, where to copy a file (here in my script) so that I can use it in late-command?

Polacca answered 1/3, 2015 at 20:0 Comment(1)
Want to know this.Lilias
T
1

This solution is based on the fact that you use a USB to install the OS, and that you will have in the root of the USB a folder called files where you will have the file preseed.cfg and an executable called run.sh.

This command will copy the file run.sh to the root of the user root and there it will execute the script.

d-i preseed/late_command string cp /cdrom/files/run.sh /target/root/; chmod +x /target/root/run.sh; in-target /bin/bash /root/run.sh

After this you can use rm to delete the file. You can also run the script directly from the USB (without copying it), but after some tests I have verified that it can induce human errors

Thereby answered 16/7, 2021 at 21:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.