Skip to main content.
Navigation:
DENX
>
DULG
>
LinuxKernelArgs
Translations:
Edit
|
Attach
|
Raw
|
Ref-By
|
Printable
|
More
DULG
Sections of this site:
DENX Home
|
DULG
|
ELDK-5
|
Know
|
Training
|
U-Boot
|
U-Bootdoc
Topics
DULG Home
BoardSelect
Manual
FAQ
Application Notes
Changes
Index
List of pages in DULG
Search
%SECTION0{name=LinuxKernelArgs}% Passing Kernel Arguments In nearly all cases, you will want to pass additional information to the Linux kernel; for instance, information about the root device or network configuration. In U-Boot, this is supported using the =bootargs= environment variable. Its contents are automatically passed to the Linux kernel as boot arguments (or "command line" arguments). This allows the use of the same Linux kernel image in a wide range of configurations. For instance, by just changing the contents of the =bootargs= variable you can use the very same Linux kernel image to boot with an =initrd= ramdisk image, with a root filesystem over NFS, with a CompactFlash disk or from a flash filesystem. As one example, to boot the Linux kernel image at address %IF{ "%ARCH%" eq "powerpc"}%0x400000%ELSE% 0x%KERNEL_ADDR% %ENDIF% using the =initrd= ramdisk image at address %IF{ "%ARCH%" eq "powerpc"}%0x600000 %ELSE% 0x%INITRD_ADDR% %ENDIF% as root filesystem, %IF{ "%ARCH%" eq "powerpc"}% and with the flattened device tree blob at address 0x800000, %ENDIF% %IF{ "%HAVE_FDT%" eq "true" }% and with the flattened device tree blob at address 0x%FDT_ADDR%, %ENDIF% you can use the following commands: <pre> %UBOOT_PROMPT% setenv bootargs root=/dev/ram rw %UBOOT_PROMPT% bootm %IF1{ "%ARCH%" eq "powerpc"}%0x400000 0x600000%ELSE1% 0x%KERNEL_ADDR% 0x%INITRD_ADDR% %ENDIF1% %IF2{ "%ARCH%" eq "powerpc"}% 0x800000 %ENDIF2% %IF2{ "%HAVE_FDT%" eq "true"}% 0x%FDT_ADDR% %ENDIF2% </pre> To boot the same kernel image with a root filesystem over NFS, the following command sequence can be used. This example assumes that your NFS server has the IP address "%SERVERIP%" and exports the directory "%ROOTPATH%" as root filesystem for the target. The target has been assigned the IP address "%IPADDR%" and the hostname "%HOSTNAME%". A netmask of "%NETMASK%" is used: <pre> %UBOOT_PROMPT% setenv bootargs root=/dev/nfs rw nfsroot=%SERVERIP%:%ROOTPATH% ip=%IPADDR%:%SERVERIP%:%GATEWAYIP%:%NETMASK%:%HOSTNAME%::off %UBOOT_PROMPT% bootm %IF1{ "%ARCH%" eq "powerpc"}%0x400000%ELSE1% 0x%KERNEL_ADDR% %ENDIF1% %IF{ "%ARCH%" eq "powerpc"}% - 0x800000 %ENDIF% %IF{ "%HAVE_FDT%" eq "true"}% - 0x%FDT_ADDR% %ENDIF% </pre> Please see also the files =Documentation/initrd.txt= and =Documentation/nfsroot.txt= in your Linux kernel source directory for more information about which options can be passed to the Linux kernel. %X% Note: Once your system is up and running, if you have a simple shell login, you can normally examine the boot arguments that were used by the kernel for the most recent boot with the command: <verbatim> $ cat /proc/cmdline </verbatim>
7.2. Flattened Device Tree Blob
1. Abstract
7.4. Boot Arguments Unleashed
Prev
Home
Next