Modify

Opened 9 years ago

Closed 9 years ago

Last modified 22 months ago

#1509 closed defect (fixed)

override kernel command line

Reported by: hydra Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version:
Keywords: commandline mtd Cc: mailinglist.openwrt@…

Description

florian suggests that the kernel command line should be overridden as after the mtd blocks are scanned and a filesystem is detected the kernel panics when it doesn't find a valid "root=" option. Ideally this should be added automatically somehow, but maybe only if a "root=" option isn't present on the current kernel command line.

A kernel I built had the following command line:

Kernel command line: idle=4 idle=4 console=ttyS0,38400

(idle=4 appears twice because it was being picked up once via the kernel configs and once via the adam2 environment variable "kernel_args" which contains just "idle=4")

And the last part of the kernel message when booting was:

Parsing ADAM2 partition map...
Looking for mtd device :mtd0:
Found a mtd0 image (0x0), with size (0x0).
Assuming adam2 size of 0x0
Looking for mtd device :mtd1:
Found a mtd1 image (0x10000), with size (0x770000).
Looking for mtd device :mtd2:
Found a mtd2 image (0x0), with size (0x10000).
Assuming adam2 size of 0x10000
Looking for mtd device :mtd3:
Found a mtd3 image (0x780000), with size (0x40000).
Looking for mtd device :mtd4:
Found a mtd4 image (0x7c0000), with size (0x40000).
Setting new rootfs offset to 000868ff
Squashfs detected (size = 0xb0086973)
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00010000 : "adam2"
0x00010000-0x00400000 : "linux"
0x000868ff-0x001b0000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
0x00400000-0x00800000 : "config"
0x001b0000-0x00400000 : "rootfs_data"
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
ip_conntrack version 2.1 (5953 buckets, 5953 max) - 360 bytes per conntrack
p_tables: (C) 2000-2002 Netfilter core team
ET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Cannot open root device "" or 00:00
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 00:00

Attachments (0)

Change History (4)

comment:1 Changed 9 years ago by nbd

  • Milestone changed from Kamikaze Milestone 1 to Kamikaze

comment:2 Changed 9 years ago by florian

  • Resolution set to fixed
  • Status changed from new to closed

Should be fixed with [6948]

comment:3 Changed 4 years ago by anonymous

quick howto:

Change uart serial port baudrate speed on OpenWrt

http://wiki.openwrt.org/doc/hardware/port.serial
http://wiki.openwrt.org/doc/techref/bootloader/uboot.config

OpenWrt has uart serial port baudrade speed set via kernel command line option.

For example for TP-Link WR741ND V4.x it is set to: "console=ttyATH0,115200"

Nos the question is how to change this kernel command line, only way to do this is to compile your own kernel with different "console=" line.

First you need to know which speed you need to set. In this example we use TP-LINK WR741ND which uses has it's uart serial port baudrate speed set to 115200 and we need to change it to 19200.

First check check what baudrate and which port your current router uses, telnet or ssh to your router and then find out your current settings.
Usual ports are ttyS0 or ttyATH0:

Use these command so check your serial port settings
∘ fw_printenv
‣ baudrate=115200
‣ console=console=ttyS0,115200
∘ OR: logread | grep tty
‣ ...

find where is your config file:

  • grep ttyATH0 ./trunk/target/linux/ar71xx/ -R

edit file:

  • ./trunk/target/linux/ar71xx/image/Makefile

find line for your modem:

  • tlwr740_cmdline=board=TL-WR741ND console=ttyS0,115200
  • tlwr740v4_cmdline=board=TL-WR741ND-v4 console=ttyATH0,115200

Change "console=ttyATH0,115200" to speed you need:

  • tlwr740_cmdline=board=TL-WR741ND console=ttyS0,19200
  • tlwr740v4_cmdline=board=TL-WR741ND-v4 console=ttyATH0,19200

https://forum.openwrt.org/viewtopic.php?id=38419

comment:4 Changed 22 months ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.