Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] buildroot inittab getty
Date: Tue, 20 Oct 2015 10:01:54 +0200	[thread overview]
Message-ID: <20151020100154.47cf5600@free-electrons.com> (raw)
In-Reply-To: <1445294741948-115526.post@n4.nabble.com>

Hello,

On Mon, 19 Oct 2015 15:45:41 -0700 (PDT), logos wrote:

> In buildroot menuconfig, I didn't choose "Run a getty (login prompt) after
> boot",
> but in my output/target/etc/inittab, I have this line,
> ttyS3::respawn:/sbin/getty -L  ttyS3 57600 vt100 # GENERIC_SERIAL
> 
> system/skeleton/etc/inittab shows,
> #ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL
> 
> 1. How can this happen? Why is the line uncommented?

The line gets uncommented if BR2_TARGET_GENERIC_GETTY=y. The logic
doing this is in package/skeleton/skeleton.mk. It gets uncommented so
that a getty process is started at boot time to prompt you for your
login/password on the right serial port / terminal.

> FYI, in my .config file I have
> # BR2_TARGET_GENERIC_GETTY is not set

When BR2_TARGET_GENERIC_GETTY is disabled, it does not get uncommented,
I just did a test build with the latest Buildroot:

thomas at skate:~/projets/buildroot (master)$ grep GETTY .config
# BR2_TARGET_GENERIC_GETTY is not set
thomas at skate:~/projets/buildroot (master)$ grep getty output/target/etc/inittab 
# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 # GENERIC_SERIAL

> 2. Why tty port has changed from ttyS0 to ttyS3?

Because you have BR2_TARGET_GENERIC_GETTY=y in your configuration, and
BR2_TARGET_GENERIC_GETTY_PORT="ttyS3". Or because you are using a
custom rootfs skeleton that has a different /etc/inittab.

> 3. If possible, I'd like to understand inittab file generation process.

1. The skeleton package gets installed. It copies system/skeleton/* to
   output/target/.

2. The busybox package gets installed. It copies
   package/busybox/inittab to output/target/etc/inittab.

3. The skeleton package has registered a "target finalize hook" called
   SKELETON_SYSTEM_GETTY that gets triggered at the very end of the build
   (after all packages have been built and installed, but before the root
   filesystem image is generated). This hook, implemented in
   package/skeleton/skeleton.mk, will tune the inittab by uncommenting
   the getty line and adjusting the serial port / terminal according to
   your configuration. This only happens if BR2_TARGET_GENERIC_GETTY=y.

   See http://git.buildroot.net/buildroot/tree/package/skeleton/skeleton.mk#n139

Note that the logic in the older Buildroot you're using is different,
since at the time, we didn't had a 'skeleton' package.

> 4. Maybe this question doesn't belong here, 
>     what option or parameter do I need to setup if I want to login without
> typing login name and password after booting?
> Currently I have to type "root" and hit enter. (no password setup for root)

Just add a post-build script that tunes your inittab by adding a line
that starts a shell.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-10-20  8:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-19 22:45 [Buildroot] buildroot inittab getty logos
2015-10-20  8:01 ` Thomas Petazzoni [this message]
2015-10-20  8:03   ` Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151020100154.47cf5600@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox