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

Wrong user when running raspi-config #113

Closed
pablosproject opened this issue Feb 18, 2021 · 2 comments
Closed

Wrong user when running raspi-config #113

pablosproject opened this issue Feb 18, 2021 · 2 comments

Comments

@pablosproject
Copy link
Contributor

pablosproject commented Feb 18, 2021

I just want to report that using raspi-config inside a chroot script may lead to unexpected behaviour. Here is my case:

#!/usr/bin/env bash
########

# Source error handling, leave this in place
set -x
set -e

source /common.sh
install_cleanup_trap

unpack /filesystem/home/pi /home/"${BASE_USER}" "${BASE_USER}"
unpack /filesystem/home/root /root root
unpack /filesystem/boot /boot

# -------------------------------------------------------
#           DEPENDENCIES FOR INSTALLATION
# -------------------------------------------------------
apt-get update && apt-get -y upgrade

apt-get install -y libsdl2-dev .....

# -------------------------------------------------------
#           Binary compilation
# -------------------------------------------------------
...

# Unpack root at the end, so files written in /etc... are not overwritten
unpack /filesystem/root /

# Make emulation binary executable by current user
chmod +x /usr/bin/compiled

# Configure auto login as pi user (using raspi-config)
raspi-config nonint do_boot_behaviour B2

The last 2 lines, is where things went wrong. Basically once you ran raspi-config the autostart of getty (/etc/systemd/system/[email protected]/autologin.conf) contains the following lines:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin  --noclear %I $TERM

Instead of

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin pi --noclear %I $TERM

Not sure if we should change the user with which we are running the chroot script or if it's a raspi-config problem, but I just spent half a day with it and want to report in case someone else is using the same approach to make the user auto-login.

@guysoft
Copy link
Owner

guysoft commented May 31, 2021

Thanks for updating. Sorry missed this.

It might be a good idea to open an issue at: https://github.com/RPi-Distro/raspi-config/issues

In FullPageOS I took a look in the source to see how to switch on the GPU.

@guysoft
Copy link
Owner

guysoft commented May 31, 2021

Reported here: RPi-Distro/raspi-config#160

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

No branches or pull requests

2 participants