guerlando
Posts: 10
Joined: Tue Mar 15, 2016 12:38 am

I need to edit files that are generated on first boot, but before its generation

Thu Aug 31, 2017 3:45 am

I'm writing a script to edit some files, like authorized_keys, wpa_supplicant.conf, etc. Some of this files may be generated only after the first boot. I thought of using the script to run QEMU to make the first boot on raspbian and then turn it off and continue editing the files, but i'd be cpu intensive and not necessary, there must be an easier way. What is the default behavior of debian (raspbian) when it boots and tries to create the files? Will it overwrite mine or just leave them there and not make anything? If so, I could just place the files pre-boot and it'd work. Can I also generate the SSH keys in the script before the first boot?

User avatar
karrika
Posts: 1123
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: I need to edit files that are generated on first boot, but before its generation

Thu Aug 31, 2017 5:27 am

You could study how raspi-config works. It writes lots of stuff that activates things at boot. Perhaps you could create some files on the SD card before the 1st boot that prevents raspi-config to overwrite the parts that are important for you.

https://github.com/RPi-Distro/raspi-con ... spi-config

Return to “General discussion”