# boot script



## cpm@ (May 16, 2012)

I need help to write a boot script.

Where must I place the command? 

[cmd=]pciconf -w pci0:7:6:2 76 34[/cmd]

It is necessary that this shell script starts during boot.


----------



## DutchDaemon (May 16, 2012)

Easiest would be to put it in root's crontab (*crontab -e* as root) at the @reboot time, or in /etc/rc.local (you'll need to create it). Make sure you use the full path name for the script, and for the commands in it.


----------



## cpm@ (May 16, 2012)

Something like


```
@reboot /path/to/file.sh
```


----------



## cpm@ (May 17, 2012)

I try in the crontab entry


```
@reboot exec /path/to/file.sh &
```

file.sh contains


```
pciconf -w -b pci0:7:6:2 76 34
```

But... no luck x(


----------



## DutchDaemon (May 17, 2012)

'exec' is unneeded, and I said to use full paths everywhere.


----------



## cpm@ (May 17, 2012)

Partially I solved this thread

I create /etc/rc.local


```
#!/bin/sh

/bin/sh /home/cjpm/sdhc.sh
```

Script start at boot time but I need that my script run before or same time /boot/loader.conf

Any suggestion are welcome


----------



## cpm@ (May 19, 2012)

Posting the latest developments.



			
				cpu82 said:
			
		

> Partially I solved this thread
> 
> I create /etc/rc.local
> 
> ...



When I insert the SD card it is detected correctly, but I'm still not able to mount the file system. I think it is necessary that the startup script should be started before loading modules in this order.

/boot/loader.conf


```
mmcsd_load="YES"
mmc_load="YES"
sdhci_load="YES"
```


----------



## bbzz (May 19, 2012)

Sorry, what filesystem? What is the issue?


----------



## cpm@ (May 19, 2012)

bbzz said:
			
		

> Sorry, what filesystem? What is the issue?



Look at this thread.


----------

