Help newbie use Linux to make a Digital Picture Frame
I have an old laptop, that I installed in a picture frame. It needs to boot, login, and run a slideshow of pictures from a flash drive, with no user intervention. The program 'feh' works perfect for this because of it's excellent command line options.
It has only a 1GB CF card for a flash drive. I gave up on using DSL and installed a command-line Hardy Heron system. I didn't do any stripping down after installing a command line system, then I basically just apt-get'd xorg and feh. Feh runs fine without a window manager. The problems I have now are that I need it to auto-log me in, start x, and then run the slideshow, because I won't have a keyboard or mouse. 1. So I need to auto-login. I did a bit of searching but didn't find much. 2. I also need to place my 'startx' command somewhere, I'm not sure where. 3. And then, I need a permanent path for my 'start feh and play pictures' script, but I also need it to be on a flashdrive. So I think I might have to like add a 'mount flashdrive on boot' script in there somewhere, or put it in the fstab or something. I'm not sure if I'll be able to remove and reinstall the flashdrive (with updated pictures) with the system up and running, but I would like to. Apparently a commandline Hardy install and X fit on a 1GB flashdrive, but how can I check my free space? I'm used to like, using konqueror or system monitor or something. |
Okay, let's tackle your issues one by one (btw, the whole setup can be achieved in different ways - no guarantee this is the best)
How to autologin on console (NOTE: THIS IS MY WAY - THERE ARE OTHER WAYS (BETTER?) AND IT'S LOCALLY INSECURE) Create an empty file in /bin (or somewhere else): sudo touch /bin/autologin Open it with an editor i.e.: sudo vim /bin/autologin and put this in: #! /bin/bash exec login -f <your_username_here> Save it and make it executable: chmod a+x /bin/autologin Open /etc/event.d/tty<whatever_tty_you_want_to_use>: sudo vim /etc/event.d/tty2 Change the line: respawn exec /sbin/getty 38400 tty2 to: respawn exec /sbin/getty -l /bin/autologin -n 38400 tty2 Once you rebooted you should be automatically logged in on tty2. Report success and we'll try to achieve the rest. |
Ok I will. The process is tedious because I have to transfer this keyboard and mouse to the picture frame and then back. I'll try it soon.
|
It failed.
when I rebooted it says Ubuntu 8.04 frame tty1 frame login: _ Is this because it says frame tty1, when I used tty2 in the /bin/autologin? /bin/autologin has full permissions. EDIT: I realized that I can switch to tty2 by hitting ctrl+alt+f2. So I did. It does NOT display the frame login: _ prompt, but I also can't do anything. I can type whatever I want but nothing happens, it's not really a command prompt. Hitting ctrl+alt+Fn where n=1-6 takes me to a frame login: prompt except for tty2, which is kinda blank. I'm confused. This might mean it worked, but I expected it to log me in and return to a command prompt. |
Make sure you understand the instructions before you use them. "when I used tty2 in the /bin/autologin" - how did you use tty2 in that file? It does not specify tty at all - only in /etc/event.d you choose what tty you want to be logged in automatically so if you choose tty2 you obviously are not going to be auto logged in on tty1!
|
Quote:
|
It didn't work - when everything is done correctly you will be logged in and seeing command prompt as normal. Check for mistakes.
You've modified 2 files: /bin/autologin should look like this: Code:
#! /bin/bash AND be executable; And /etc/event.d/tty2 should look like this: Code:
# tty2 - getty |
ok I checked them and see no mistakes. /bin/autologin is -rwxrwxrwx.
the username on the system is chaz. I used chaz in the autologin file. I don't need a password anywhere? |
No you don't need password anywhere. The user 'chaz' must already exist on the system - i.e. before you all the above the user 'chaz' must have already existed on the system. If not you need to add him.
Having said that could you post the output from your /var/log/auth.log file. The best way to do it is to run: cat /var/log/auth.log | grep 'tty2' and post it here. I'm slightly worried if you followed everything correctly. For example, I don't understand how your /bin/autologin ended up chmoded to 777 (not that it matters - it still should work but ...) |
Like every ten seconds it says "can't exec /bin/autologin, Exec format error"
the /bin/autologin file seriously says Code:
exec login -f chaz I chmodd'd it to 777 myself, to make sure it wasn't a permissions thing at all. |
Where is '#! /bin/bash' in the first line ?????!!!!!
|
Of course the #! /bin/bash line is there, sorry. It doesn't say exec login -f chaz in its entirety. I only posted the exec line because the /var/log/auth.log was complaining about exec format error.
to be explicit Code:
#! /bin/bash Created file /bin/autologin, containing Code:
#! /bin/bash I chmod 777'd it. essentially, added the text Code:
-l /bin/autologin -n upon reboot this results in the blinking cursor screen on tty2 instead of the login prompt. So i grepped from /var as per your instructions and got "can't exec /bin/autologin, Exec format error". |
Well, at least we pinpointed a problem - albeit a strange one.
See if you can reproduce the problem. Log in as a normal user and create a file named, say, 'try'. Type in the contents of /bin/autologin (don't copy/paste just in case), make it executable and then (AS ROOT) try to execute it: ./try If it works the output will look as if you just logged in. If the same error comes up then something in the environment of your system isn't right. (By the way - these instructions are exactly how my Ubuntu Hardy is set up for autologin. Everything works as expected so I'm not advising you on something I haven't done myself.) |
It worked. I created 'try' in home and ran ./try
Ubuntu comes with ABSOLUTELY NO WARRANTY, etc. came up. I just less'd try and /bin/autologin back to back; they are identical. EDIT: as a matter of fact they are not identical. /bin/autologin has a superfluous carriage return before #! /bin/bash. I have a feeling this is a problem; I did not see this before running less and noting the extra space. EDIT: it works now, tty2 was logged in upon reboot. It was a sneaky extra blank line at the beginning of /bin/autologin. I'm sorry for wasting your time. |
In this case everything should work. Now do this. Delete the first file:
(as root) rm /bin/autologin Move /path/to/try to /bin: (as root) mv /path/to/try /bin/autologin |
All times are GMT -5. The time now is 05:26 AM. |