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

raspi-config inside a chroot script may lead to unexpected behaviour #160

Open
guysoft opened this issue May 31, 2021 · 0 comments
Open

Comments

@guysoft
Copy link

guysoft commented May 31, 2021

See issue reported here:
guysoft/CustomPiOS#113

Text:

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/getty@tty1.service.d/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
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

1 participant