Automatic Login on Angstrom Linux

Automatic login on Angstrom Linux

I found a nice way to achieve it. This works for me with Angstrom (on a Beagleboard xM Rev C4).

  1. Make sure agetty is installed (/sbin/agetty is the standard location). It should be included in every Linux Angstrom image.

  2. Create a script file in any location, for example /home/root/autologin.sh. Edit it and add the following:

    #!/bin/sh
    exec /bin/login -f root
  3. Make it executable with the command

    chmod a+x autologin.sh
  4. Edit the file /etc/inittab. Comment out (by adding a “#” at the beginning) the following line

    1:2345:respawn:/sbin/getty 38400 tty1

and add the following line:

    1:2345:respawn:/sbin/agetty -l /home/root/autologin.sh -n 38400 tty1 linux

Hope this helps out there.

Auto login on BeagleBone White + Angstrom 3.2

Turned out that a RF module attached to my beaglebone was being powered via USB, and this module should be activated by my test program mentioned in the question. So, when I unplugged my BBone USB cable, I was actually separating its GND from the RF Module's ground.

In short, I just had to use the same source in the entire circuit and keep the autologin configuration explained in the topic I also mentioned in my question.

Angstrom Linux on Beagleboard boots into sleep mode

This seems to have fixed the issue I was having, firstly I'd suggest updating any outdated packages by opening a terminal and typing

opkg update 

this should only take ~1 minute, aftewards type

opkg upgrade

This can take anywhere from ~10minutes to ~6 hours maybe even more, so be patient, just leave the device alone until it has finished.

then open the following file

nano /etc/X11/xorg.conf

and add the following

Section "ServerFlags"
Option "BlankTime" "0"
Option "StandbyTime" "0"
Option "SuspendTime" "0"
Option "OffTime" "0"
EndSection

Section "Monitor"
Option "DPMS"
Identifier "Builtin Default Monitor"
EndSection

This should also disable any screensavers etc... which was also ideal for my requirements.

Reboot your device, and it should be good to go.

Angstrom start-up processes [beaglebone]

Create a new file in /lib/systemd/system/ (rfidreader.service in my example) with content like:

[Unit]
Description=Start Python RFID reader

[Service]
WorkingDirectory=/...Python script path.../
ExecStart=/usr/bin/python rfidreader.py
KillMode=process

[Install]
WantedBy=multi-user.target

Then execute the following command to install the service:

systemctl enable rfidreader.service

To start the service, you can either reboot or execute:

systemctl start rfidreader.service

To check if the service is running and get the latest outputs from the script:

systemctl status rfidreader.service

Beaglebone inittab issue

inittab has been replaced by systemd

This is how I did it for the serial console. You can probably adapt it easily for tty1 by replacing "serial-getty@..." by "getty@...", but I haven't tested it.

cp /lib/systemd/system/serial-getty@.service /etc/systemd/system/autologin@.service
rm /etc/systemd/system/getty.target.wants/serial-getty@ttyO0.service
ln -s /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyO0.service

Create the following script file in any location (/home/root/autologin.sh in my case)

#!/bin/sh
exec /bin/login -f root

Make it executable

chmod a+x autologin.sh

Edit /etc/systemd/system/autologin@.service and update the ExecStart command by adding the -n (Do not prompt the user for a login name) and -l (Invoke the specified login_program instead of /bin/login) options.

ExecStart=-/sbin/agetty -n -l /home/root/autologin.sh -s %I 115200

Headless X11 Angstrom

Thought I better answer this for reference. Oh, I also got the 'Tumbleweed' badge... Great...

If no LCD/DVI cape is attached, then the boot doesn't load a frame buffer (/dev/fb0). As such, no X11 server starts up. x11vnc requires a real X11 server to be running for it to work. There is also the program xvnc which can create a virtual X11/frame buffer on your behalf, but I couldn't see it in the Angstrom packages.

So, I installed Xvfb - and created a virtual frame buffer. Install the package

xserver-xorg-xvfb

When starting, keep in mind (for the newbies like me coming from Windows), it is case-sensitive. To create a virtual X11 server;

Xvfb :1 -screen 0 1024x768x16 &

When you do this, you will probably get these errors;

(EE) AIGLX error: dlopen of /usr/X11/lib/dri/swrast_dri.so failed (dlopen(/usr/X11/lib/dri/swrast_dri.so, 5): image not found)
(EE) GLX: could not load software renderer

So, load the package;

mesa-dri-driver-swrast

OK, error gone. Now we can export our display (an environment variable so Firefox, or whatever X11 client you run, can attach to the display).

export DISPLAY=:1

Load up Firefox (something to see)

firefox &

And now we try and start the x11vnc;

x11vnc -display :1 -bg -nopw -xkb

At this point, with this distro, you'll see an error about XTEST not being found/not available when it was built. Here describes the issue.

I made sure that I had all the proper libraries installed, so I figured it must have been a bad build on Angstrom. So, now to build it myself. I ensured all required libraries were available; these are the ones ending with '-dev'; by default they all appeared to be available. I followed the instructions here.

Except the copy line didn't work too good for me, so do what you need to do to copy it to the /usr/bin folder.

Now it starts, and there are no errors about XTEST, and the input works!

Change the baud rate for BeagleBone UART0 running Angstrom Linux

The command you showed has nothing to do with baud rate, it controls pin muxing. Many microcontrollers have many more peripheral functions than I/O pins, so the I/O pins need to be mapped to peripherals, and not all connections are possible. For your case, you need to designate particular pins as UART transmit and receive.

I haven't done it myself, but I found a considerable amount of documentation describing that control of pin muxing via sysctl and the proc filesystem was recently replaced with a new system based on Device-Tree. And that as a result virtually all existing examples are broken. Worse, there may not even be a working device-tree-based equivalent for some commands.

As far as setting the baudrate, you would normally use cfsetispeed() and cfsetospeed() from termios.h, as described in the Unix specification.



Related Topics



Leave a reply



Submit