WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: /sbin/autologin directly from /inittab  (Read 1063 times)

Offline nick65go

  • Hero Member
  • *****
  • Posts: 614
/sbin/autologin directly from /inittab
« 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.
« Last Edit: August 18, 2022, 06:01:14 AM by nick65go »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10701
Re: /sbin/autologin directly from /inittab
« Reply #1 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?
The only barriers that can stop you are the ones you create yourself.

Offline nick65go

  • Hero Member
  • *****
  • Posts: 614
Re: /sbin/autologin directly from /inittab
« Reply #2 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/)
« Last Edit: August 18, 2022, 07:32:24 AM by nick65go »

Offline nick65go

  • Hero Member
  • *****
  • Posts: 614
Re: /sbin/autologin directly from /inittab
« Reply #3 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.
« Last Edit: August 18, 2022, 10:07:20 AM by nick65go »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10701
Re: /sbin/autologin directly from /inittab
« Reply #4 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.
The only barriers that can stop you are the ones you create yourself.

Offline nick65go

  • Hero Member
  • *****
  • Posts: 614
Re: /sbin/autologin directly from /inittab
« Reply #5 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.
« Last Edit: August 19, 2022, 12:02:52 AM by nick65go »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10701
Re: /sbin/autologin directly from /inittab
« Reply #6 on: August 19, 2022, 07:40:41 AM »
No, inittab won't be changed for now.
The only barriers that can stop you are the ones you create yourself.