Welcome! Log In Create A New Profile

Advanced

Ability to add extra Linux kernel parameters

Posted by CasperJim 
Ability to add extra Linux kernel parameters
August 12, 2014 08:08AM
Bodhi, I just saw that zswap was supported in your kernel. I want to enable that.
zswap.enabled=1
Is there a good way to specify that in uboot?



Edited 1 time(s). Last edit at 08/12/2014 08:34AM by CasperJim.
Re: Ability to add extra Linux kernel parameters
August 12, 2014 11:45AM
uEnv.txt in /boot

Quote

extraargs=zswap.enabled=1

Might be optargs instead of extraargs
Re: Ability to add extra Linux kernel parameters
August 12, 2014 02:15PM
CasperJim,

You could set the bootargs like this (the end of the bootargs):
usb_set_bootargs=setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts $usb_custom_params
usb_custom_params=zswap.enabled=1

As Warhead suggested, uEnv.txt in /boot is a less risky way to do this. But you're an experienced user so I would suggest the above instead.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Ability to add extra Linux kernel parameters
August 12, 2014 03:55PM
Bodhi, I'm very grateful for your help. And you too WarheadsSE. You're smart guys. It's good to know I have a couple different options here. :)
Re: Ability to add extra Linux kernel parameters
August 14, 2014 02:55AM
I tried setting the 'usb_custom_params', but it looks like I screwed up my uboot. I made a mistake in setting 'set_bootargs_usb'. I used double quotes instead of single quotes, and the shell interpreted everything "$name" as shell variables (which left them empty). I'm unable to figure out if I made any other mistakes?

To be sure the problem is uboot (and not the operating system), I reset the rootfs back to original default- Debian-3.14.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2

In uboot, I tried correcting 'set_bootargs_usb', but it's still not working. I tried using double quotes, single quotes, and no quotes.
setenv set_bootargs_usb 'setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts'
boot

The system is getting locked up after starting kernel...

Here is the output of printenv
arcNumber=3960
baudrate=115200
bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; reset
bootcmd_mmc=run mmc_init; run set_bootargs_mmc; run mmc_boot
bootcmd_sata=run sata_init; run set_bootargs_sata; run sata_boot;
bootcmd_usb=run usb_init; run set_bootargs_usb; run usb_boot;
bootdelay=3
console=ttyS0,115200
device=0:1
ethact=egiga0
ethaddr=00:25:31:03:91:1e
if_netconsole=ping $serverip
ipaddr=192.168.0.240
led_error=orange blinking
led_exit=green off
led_init=green blinking
machid=F78
mainlineLinux=yes
mmc_boot=mw 0x800000 0 1; run mmc_load_uimage; if run mmc_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
mmc_init=mmc rescan
mmc_load_uimage=ext2load mmc $device 0x800000 /boot/uImage
mmc_load_uinitrd=ext2load mmc $device 0x1100000 /boot/uInitrd
mmc_root=/dev/mmcblk0p1
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
ncip=192.168.0.201
partition=nand0,2
preboot=run if_netconsole start_netconsole
preboot_nc=run if_netconsole start_netconsole
rootdelay=10
rootfstype=ext4
sata_boot=mw 0x800000 0 1; run sata_load_uimage; if run sata_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
sata_init=ide reset
sata_load_uimage=ext2load ide $device 0x800000 /boot/uImage
sata_load_uinitrd=ext2load ide $device 0x1100000 /boot/uInitrd
sata_root=/dev/sda1
serverip=192.168.0.201
set_bootargs_mmc=setenv bootargs console=$console root=$mmc_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_sata=setenv bootargs console=$console root=$sata_root rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
set_bootargs_usb=setenv bootargs console= root= rootdelay= rootfstype=  zswap.enabled=1
start_netconsole=setenv ncip $serverip; setenv bootdelay 3; setenv stdin nc; setenv stdout nc; setenv stderr nc; version;
stderr=nc
stdin=nc
stdout=nc
usb_boot=mw 0x800000 0 1; run usb_load_uimage; if run usb_load_uinitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
usb_custom_params=zswap.enabled=1
usb_init=usb start
usb_load_uimage=ext2load usb $device 0x800000 /boot/uImage
usb_load_uinitrd=ext2load usb $device 0x1100000 /boot/uInitrd
usb_root=/dev/sda1
usb_rootfstype=ext2

This would be a lot easier if there was a way to log or get kernel output. Is there anything abnormal about the options listed? (The 'rootfstype=ext4' is correct.)

PS.
I tried using /boot/uEnv.txt before editing uboot parameters, but I could not get it to accept it for some reason. I even followed the information listed here http://linux-sunxi.org/UEnv.txt



Edited 1 time(s). Last edit at 08/14/2014 03:06AM by CasperJim.
Re: Ability to add extra Linux kernel parameters
August 14, 2014 03:19AM
I am so mad with myself right now. I don't think I've ever made so many typos before.

I changed this
setenv set_bootargs_usb setenv bootargs console=$console root=$usb_root rootdelay=$usb_rootdelay rootfstype=$usb_rootfstype $mtdparts
To this
setenv set_bootargs_usb setenv bootargs console=$console root=$usb_root  rootdelay=$rootdelay rootfstype=$rootfstype $mtdparts
And it started right up. Anyhow, I'd really prefer to get the options working in uEnv.txt if I could. WarheadSE, perhaps you could test getting zswap going on your system? No matter what I tried, I couldn't get it to even acknowledge /boot/uEnv.txt.
Re: Ability to add extra Linux kernel parameters
August 14, 2014 06:03AM
It looks like the way your uboot is setup does not load it, so it wouldn't do anything.
Re: Ability to add extra Linux kernel parameters
August 14, 2014 06:19AM
Right. Do you know how to fix that?
Re: Ability to add extra Linux kernel parameters
August 14, 2014 08:17AM
CasperJim,

If you've changed them around too much, it is hard to see the mistakes :) If you get the output of your current envs and post here. I'll take a look. May be just a typo somewhere. Or is it booting now?

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 2 time(s). Last edit at 08/14/2014 08:20AM by bodhi.
Re: Ability to add extra Linux kernel parameters
August 14, 2014 10:17AM
bodhi,

First, thank you very much again for the new U-Boot. I have got all my pogo v4s running with your noble efforts.

FYI, I simplify the U-Boot env a bit and it works for me. Here it is:

arcNumber=3960
baudrate=115200
bootcmd=setenv bootargs console=ttyS0,$baudrate root=LABEL=ROOT rootdelay=$bootdelay rootfstype=ext3 $mtdparts; run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; reset
bootcmd_mmc=mmc rescan; mw 0x800000 0 1; ext2load mmc 0:1 0x800000 /boot/uImage; if ext2load mmc 0:1 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd_sata=ide reset; mw 0x800000 0 1; ext2load ide 0:1 0x800000 /boot/uImage; if ext2load ide 0:1 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootcmd_usb=usb start; mw 0x800000 0 1; ext2load usb 0:1 0x800000 /boot/uImage; if ext2load usb 0:1 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi
bootdelay=3
ethact=egiga0
led_error=orange blinking
led_exit=green off
led_init=green blinking
machid=f78
mainlineLinux=yes
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),-(root)
preboot_nc=if ping $serverip; then setenv ncip $serverip; setenv stdin nc; setenv stdout nc; setenv stderr nc; version; fi
stderr=serial
stdin=serial
stdout=serial

And,
(%3)(11:13)(punk)/home/tftp> cat /etc/fstab
LABEL=ROOT / ext3 noatime,errors=remount-ro 0 1
LABEL=HOME /home ext4 defaults 0 0
/swap none swap sw,pri=0 0 0

-syong
Re: Ability to add extra Linux kernel parameters
August 14, 2014 02:13PM
Hi syong,

Thanks for posting a nice and clean set of envs! it's much easier to read this way.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: