Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WakeOnLan before booting #3130

Merged
merged 2 commits into from Apr 25, 2014
Merged

WakeOnLan before booting #3130

merged 2 commits into from Apr 25, 2014

Conversation

lynara
Copy link
Contributor

@lynara lynara commented Apr 25, 2014

I'm using an NFS share as storage partition. Since my NAS shuts down if it is not needed I have to start it manually every time before starting my openelec.
I thought it would be nice if openelec would do this for me before starting up, so I modified the initramfs to check weather the NAS is running or not. If it is not running we send out a magic packet to boot it up. I have added the following parameters for the kernel cmd line:
"wol_mac=" for the mac-address to wake (e.g. 00:00:00:00:00:00)
"wol_ip=" the ip of the device to check whether it is running or not (e.g. 192.168.1.12)
"wol_wait=" to specify a delay after the magic packet was send before continuing booting

Hope this little feature can be added :)

@fritsch
Copy link
Contributor

fritsch commented Apr 25, 2014

Seems non intrusive.

What happens if your NAS would need longer than usual? e.g. wol_wait is not sufficient? It will just not continue? Is there a chance this will harm something?

You would also consider being maintainer of the "network boot section" to maintain, document that?

@lynara
Copy link
Contributor Author

lynara commented Apr 25, 2014

Hi,
if the NAS would need longer same thing will happen as if it isn't running. Boot process will stop and will display:
"*** Error in mount_storage: mount_common: Could not mount 192.168.1.12:/mountpoint ***

Starting debugging shell..."

In addition the mount_common command has an additional own timeout value, which extends the delay a litte bit.

I can't imaging that there can be done any harm, since everything which is present / mounted at that point is read-only.

By "You would also consider being maintainer of the "network boot section" to maintain, document that?" you mean if I could add a section to the wiki page and document how this WOL works and how it can be configured? - I could do that.

Just to point it out, KERNEL and SYSTEM image are loaded from sd-card, only /storage is located on NFS, think this is a good way if you're using a raspberry pi.

@stefansaraev
Copy link
Contributor

nice done.
would be nice if you squash last 3 commits (init) ;)

@lynara
Copy link
Contributor Author

lynara commented Apr 25, 2014

Thanks.
Hope I did the squashing the right way?

@fritsch
Copy link
Contributor

fritsch commented Apr 25, 2014

Does not look it it.

git fetch oe-upstream
git rebase -i oe-upstream/master

pick all those, that you want to have single picked and for those to squash, write pick infront of the first one and squash in front of the rest under it.

backup your branch before rebase foo :-) via git branch mylovelbackup

@lynara
Copy link
Contributor Author

lynara commented Apr 25, 2014

Thank you, think i got it now :)

@fritsch
Copy link
Contributor

fritsch commented Apr 25, 2014

Really nice. Thx again. Please think about documentation.

@fritsch
Copy link
Contributor

fritsch commented Apr 25, 2014

ERR: don't forget I wanted to say :-)

sraue added a commit that referenced this pull request Apr 25, 2014
@sraue sraue merged commit e8f62dc into OpenELEC:master Apr 25, 2014
@stefansaraev
Copy link
Contributor

cosmetics to match overall code style in init:

   if [ -n "$wol_ip" -a -n "$wol_mac" -a -n "$wol_wait" ]; then
      if ! ping -q -c 2 "$wol_ip" &>/dev/null; then
...

EDIT: ah too late. it's fine anyway :)

@lynara
Copy link
Contributor Author

lynara commented Apr 29, 2014

Thanks for merging :)

@fritsch did you receive my mail? If not here again the docu I wrote, hope it is alright:
http://pastebin.com/W0FBdJY8

@fritsch
Copy link
Contributor

fritsch commented Apr 29, 2014

@AndreasMN
Thanks much. As you are the maintainer now :-). Please contact @newphreak on IRC to get a wiki account and then this can go in. Thanks much again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants