[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Modifying kernel bootargs



Hi,
i needed to pass the param rootdelay to the kernel because my qnap has rootfs on sd card.
I solved the problem by creating the following hook:

root@hs210-srv:/etc/initramfs-tools/hooks# cat cmdline
#!/bin/sh
PREREQ=""
prereqs()
{
     echo "$PREREQ"
}

case $1 in
prereqs)
     prereqs
     exit 0
     ;;
esac

. /usr/share/initramfs-tools/hook-functions
# Begin real processing below this line

echo "ROOTDELAY=5" >> $DESTDIR/conf/param.conf
exit 0

Hope this helps.
Regards,
  Edoardo.

2015-09-04 13:38 GMT+02:00 Ian Campbell <ijc@hellion.org.uk>:
On Fri, 2015-09-04 at 09:19 +0100, Tim Fletcher wrote:
> On 03/09/15 17:56, Ian Campbell wrote:
> > On Thu, 2015-09-03 at 18:00 +0200, JM wrote:
> > > Hi,
> > >
> > > I can't seem to figure out how to pass kernel parameters using flash
> > > -kernel. This is with flash-kernel 3.45 and linux-image-kirkwood
> > > 4.1.0-2
> > > from testing on QNAP TS-212P.
> > >
> > > I edit the LINUX_KERNEL_CMDLINE in /etc/default/flash-kernel, rebuild
> > > the
> > > kernel and initramfs image, reflash and... nothing. The command line
> > > in
> > > dmesg remains unchanged.
> > >
> > > Does this require some specific uboot version? Platform support? Is
> > > this
> > > currently working for other people?
> >
> > It needs platform support, specifically it only works with systems
> > which
> > boot via the /boot/boot.scr mechanism.
> >
> > On a QNAP system the command line is in the firmware I'm afraid. If you
> > have serial you can fiddle it from the u-boot prompt (I expect, I've
> > not
> > actually tried on this platform).
> >
> > Depending what your goal is you might be able to fiddle it in the
> > initramfs
> > without actually changing the cmdline, like /usr/share/initramfs
> > -tools/hooks/flash_kernel_set_root does for the root filesystem. That's
> > very dependent on what you are trying to go.
>
> I thought there was a way in flash-kernel

AFAIK only the root= which gets mounted not the command line in general.

>  or mkinitramfs

I don't know about this for sure. I'm not aware of it if it exists.
I'm not aware of a mechanism for anything userspace (which is what
initramfs) to modify the command line, even if it is only halfway through
boot it's hard to know what that would mean.

>  to override the bootloaders kernel args?




--
----------------------------------------------------------------
| Edoardo Bello
| Via S.Giovanni Postal 33 (Grumo)
| 38010 San Michele All'Adige, Trento
| Italia
|
| tel:  +390461650989
| cell: +393287649563
| skype: edoardo.bello
-----------------------------------------------------------------

Reply to: