Tiny Core Linux
Tiny Core Base => Micro Core => Topic started by: Ali Demir on May 19, 2023, 02:20:21 AM
-
Hi,
I'm trying to contact Serial0. When I try the following settings, the entries appear but I cannot get the outputs:
linux /boot/vmlinuz loglevel=3 user=tc console=tty0 console=ttyS0,115200 noembed nomodeset tce=sda1 opt=sda1 home=sda1 restore=sda1
echo "console=ttyS0,115200" >> /mnt/sda1/boot/cmdline.txt
sudo sh -c 'echo "enable_uart=1" >> /mnt/sda1/boot/config.txt
This is what it looks like when I send data:
"pwd\n"
pwd
The output I expected:
"pwd\n"
/home/tc
tc@box:~$
I may not have been able to fully explain. I want to contact serial0 without UI.
-
What version of tinycore are you using and on which architecture?
-
Tiny Core Version: 13.1
Linux box 5.15.10-tinycore #622 SMP Tue Dec 21 16:51:09 UTC 2021 i686 GNU/Linux
I added an attachment for the example, the serial console stops responding when the boot process is finished. I can enter data into the Serial console, but these won't run.
-
I think this has been covered on the forum before, you need to edit inittab to launch a login shell on the serial console. Search for inittab.
-
I found edits about inittab, but what I did is not permanent. I make the changes and try reboot then the edits are lost.
I also tried something with grub but I can't edit it.
sudo cp /etc/inittab /mnt/sda1/etc/inittab
sudo sh -c 'echo "ttyS0::respawn:/sbin/getty -L 115200 /dev/ttyS0 vt100" >> /mnt/sda1/etc/inittab
-
Hi myfree.1
You need to modify the initrd (core.gz) for this.
First unpack it:
tc@E310:~/core$ mkdir initrd
tc@E310:~/core$ cd initrd/
tc@E310:~/core/initrd$ zcat /mnt/sda1/boot/core.gz | sudo cpio -i
26057 blocks
tc@E310:~/core/initrd$ cd etc/
tc@E310:~/core/initrd/etc$
Make your changes to inittab.
Now pack it up to a new name so you know it's a modified version:
tc@E310:~/core/initrd/etc$ cd ..
tc@E310:~/core/initrd$ sudo find . | sudo cpio -o -H newc | gzip > ../newcore.gz
tc@E310:~/core/initrd$ cd ..
tc@E310:~/core$ ls -l
total 9064
drwxr-sr-x 17 tc staff 4096 May 19 16:15 initrd/
-rw-r--r-- 1 tc staff 9275687 May 19 16:15 newcore.gz
tc@E310:~/core$
Copy newcore.gz where grub can find it and create a new grub entry for it.
-
Thanks, it worked. :)
-
Hi myfree.1
You are welcome. Thank you for reporting your success.