Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: mikpin777777lucky_!! on September 26, 2025, 05:03:04 AM
-
Hi,
ive managed to setup UART communication on my raspberry pi zero w yesterday, however ive stumbled upon weird issue.
After piCore is done booting, im prompted to login, but after entering "tc" as login username, this error gets shown:
login: can't set groups: Operation not permitted
Also, before the login prompt, this error shows up:
login: -f is for root only
which i believe is product of the autologin script?
Anyway, here are the modifications ive done, to setup uart:
cmdline.txt
earlycon=pl011,mmio32,0x20201000 ... console=ttyAMA0,115200 ...
config.txt
...
[all]
enable_uart=1
dtoverlay=disable-bt
Then i unpacked the "rootfs-piCore-16.0.gz"
gunzip -c ../rootfs-piCore-16.0.gz | cpio -id
opt/bootlocal.sh
...
/usr/sbin/startserialtty ttyAMA0 &
...
etc/inittab
ttyAMA0::respawn:/sbin/getty -nl /sbin/autologin 115200 ttyAMA0
and finally packaged it back together
find . | cpio -o -H newc | gzip -9 > ../rootfs-piCore-16.0.gz
Im guessing, the issue lies in unpacking and packing toghether the root filesystem, causing some permission mashing? Hopefully ive provided enough information.
Thanks very much in advance...
(also i should mention im new to using piCore and tinycore in general, but i got familiar with most concepts via wiki/docs)
-
You don’t need startserial, since you are modding inittab. I’ve not been able to get autologin to work on serial, so I don’t use it, an login works fine.
For what it’s worth, you can modify inittab in bootlocal.sh, then send init a HUP to get it to reload inittab.
-
Hello @mikpin777777lucky_!!
You seams like a great Linux user, you get it.
If you need more debugging with the uart.
I have seen you can modify the RPI firmware, so you get some text from the bootloader in uart.
But I am not sure if this is related to your RPI.
https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#bootcode-bin-uart-enable
(https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#bootcode-bin-uart-enable)
Happy hacking/coding
-
Hi mikpin777777lucky_!!
Welcome to the forum.
I don't know if it makes any difference, but when modifying a rootfs/initrd
I always use zcat and sudo:
# Pack/unpack rootfs.gz
# To unpack
tc@E310:~$ mkdir tempdir
tc@E310:~$ cd tempdir
tc@E310:~/tempdir$ zcat /path/to/existing/rootfs.gz | sudo cpio -i
# Make changes
cd ~/tempdir
# To repack
tc@E310:~/tempdir$ sudo find . | sudo cpio -o -H newc | gzip > /path/to/new/rootfs_modified.gz
-
Thanks for many advices (@patrikg and @Rich)! Ive already looked into enabling UART debug messages, and it seems really useful, because it logs dtoverlay status and similiar stuff...
So i commented out the line in bootlocal.sh and changed inittab to look like:
ttyAMA0::respawn:/sbin/getty -nl /bin/login 115200 ttyAMA0
but with no luck, i still get stuck here:
box login: tc
login: can't set
box login:
Am i missing something here? Thanks again
-
I'm not modifying the rootfs, this is what I have in /opt/bootlocal.sh
This is a compute module 4, so I'm using a different serial port, but you get the idea.
echo "console::respawn:/sbin/getty -L /dev/ttyAMA5 115200 vt100" >>/etc/inittab
kill -HUP 1
-
Hi @Paul_123
I think you are on the right track, with the getty.
Also think of that getty is busybox version.
I think it can't set the term type to ttyAMA0 :)
Usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE]
Open TTY, prompt for login name, then invoke /bin/login
-h Enable hardware RTS/CTS flow control
-L Set CLOCAL (ignore Carrier Detect state)
-m Get baud rate from modem's CONNECT status message
-n Don't prompt for login name
-w Wait for CR or LF before sending /etc/issue
-i Don't display /etc/issue
-f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue
-l LOGIN Invoke LOGIN instead of /bin/login
-t SEC Terminate after SEC if no login name is read
-I INITSTR Send INITSTR before anything else
-H HOST Log HOST into the utmp file as the hostname
-
Thanks for sending snippet from your bootlocal.sh. Unfortunately my only way to interact with piCore is making changes in rootfs, because i do not own micro hdmi adapter nor adapter for an keyboard to do initial setup.
But changing inittab from bootlocal.sh seems like elegant solution, but it still results in the same error (for me).
I even tried unpacking and packing rootfs with sudo, as @Rich suggested, but also nothing :(
Command i added to my bootlocal.sh (same as @Rich sent, but with different port):
echo "console::respawn:/sbin/getty -L /dev/ttyAMA0 115200 vt100" >>/etc/inittab
-
What about setting up wifi.
-
Hi mikpin777777lucky_!!
... Command i added to my bootlocal.sh (same as @Rich sent, but with different port):
echo "console::respawn:/sbin/getty -L /dev/ttyAMA0 115200 vt100" >>/etc/inittab
Did you remember to add:
kill -HUP 1after your echo command? Without that, inittab won't reload.
-
Yeah yeah, ive added both lines. But setting up wifi by editing rootfs isnt entirely bad idea either :) (but having working uart in case of need feels practical).
-
Would be so much easier with a keyboard and monitor.
How are you editing bootlocal.sh. The roots is overwritten by the copy in the backup, unless you are skipping the restoration of the backup.
-
Soo as ive stated before, this is how i edit any configuration file in rootfs:
sudo gunzip -c ../rootfs-piCore-16.0.gz | cpio -id
nano opt/bootlocal.sh
"change stuff"
find . | cpio -o -H newc | gzip -9 > ../rootfs-piCore-16.0.gz
-
You cannot edit bootlocal.sh that way.
Bootlocal is part of the backup set that is in the mydata.tgz file on partition#2
Unless you also are using that with the norestore command line option.
-
Sorry for not respoding so long... ive spent weekend away from my compupter...
So whats your recommended way of changing configuration files (like for example bootlocal.sh)?
-
The recommended way is on the running device. Then you backup changes with "filetool.sh -b"
If you want to do it offline, you have to edit the content in side the mydata.tgz file.
Or unpack the tgz as root into a tmp folder, edit your files, then repack.
-
ok, thanks, but if i understand correctly, without running
filetool.sh -b
no file such as "mydata.tgz" isnt goning to be saved onto sdcard (in case of raspberry pi). Am i supposed to create it?
-
Yes, it’s on the partition 2 of the sd card.
/tce/mydata.tgz
You need to edit the content of that tar archive, and put it back on the sdcard.