LINUX.ORG.RU

Как вывести приглашение о входе в систему в консоль

 , , , ,


0

3

Здравствуйте, может быть кто сможет подсказать, что я делаю не так? Есть плата на ARM64, к ней я подключён через последовательный порт uart(у меня на компе он отображается как ttyUSB0, т.к. это usb конвертер) и я собрал для него ядро 5.10.110, выставил параметры загрузки ядра:

append earlycon=uart8250,mmio32,0xfeb50000 console=ttyS1,1500000 console=tty1 root=/dev/mmcblk1p3 rootwait ro rootfstype=ext4 ignore_loglevel initcall_debug debug init=/sbin/init cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1

, наблюдаю вывод ровно до запуска процесса /init, его самого в консоли(по uart) не вижу, но вижу его при подключении монитора. Мне монитор не нужен, драва к нему я уберу позже. Мне нужен вывод из консоли. Кто знает почему я его не вижу и что сделать, чтобы по uart я увидел работу /init?

Выдержка из документации по последовательному порту говорит, что это должно работать..:

You can specify multiple console= options on the kernel command line.
Output will appear on all of them. The last device will be used when
you open ``/dev/console``. So, for example::

  console=ttyS1,9600 console=tty0

defines that opening ``/dev/console`` will get you the current foreground
virtual console, and kernel messages will appear on both the VGA
console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.

Note that you can only define one console per device type (serial, video).

If no console device is specified, the first device found capable of
acting as a system console will be used. At this time, the system
first looks for a VGA card and then for a serial port. So if you don't
have a VGA card in your system the first serial port will automatically
become the console
Ответ на: комментарий от aol

Если бы я подключился на скорости загрузчика, то остальную инфу я бы не увидел и получал бы при этом «краказябру», но первичный вывод, то я вижу(возможно это earlycon помогает)

rivares1853
() автор топика
Ответ на: комментарий от MirandaUser2

Мой inittab:

# /etc/inittab
#
# This inittab is a basic inittab sample for sysvinit, which mimics
# Buildroot's default inittab for BusyBox.
id:3:initdefault:

si0::sysinit:/bin/mount -t proc proc /proc
#si1::sysinit:/bin/mount -o remount,rw /
si1::sysinit:/bin/ls -la
si2::sysinit:/bin/mkdir -p /dev/pts /dev/shm
si3::sysinit:/bin/mount -a
si4::sysinit:/bin/mkdir -p /run/lock/subsys
si5::sysinit:/sbin/swapon -a
si6::sysinit:/bin/ln -sf /proc/self/fd /dev/fd 2>/dev/null
si7::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin 2>/dev/null
si8::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout 2>/dev/null
si9::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr 2>/dev/null
si10::sysinit:/bin/hostname -F /etc/hostname
rcS:12345:wait:/etc/init.d/rcS

s3:1235:respawn:/sbin/getty -L  ttyS0 1500000 vt100 # GENERIC_SERIAL
s3:1235:respawn:/sbin/getty -L  ttyS1 1500000 vt100 # GENERIC_SERIAL

# Stuff to do for the 3-finger salute
#ca::ctrlaltdel:/sbin/reboot

# Stuff to do before rebooting
shd0:06:wait:/etc/init.d/rcK
shd1:06:wait:/sbin/swapoff -a
shd2:06:wait:/bin/umount -a -r

# The usual halt or reboot actions
hlt0:0:wait:/sbin/halt -dhp
reb0:6:wait:/sbin/reboot
rivares1853
() автор топика

Последнее, что я вижу у себя в minicom’е:

[   12.214123] Built 1 zonelists, mobility grouping on.  Total pages: 1027656
[   12.214754] Kernel command line: earlycon=uart8250,mmio32,0xfeb50000 console=ttyS1,1500000 console=tty1 root=/dev/mmcblk1p3 rootwait ro rootfstype=ext4 ignore_loglev1
[   12.217549] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[   12.218466] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes, linear)
[   12.219369] mem auto-init: stack:off, heap alloc:off, heap free:off
[   12.226042] software IO TLB: mapped [mem 0x00000000e9f00000-0x00000000edf00000] (64MB)
[   12.258191] Memory: 3665808K/4175872K available (19776K kernel code, 3546K rwdata, 5712K rodata, 6656K init, 909K bss, 247920K reserved, 262144K cma-reserved)
[   12.259592] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
[   12.260213] ftrace: allocating 59881 entries in 234 pages
[   12.345223] ftrace: allocated 234 pages with 5 groups
[   12.345926] rcu: Hierarchical RCU implementation.
[   12.346360] rcu:     RCU event tracing is enabled.
[   12.346773]  Rude variant of Tasks RCU enabled.
[   12.347186]  Tracing variant of Tasks RCU enabled.
[   12.347624] rcu: RCU calculated value of scheduler-enlistment delay is 30 jiffies.
[   12.353138] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[   12.355390] GICv3: GIC: Using split EOI/Deactivate mode
[   12.355870] GICv3: 480 SPIs implemented
[   12.356221] GICv3: 0 Extended SPIs implemented
[   12.356648] GICv3: Distributor has no Range Selector support
[   12.357168] GICv3: 16 PPIs implemented
[   12.357552] GICv3: CPU0: found redistributor 0 region 0:0x00000000fe680000
[   12.358273] ITS [mem 0xfe640000-0xfe65ffff]
[   12.358698] ITS@0x00000000fe640000: allocated 8192 Devices @1f0200000 (indirect, esz 8, psz 64K, shr 0)
[   12.359570] ITS@0x00000000fe640000: allocated 32768 Interrupt Collections @1f0210000 (flat, esz 2, psz 64K, shr 0)
[   12.360514] ITS: using cache flushing for cmd queue
[   12.360986] ITS [mem 0xfe660000-0xfe67ffff]
[   12.361407] ITS@0x00000000fe660000: allocated 8192 Devices @1f0230000 (indirect, esz 8, psz 64K, shr 0)
[   12.362279] ITS@0x00000000fe660000: allocated 32768 Interrupt Collections @1f0240000 (flat, esz 2, psz 64K, shr 0)
[   12.363223] ITS: using cache flushing for cmd queue
[   12.363790] GICv3: using LPI property table @0x00000001f0250000
[   12.364439] GIC: using cache flushing for LPI property table
[   12.364957] GICv3: CPU0: using allocated LPI pending table @0x00000001f0260000
[   12.365779] kfence: initialized - using 2097152 bytes for 255 objects at 0x(____ptrval____)-0x(____ptrval____)
[   12.366771] random: get_random_bytes called from start_kernel+0x3f8/0x664 with crng_init=0
[   12.475257] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[   12.476575] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[   12.477568] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[   12.479109] calling  con_init+0x0/0x224 @ 0
[   12.479531] Console: colour dummy device 80x25
[   12.479944] printk: console [tty1] enabled
[   12.480326] printk: bootconsole [uart8250] disabled
I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
I/TC: Secondary CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
I/TC: Secondary CPU 4 initializing
I/TC: Secondary CPU 4 switching to normal world boot
I/TC: Secondary CPU 5 initializing
I/TC: Secondary CPU 5 switching to normal world boot
I/TC: Secondary CPU 6 initializing
I/TC: Secondary CPU 6 switching to normal world boot
I/TC: Secondary CPU 7 initializing
I/TC: Secondary CPU 7 switching to normal world boot


rivares1853
() автор топика
Ответ на: комментарий от rivares1853
s3:1235:respawn:/sbin/getty -L  ttyS0 1500000 vt100 # GENERIC_SERIAL
s3:1235:respawn:/sbin/getty -L  ttyS1 1500000 vt100 # GENERIC_SERIAL

а сам getty то запускается?

Попробуй его вручную запустить c разными параметрами (baud-rate и пр.)

MirandaUser2
()
Последнее исправление: MirandaUser2 (всего исправлений: 1)
Ответ на: комментарий от MirandaUser2

Когда подключаю монитор, вижу запуск getty (приглашение ко входу в систему, то есть). А как проверить есть ли запуск при выключенном мониторе… хороший вопрос.

rivares1853
() автор топика
Ответ на: комментарий от rivares1853

Проверь наличие getty в списке процессов.

Типа такого (в 4 строке agetty на ttyS0):

pc3 ~ # ps -ef |grep getty
root      5990     1  0 янв15 tty3  00:00:00 /sbin/agetty 38400 tty3 linux
root      5992     1  0 янв15 tty5  00:00:00 /sbin/agetty 38400 tty5 linux
root      5993     1  0 янв15 tty6  00:00:00 /sbin/agetty 38400 tty6 linux
root      5995     1  0 янв15 ttyS0 00:00:00 /sbin/agetty -L 38400 ttyS0 linux
root     17695 15802  0 янв15 pts/0 00:00:00 /sbin/agetty --noclear 38400 tty1 linux
root     17696 15802  0 янв15 pts/1 00:00:00 /sbin/agetty 38400 tty2 linux
root     17697 15802  0 янв15 pts/2 00:00:00 /sbin/agetty 38400 tty3 linux
root     17698 15802  0 янв15 pts/3 00:00:00 /sbin/agetty 38400 tty4 linux
root     17699 15802  0 янв15 pts/4 00:00:00 /sbin/agetty 38400 tty5 linux
root     17700 15802  0 янв15 pts/5 00:00:00 /sbin/agetty 38400 tty6 linux
root     23923 17449  0 12:00 pts/9    00:00:00 grep --colour=auto getty

Даже если у тебя один монитор, ничего не мешает переткнуть его на время туда, где minicom, и обратно.

MirandaUser2
()
Ответ на: комментарий от anonymous

Попробовал 115200, также пусто.На компе я смотрел и на ttyUSB0 и на ttyS0, и скорости менял — пусто. По сути по ttyUSB0 я вижу только дебаг и загрузочную инфу от earlycon. Инфа где есть приглашение и инфа от init выводится только на монитор. При этом ttyS0 создаётся

rivares1853
() автор топика