From c5cec3c71c1c9d4a406f91e7ea77b1943f86ebc3 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 13 May 2024 10:11:34 +0000 Subject: [PATCH] mkbootfs: Allow invocation with no directories specified 1. A non-empty archive can still be generated, if a dev nodes file is specified; and 2. cpio itself handles the case of an empty archive (containing only the trailer entry), for example: echo -n | cpio -oc | cpio -it Bug: 328362894 Change-Id: If17796f445e50842249554a1e82478bc375cf5eb --- mkbootfs/mkbootfs.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mkbootfs/mkbootfs.c b/mkbootfs/mkbootfs.c index eaa5d55b4..84a0a4eee 100644 --- a/mkbootfs/mkbootfs.c +++ b/mkbootfs/mkbootfs.c @@ -445,11 +445,6 @@ int main(int argc, char *argv[]) int num_dirs = argc - optind; argv += optind; - if (num_dirs <= 0) { - usage(); - errx(1, "no directories to process?!"); - } - while(num_dirs-- > 0){ char *x = strchr(*argv, '='); if(x != 0) {