Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] login prompt keeps coming back to itself
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
akrmn24
n00b
n00b


Joined: 24 Nov 2024
Posts: 16

PostPosted: Fri Jan 10, 2025 9:00 pm    Post subject: [SOLVED] login prompt keeps coming back to itself Reply with quote

I built an ARM64 system in a chroot inside an ARM64 VPS. The kernel and firmware I compiled for raspberry pi. The raspi boots, openrc goes through all the stages, but at the boot (autologin) prompt it keeps complaining about respawning (doesn't give me access). If I switch to another tty I see the login prompt. I put the user root and password. Then it just goes back to asking for user and password, and it never ends. It's like it keeps automatically logging me off. I know the password is correct because if I put the wrong password it gives a message about incorrect password.

This only occurs when I build the system in a chroot and then I try to boot that built image from my raspberry pi.

If I build everything inside the Pi, I don't see this problem.

I am working on a Gentoo based distribution, so it would be good to solve this problem so that people could preview an already built system without installing from source, or if they want to compile on another machine.


Last edited by akrmn24 on Tue Jan 14, 2025 2:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1394
Location: Richmond Hill, Canada

PostPosted: Fri Jan 10, 2025 9:18 pm    Post subject: Reply with quote

How you got the VPS chroot content on to the raspi?

One possible debug method is run in single user mode. This is accomplished by append "single" to the end of cmdline.txt

Once you are in the system, check if you have /dev/ content or if your root account home directory exist and have correct permission.
Back to top
View user's profile Send private message
akrmn24
n00b
n00b


Joined: 24 Nov 2024
Posts: 16

PostPosted: Fri Jan 10, 2025 9:39 pm    Post subject: Reply with quote

Quote:

How you got the VPS chroot content on to the raspi?

One possible debug method is run in single user mode. This is accomplished by append "single" to the end of cmdline.txt

Once you are in the system, check if you have /dev/ content or if your root account home directory exist and have correct permission.


I first create a disk image (img file) with dd if=/dev/zero, partition it (with parted) for boot and root partitions. I mount the partitions by first using losetup, then mount. I install the kernel and initramfs to the boot partition. For root partition I first unpack the stage3 tarball (musl), I then copy some config files to it, I mount /dev /proc /sys /run, chroot into it and perform the installation. Then I unmount everything, detach with losetup, dd if=mydisk.img of=/dev/sdx bs=1M. I use sdx as the micro-SD for the pi.

If you want you can see my full build script here: https://github.com/bitmarkcc/plx

There's also some issues with Openbox, so even without the chroot, there are some issues to fix, but first would like to fix this.

OK will try now your suggestion with single user mode. I tried also just starting with init=/bin/bash. It works, and I can even do /sbin/openrc sysinit, /sbin/openrc boot, /sbin/openrc default and if I start the agetty manually it gets me in (but not fully working, getting errors about dbus not running and other thing), but not if I do /sbin/init or /sbin/openrc-init.
Back to top
View user's profile Send private message
akrmn24
n00b
n00b


Joined: 24 Nov 2024
Posts: 16

PostPosted: Fri Jan 10, 2025 10:18 pm    Post subject: Reply with quote

I start my init from my initramfs
exec /bin/busybox switch_root /mnt/root /sbin/init

I tried with /sbin/init single and this works and let me login. But when I startx I see complaints about DBUS, and when I start the dbus service, it fails. So not sure if everything can work from this mode.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1394
Location: Richmond Hill, Canada

PostPosted: Sat Jan 11, 2025 2:04 am    Post subject: Reply with quote

akrmn24 wrote:
I start my init from my initramfs
exec /bin/busybox switch_root /mnt/root /sbin/init

I tried with /sbin/init single and this works and let me login. But when I startx I see complaints about DBUS, and when I start the dbus service, it fails. So not sure if everything can work from this mode.


You have raise a different issue. This is not relate to your post topic. If you really want to use single user mode to run Window system please open another thread. Some one else have better knowledge can help you there.

I would suggest not use single user mode for doing daily work.

Have you investigate why your normal boot sequence can not give you prompt for login?

Have you check for example /dev/ tree? did they looks normal? have console and tty?

Have you check the autologin user home directory permission?

Did the system's messages log file have any clue for why login fail?
Back to top
View user's profile Send private message
akrmn24
n00b
n00b


Joined: 24 Nov 2024
Posts: 16

PostPosted: Sun Jan 12, 2025 9:38 pm    Post subject: Reply with quote

OK I think I found the problem.

I realized that the system works if I don't install it (in VPS chroot) with --deep. So I thought first the elogind is the problem. But then when trying to start openbox, I noticed 'illegal instruction', which made me realize that I am building it on a VPS with -march=native, so the raspberry pi cannot understand some of the binary...So now installing it without -march=native, and I will let you know how it goes.
Back to top
View user's profile Send private message
karimali
n00b
n00b


Joined: 14 Jan 2025
Posts: 2

PostPosted: Tue Jan 14, 2025 11:09 am    Post subject: Reply with quote

It seems like a mismatch between the chroot environment and the Pi. Here is what you can check:

/etc/securetty: Ensure TTYs (e.g., tty1, tty2) are listed for root login.
PAM Config: Verify /etc/pam.d/login to avoid login loops.
Permissions: Check /etc/passwd and /etc/shadow have correct root:root ownership.
Library Mismatch: Use ldd to ensure no missing or incompatible libraries for /bin/login or /bin/bash.
Logs: Review /var/log/auth.log or syslog for errors.
Rebuild Key Packages: Try rebuilding openrc, shadow, or util-linux on the Pi.
Back to top
View user's profile Send private message
akrmn24
n00b
n00b


Joined: 24 Nov 2024
Posts: 16

PostPosted: Tue Jan 14, 2025 2:34 pm    Post subject: Reply with quote

Removing -march=native from the compiler flags did the trick. I just marked it as solved.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22998

PostPosted: Tue Jan 14, 2025 2:48 pm    Post subject: Reply with quote

To be clear, the problem is that you built with -march=native on a system with capabilities that the Pi lacked, then installed those binaries on the Pi, right? Such a setup would fail when the Pi fails to provide the capabilities that -march=native enabled. If the Pi builds for itself using -march=native, that ought to work, since it ought not enable features that it cannot use.
Back to top
View user's profile Send private message
akrmn24
n00b
n00b


Joined: 24 Nov 2024
Posts: 16

PostPosted: Tue Jan 14, 2025 5:55 pm    Post subject: Reply with quote

yes -march=native should work on the pi if I build it on the pi. The ampere CPU on the VPS is a bit different, so created binaries that are not comprehensible to the pi.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum