Tiny Core Linux

Tiny Core Base => Micro Core => Topic started by: nick65go on August 18, 2022, 05:31:26 AM

Title: /sbin/autologin directly from /inittab
Post by: nick65go on August 18, 2022, 05:31:26 AM
proposal to replace (in  /etc/inittab) the line
Code: [Select]
tty1::respawn:/sbin/getty -nl /sbin/autologin 38400 tty1
with
Code: [Select]
tty1::respawn:/sbin/autologinIs it OK? because anyway in /sbin/autologin we have the getty for tc-user; in year 2022 there are no more ttys (serial terminals); anyway it is about tty not ttyS. Maybe even Qemu ignores it, because core is loaded in RAM.       
FYI: also, in /sbin/autologin, is no need for
Code: [Select]
. /etc/init.d/tc-functions
 useBusybox
because it does not use any functions from them.
Title: Re: /sbin/autologin directly from /inittab
Post by: curaga on August 18, 2022, 07:21:15 AM
I believe getty also initializes the tty settings, and so it's necessary. Removing those lines from autologin is probably fine, have you tested it?
Title: Re: /sbin/autologin directly from /inittab
Post by: nick65go on August 18, 2022, 07:29:44 AM
Not yet, unfortunately I am on f***king Wind0w$.
But I remember that in the past, from grub command line, kernel  parameter init=/bin/sh get me into a shell prompter. So was not need for tty settings to run a command like /sbin/autologin, straight from sysV init.Plus is about "respawn", after [accidentally] exit from login tc, not before login.
FYI: see also how toybox boot in qemu without getty (http://landley.net/toybox/downloads/binaries/mkroot/latest/)
Title: Re: /sbin/autologin directly from /inittab
Post by: nick65go on August 18, 2022, 10:05:01 AM
Job done, I tested by extracting a virgin root64.gz, then I "remaster" it with both modifications/simplifications (which I proposed), and cold re-booted fresh (base + norestore). ALL is OK.I check them (with cat /etc/inittab, cat /sbin/autologin) to see that the modifications are really in place.Then from (already logged tc user) I "exit", and at login prompt I put tc, and voila: I am  back logged.

PS: I used a laptop (so tty1 was not a problem) with AMD64 cpu. But should work on any cpu (I did not tested for arm, pi-core etc).
PS2: The changes are pure theoretically/didactically, because no speed gain. But I like CLEAR, only necessary shell commands./scripts.

I do not take any pride, neither affront, if these are not interesting for tc users. Each on their way.
Regards, and thanks for Tinycore free software.
Title: Re: /sbin/autologin directly from /inittab
Post by: curaga on August 18, 2022, 10:17:12 PM
Thanks, will edit autologin. init=/bin/sh also has some effects that aren't visible easily, but my memory is failing on what exactly they were.
Title: Re: /sbin/autologin directly from /inittab
Post by: nick65go on August 18, 2022, 11:57:42 PM
Do you mean that you will also edit /etc/inittab ? I tested both changes as I said in my previous post. Anyway is a few-minutes-task for anyone to test the replacement of "/sbin/getty -nl xxx" with "/sbin/autologin".
Please keep in mind that we talk about future tiny-core in x86, and no back-ported changes, so is about year 2023+, and UEFI, etc. I do not expect any tc user with devices from 10+ years ago to upgrade to tc14+ (maybe just kernel patches) because will be no news for them regarding basic devices/motherboards etc.
Title: Re: /sbin/autologin directly from /inittab
Post by: curaga on August 19, 2022, 07:40:41 AM
No, inittab won't be changed for now.