StoopKid
Posts: 41
Joined: Thu Jul 19, 2012 5:41 am

Setting static IP from boot partition

Sun Oct 22, 2017 9:15 pm

I really like using the auto copying wpa_supplicant.conf and ssh file in the boot partition to set up my Pi's headless. The only thing I am missing is setting my IP static st the same time. I could edit the interfaces file from a linux machine but it would be really great if I could do it the same way the wpa_supplicant file is done.

Is this possible?

Alternatively, is there a way to auto-run a script from the boot partition? If so, I can figure out the rest myself.

drgeoff
Posts: 7401
Joined: Wed Jan 25, 2012 6:39 pm

Re: Setting static IP from boot partition

Sun Oct 22, 2017 9:34 pm

StoopKid wrote:
Sun Oct 22, 2017 9:15 pm
I could edit the interfaces file from a linux machine
Editing the interfaces file has been the wrong thing to do since Raspbian Jessie. The first few lines of that file inform you about that.

StoopKid
Posts: 41
Joined: Thu Jul 19, 2012 5:41 am

Re: Setting static IP from boot partition

Sun Oct 22, 2017 9:57 pm

Ok. well then how do I auto-run a script or set dhcpcd.conf from the boot partition?

RonR
Posts: 179
Joined: Tue Apr 12, 2016 10:29 pm
Location: US

Re: Setting static IP from boot partition

Mon Oct 23, 2017 3:59 am

StoopKid wrote:
Sun Oct 22, 2017 9:57 pm
Ok. well then how do I auto-run a script or set dhcpcd.conf from the boot partition?
The attached RPi-Init will permit you to run a supplied script from the boot partition on the first boot.

Description:

RPi-Init is a Windows program that patches a Raspberry Pi image file to perform the following when booted the first time:

1. Optional: Enable SSH (without the need to create an 'ssh' file in the boot partition)

2. Optional: Permit Root Login Via SSH using a specified Password
(If 'Permit Root Login Via SSH' is not selected, initial login must be done through pi:raspberry)

3. Optional: Include Additional Script File (to be executed during the first boot)

No installation is required and no changes are made to your Windows system by RPi-Init.

In addition to patching a Raspberry Pi image file, RPi-Init creates a file named 'rpi_init' which must be copied to the
boot partition of the SD card prior to inserting the SD card in the Raspberry Pi. On the first boot, /boot/rpt_init is
executed prior to /etc/rc.local and then rpi_init is deleted.

Upon completion of the initial Raspberry Pi boot, the image on the SD card will be restored to its original virgin state.
Attachments
RPi-Init.zip
(31.1 KiB) Downloaded 30 times

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 24 guests