• Stephen Warren's avatar
    fs: implement infrastructure for an 'exists' function · 6152916a
    Stephen Warren authored
    This could be used in scripts such as:
    if test -e mmc 0:1 /boot/boot.scr; then
        load mmc 0:1 ${scriptaddr} /boot/boot.scr
        source ${scriptaddr}
    rather than:
    if load mmc 0:1 ${scriptaddr} /boot/boot.scr; then
        source ${scriptaddr}
    This prevents errors being printed by attempts to load non-existent
    files, which can be important when checking for a large set of files,
    such as /boot/boot.scr.uimg, /boot/boot.scr, /boot/extlinux.conf,
    /boot.scr.uimg, /boot.scr, /extlinux.conf.
    Signed-off-by: default avatarStephen Warren <swarren@nvidia.com>
    Acked-by: default avatarSimon Glass <sjg@chromium.org>
fs.h 3.03 KB