MCPcopy Create free account
hub / github.com/coreboot/coreboot / main

Function main

util/cbfstool/ifwitool.c:1913–1997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1911}
1912
1913int main(int argc, char **argv)
1914{
1915 if (argc < 3) {
1916 usage(argv[0]);
1917 return 1;
1918 }
1919
1920 param.image_name = argv[1];
1921 param.logical_boot_partition = LBP1;
1922 char *cmd = argv[2];
1923 optind += 2;
1924
1925 uint32_t i;
1926
1927 for (i = 0; i < ARRAY_SIZE(commands); i++) {
1928 if (strcmp(cmd, commands[i].name) != 0)
1929 continue;
1930
1931 int c;
1932
1933 while (1) {
1934 int option_index;
1935
1936 c = getopt_long(argc, argv, commands[i].optstring,
1937 long_options, &option_index);
1938
1939 if (c == -1)
1940 break;
1941
1942 /* Filter out illegal long options. */
1943 if (strchr(commands[i].optstring, c) == NULL) {
1944 ERROR("%s: invalid option -- '%c'\n", argv[0],
1945 c);
1946 c = '?';
1947 }
1948
1949 switch (c) {
1950 case 'n':
1951 param.subpart_name = optarg;
1952 break;
1953 case 's':
1954 param.logical_boot_partition = LBP2;
1955 break;
1956 case 'f':
1957 param.file_name = optarg;
1958 break;
1959 case 'd':
1960 param.dir_ops = 1;
1961 break;
1962 case 'e':
1963 param.dentry_name = optarg;
1964 break;
1965 case 'v':
1966 verbose++;
1967 break;
1968 case 'h':
1969 case '?':
1970 usage(argv[0]);

Callers

nothing calls this directly

Calls 6

getopt_longFunction · 0.85
usageFunction · 0.70
ifwi_parseFunction · 0.70
ifwi_repackFunction · 0.70
strcmpFunction · 0.50
strchrFunction · 0.50

Tested by

no test coverage detected