udev-builtin-firmware.c revision 8fef0ff25c9fd7e5bb99d66f43c6357e4996a3cc
/*
* firmware - Kernel firmware loader
*
* Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
* Copyright (C) 2009-2011 Kay Sievers <kay.sievers@vrfy.org>
*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details:*
*/
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <getopt.h>
#include <errno.h>
#include <stdbool.h>
#include "udev.h"
{
return false;
};
return true;
}
{
char *buf;
bool ret = false;
log_error("No memory available to load firmware file");
return false;
}
goto exit;
goto exit;
goto exit;
ret = true;
exit:
return ret;
}
{
static const char *searchpath[] = { FIRMWARE_PATH };
char fwencpath[UTIL_PATH_SIZE];
char misspath[UTIL_PATH_SIZE];
char loadpath[UTIL_PATH_SIZE];
char datapath[UTIL_PATH_SIZE];
char fwpath[UTIL_PATH_SIZE];
const char *firmware;
unsigned int i;
int rc = EXIT_SUCCESS;
log_error("firmware parameter missing\n\n");
rc = EXIT_FAILURE;
goto exit;
}
/* lookup firmware file */
for (i = 0; i < ELEMENTSOF(searchpath); i++) {
break;
break;
}
util_strscpyl(misspath, sizeof(misspath), udev_get_run_path(udev), "/firmware-missing/", fwencpath, NULL);
int err;
/* This link indicates the missing firmware file and the associated device */
do {
break;
if (err != 0)
rc = EXIT_FAILURE;
goto exit;
}
rc = EXIT_FAILURE;
goto exit;
}
goto exit;
rc = EXIT_FAILURE;
goto exit;
};
exit:
if (fwfile)
return rc;
}
const struct udev_builtin udev_builtin_firmware = {
.name = "firmware",
.cmd = builtin_firmware,
.help = "kernel firmware loader",
.run_once = true,
};