Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: rickygai on September 11, 2009, 01:00:17 AM

Title: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: rickygai on September 11, 2009, 01:00:17 AM
How to configure TinyCore to boot to console mode as ROOT user ?
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: gerald_clark on September 11, 2009, 01:18:54 AM
Check the boot options in the wiki.
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: rickygai on September 11, 2009, 02:31:22 AM
i understand that is options to type in and enter into console mode
but i need a way to autologin as ROOT user instead of "sudo su"
each time i logged in.
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: danielibarnes on September 11, 2009, 11:59:17 AM
So you mean without entering the "superuser" boot option? The /root/.profile file controls this feature. It will autologin as root if the /etc/sysconfig/superuser file is present, so there are multiple ways to achieve this:

1) If you don't already have a backup file, then execute the following

touch /etc/sysconfig/superuser
tar czf mydata.tgz /etc/sysconfig/superuser

Place the mydata.tgz in the appropriate location so it will be loaded automatically.

2) If you already have a backup file, then boot with the superuser boot option, add the following line to your /opt/.filetool.lst, and create a backup:

etc/sysconfig/superuser

3) Create a pseudo-extension (requires squashfs-tools extension to be loaded):

cd /tmp
mkdir -p superuser/etc/sysconfig/
touch superuser/etc/sysconfig/superuser
mksquashfs superuser superuser.tcz

Place superuser.tcz in the appropriate location so it will be loaded automatically.

4) Add this line to the top of /opt/bootlocal.sh (may not work due to timing)
touch /etc/config/superuser

If you need help understanding the backup file mydata.tgz or help creating extensions, the wiki can explain or you can ask here.
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: danielibarnes on September 11, 2009, 04:54:15 PM
If you are referring to the graphical terminal window instead of the text console, the easiest way I've found to do this is to add an additional icon for aterm to login as root. To do this, you need to modify /usr/local/tce.wbar. Again, there are multiple ways to do this. The simplest is to modify the existing file and it to your /opt/.filetool.lst. Add these three lines to tce.wbar:

i: /usr/share/wbar/aterm.png
t: Root
c: exec sudo /usr/bin/aterm
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: ^thehatsrule^ on September 11, 2009, 07:40:57 PM
Quote
So you mean without entering the "superuser" boot option? The /root/.profile file controls this feature. It will autologin as root if the /etc/sysconfig/superuser file is present, so there are multiple ways to achieve this:
Keep in mind that it is no longer used (by default) in 'recent' TC releases
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: danielibarnes on September 13, 2009, 05:28:17 PM
Quote
Keep in mind that it is no longer used (by default) in 'recent' TC releases

I checked /root/.profile in 2.3 and it has:

if [ ! -f /etc/sysconfig/superuser ]; then
...
fi

That's how I figured out the simplest way to make a "persistent" superuser login was to simply use an extension or backup to create the /etc/sysconfig/superuser file. It's handy if you boot from the iso or otherwise original source without grub or syslinux.cfg to pass options automatically.
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: ^thehatsrule^ on September 13, 2009, 08:20:20 PM
Ok, but I think the auto root shell login does not happen by default anymore.  Perhaps it still does occur somewhere... did you try your steps on 2.3* ?
(fyi, I'm basing this on rungetty's autologin.)
Title: Re: How to configure TinyCore to boot to console mode as ROOT user ?
Post by: danielibarnes on September 14, 2009, 11:00:56 AM
Ah, I see what you mean. /etc/init.d/tc-config has:

sed -i 's/root/'"$USER"'/' /etc/inittab

which means it will autologin as the tc user unless the superuser boot parameter is explicitly specified. Well, I guess that pretty much makes my hack useless on 2.3. :) I guess if one wants "persistent" boot options, hacks are not an option. One should use the standard grub or syslinux methods.