aboutsummaryrefslogtreecommitdiff
path: root/include/pxe_utils.h
AgeCommit message (Collapse)AuthorFilesLines
2022-02-11cmd: pxe_utils: sysboot: add kaslr-seed generation supportZhang Ning1-0/+2
this will add kaslrseed keyword to sysboot lable, when it set, it will request to genarate random number from hwrng as kaslr-seed. with this patch exlinux.conf label looks like label l0 menu testing linux /boot/vmlinuz-5.15.16-arm initrd /boot/initramfs-5.15.16-arm.img fdtdir /boot/dtbs/5.15.16-arm/ kaslrseed append root=UUID=92ae1e50-eeeb-4c5b-8939-7e1cd6cfb059 ro Tested on Khadas VIM with kernel 5.16.0-rc5-arm64, Debian 11. Signed-off-by: Zhang Ning <zhangn1985@qq.com>
2022-01-19doc: replace @return by Return:Heinrich Schuchardt1-2/+2
Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2021-11-11pxe: Allow calling the pxe_get logic directlySimon Glass1-0/+14
Refactor this code so that we can call the 'pxe get' command without going through the command-line interpreter. This makes it easier to get the information we need, without going through environment variables. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-11pxe: Return the file size from the getfile() functionSimon Glass1-1/+12
It is pretty strange that the pxe code uses the 'filesize' environment variable find the size of a file it has just read. Partly this is because it uses the command-line interpreter to parse its request to load the file. As a first step towards unwinding this, return it directly from the getfile() function. This makes the code a bit longer, for now, but will be cleaned up in future patches. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-11pxe: Drop get_bootfile_path()Simon Glass1-1/+2
This function no longer makes sense, since it is pretty easy to prepend the boot directory to the filename. Drop it and update its only caller. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-11pxe: Clean up the use of bootfileSimon Glass1-3/+16
The 'bootfile' environment variable is read in the bowels of pxe_util to provide a directory to which all loaded files are relative. This is not obvious from the API to PXE and it is strange to make the caller set an environment variable rather than pass this as a parameter. The code is also convoluted, which this feature implemented by get_bootfile_path(). Update the API to improve this. Unfortunately this means that pxe_setup_ctx() can fail, so add error checking. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-11pxe: Move common parsing coding into pxe_utilSimon Glass1-0/+9
Both the syslinux and pxe commands use essentially the same code to parse and run extlinux.conf files. Move this into a common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2021-11-11pxe: Move pxe_utils filesSimon Glass1-0/+205
Move the header file into the main include/ directory so we can use it from the bootmethod code. Move the C file into boot/ since it relates to booting. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>