Skip to content

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

@guysoft

Description

@guysoft

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/[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions