OpenWrt Forum Archive

Topic: Editing the kernel command line

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, I want to change the settings for the console in the kernel command line (cmdline)
After a clean compilation of the firmware, I enter into the $LINUX_dir and configure a new kernel with "make menuconfig", and in the MACHINE SELECTION menu I edit the last item: Default Kernel command string to put "console=/dev/null". Then I "make clean" the linux_dir and compile the firmware again, but the kernel command line stays without changes. I also modified the linux.config in the buildroot/source/openwrt/kernel, but without success. sad
Could anyone help to modify this setting in the kernel?
Thanks in advance

I solve my problem. I "make clean" the entire buildroot and before "make" the buildroot I modified the /buildroot/sources/openwrt/kernel/linux.config to set the console as I want.
It compiles cleanly. wink

Sorry for my bad English...

Edit the file $(BUILDROOT)/sources/openwrt/kernel/linux.config

and change the line :

CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs init=/etc/preinit noinitrd console=ttyS0,115200"

to:

CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs init=/etc/preinit noinitrd console=/dev/null"

Maybe I'm curious, but why do you want to do that ?

--
Nico

Hello. I want to change the kernel command line too. But where can I find "linux.config".
I checked out backfire from svn but there is no /sources/openwrt/kernel/linux.config.

In another topic I read that I can edit the kernel command line when I enter "make kernel_menuconfig". But I didnt find the item where I can change it.

Please can anyone help me??

Can nobody help me?
I must solve the problem verry fast.

Is is possible to change the kernel command line in compiled Image, or can I change this only before?

Change uart serial port baudrate speed on OpenWrt

http://wiki.openwrt.org/doc/hardware/port.serial
http://wiki.openwrt.org/doc/techref/boo … oot.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

The discussion might have continued from here.