Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
struct hw* hw_init() {
- struct hw* hw = malloc(sizeof(*hw));
+ struct hw* hw = calloc(1, sizeof(*hw));
assert(hw);
// Initialize libudev
exit(1);
}
+ // Detect if we are running in EFI mode
+ int ret = access("/sys/firmware/efi", R_OK);
+ if (ret == 0)
+ hw->efi = 1;
+
return hw;
}
struct hw {
struct udev *udev;
+ int efi;
};
struct hw_disk {
}
fprintf(flog, "Install program started.\n");
-
+ if (hw->efi)
+ fprintf(flog, "EFI mode enabled\n");
+
newtInit();
newtCls();