mirror of
https://github.com/ipxe/ipxe
synced 2026-01-07 04:31:39 +03:00
[image] Simplify image management commands and internal API
Remove the name, cmdline, and action parameters from imgdownload() and imgdownload_string(). These functions now simply download and return an image. Add the function imgacquire(), which will interpret a "name or URI string" parameter and return either an existing image or a newly downloaded image. Use imgacquire() to merge similar image-management commands that currently differ only by whether they take the name of an existing image or the URI of a new image to download. For example, "chain" and "imgexec" can now be merged. Extend imgstat and imgfree commands to take an optional list of images. Remove the arbitrary restriction on the length of image names. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -28,6 +28,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#include <ipxe/crypto.h>
|
||||
#include <ipxe/md5.h>
|
||||
#include <ipxe/sha1.h>
|
||||
#include <usr/imgmgmt.h>
|
||||
|
||||
/** @file
|
||||
*
|
||||
@@ -74,8 +75,8 @@ static int digest_exec ( int argc, char **argv,
|
||||
|
||||
for ( i = optind ; i < argc ; i++ ) {
|
||||
|
||||
/* find image */
|
||||
if ( ( rc = parse_image ( argv[i], &image ) ) != 0 )
|
||||
/* Acquire image */
|
||||
if ( ( rc = imgacquire ( argv[i], &image ) ) != 0 )
|
||||
continue;
|
||||
offset = 0;
|
||||
len = image->len;
|
||||
|
||||
Reference in New Issue
Block a user