Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

"Your kindle needs repair" after running ./run.sh manually #1

Closed
kennedn opened this issue Mar 4, 2022 · 1 comment
Closed

"Your kindle needs repair" after running ./run.sh manually #1

kennedn opened this issue Mar 4, 2022 · 1 comment

Comments

@kennedn
Copy link

kennedn commented Mar 4, 2022

Hi,

First of all, great project!

I ran in to a bit of an issue earlier today after running ./run.sh manually and thought it may be worth documenting how I fixed it and maybe providing some script considerations for run.sh to prevent it from happening to anyone else.

I ran run.sh manually today via an ssh session and later ctrl + c'ed the script when I was done running doom. I knew due to the ctrl + c that /etc/init.d/framework start would have never ran, so I invoked that manually too. My kindle then went into a framework restart loop and eventually entered an unclean state where even after subsequent reboots, I was presented with the dreaded "Your kindle needs repair" message.

I still had ssh access though and was able to step through a run of /etc/init.d/framework start to find out that the repair message was being displayed on the back of the contents of /var/local/system/.framework_reboots being >= 2.

I was able to exit the repair screen by removing this file and rebooting, I think setting the contents to a number less than 2 would have also worked.

So as for the script, I have done a bit of debugging and it appears you have windows line endings in run.sh inside your releases (not in the actual repo itself):

#!/bin/sh^M
^M
/etc/init.d/framework stop^M
/usr/bin/lipc-set-prop -- com.lab126.powerd preventScreenSaver 1^M
./prboom -iwad /mnt/us/doom.wad -file /mnt/us/prboom.wad -nosound -nomusic -nosfx -warp 1 1^M
/usr/bin/lipc-set-prop -- com.lab126.powerd preventScreenSaver 0^M
/etc/init.d/framework start     ^M

This causes the last argument of most lines in the script to be invalidated, so in the case of /etc/init.d/framework stop^M, this prevents execution:

+ /etc/init.d/framework stop
system: W framework:def:Usage: /etc/init.d/framework {startx|start|stop|reset|restart|force-reload}

So in my case, the repair issue was actually user error. As I assumed that the framework was in a stopped state and attempted to start it, causing problems. However due to those line endings the only command that actually works in run.sh is probably the ./prboom command at present. So probably worth fixing this.

Cheers,

@simsor
Copy link
Owner

simsor commented May 19, 2023

Thanks for the report! Indeed, that's my fault for developing this under Windows and not being careful enough 😅

I'm migrating this repository out of GitHub. I'll follow up on this issue over at https://git.sixfoisneuf.fr/kindle-doom/tree/.issues/open/wrong-line-endings-run.sh.md

@simsor simsor closed this as completed May 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants