This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
cmd:imgfetch [2016/02/17 11:26] mcb30 |
cmd:imgfetch [2021/05/24 12:46] mcb30 |
||
---|---|---|---|
Line 19: | Line 19: | ||
imgfetch http://boot.ipxe.org/1mb | imgfetch http://boot.ipxe.org/1mb | ||
- | === Download and boot a Linux kernel, initrd and kernel module (using a script) === | + | === Download and boot a Linux kernel, initrd and kernel module === |
#!ipxe | #!ipxe | ||
- | kernel /boot/vmlinuz-2.6.31 | + | kernel /boot/vmlinuz-2.6.31 initrd=initrd.magic |
initrd initrd.img | initrd initrd.img | ||
initrd /modules/2.6.31/e1000.ko /lib/modules/e1000.ko | initrd /modules/2.6.31/e1000.ko /lib/modules/e1000.ko | ||
Line 54: | Line 54: | ||
There is no difference between the commands ''imgfetch'', ''module'', and ''initrd''. | There is no difference between the commands ''imgfetch'', ''module'', and ''initrd''. | ||
- | When booting a Linux kernel, any argument supplied to the ''initrd'' command will be used as the pathname for that image within the initial RAM filesystem. For example, if you have the script | + | When booting a Linux kernel, iPXE can construct a "magic initrd" by injecting downloaded files into the initial RAM filesystem image. Any argument supplied to the ''initrd'' command will be used as the pathname for that image within the ''initrd.magic'' initial RAM filesystem. For example, if you have the script |
#!ipxe | #!ipxe | ||
| | ||
- | kernel /boot/vmlinuz-2.6.31 | + | kernel /boot/vmlinuz-2.6.31 initrd=initrd.magic |
initrd initrd.img | initrd initrd.img | ||
initrd /initscripts/deploy.sh /sbin/init mode=755 | initrd /initscripts/deploy.sh /sbin/init mode=755 | ||
Line 66: | Line 66: | ||
The optional ''mode'' parameter can be used to change the file mode, which defaults to 644. This can be useful for binaries that need to be executed. | The optional ''mode'' parameter can be used to change the file mode, which defaults to 644. This can be useful for binaries that need to be executed. | ||
+ | |||
+ | The magic initrd is used automatically when booting in BIOS mode. To get the same behaviour in both BIOS and UEFI modes, you must include ''initrd=initrd.magic'' in the kernel command line (as in the above example). | ||