util: move is_efiboot() to efivars.c

This commit is contained in:
Lennart Poettering 2013-01-19 04:41:33 +01:00
parent e1af7092a8
commit 34e5a31ec5
5 changed files with 8 additions and 6 deletions

View file

@ -41,6 +41,7 @@
#include "path-util.h"
#include "missing.h"
#include "virt.h"
#include "efivars.h"
#ifndef TTY_GID
#define TTY_GID 5

View file

@ -28,6 +28,10 @@
#define EFI_VENDOR_LOADER SD_ID128_MAKE(4a,67,b0,82,0a,4c,41,cf,b6,c7,44,0b,29,bb,8c,4f)
bool is_efiboot(void) {
return access("/sys/firmware/efi", F_OK) >= 0;
}
int efi_get_variable(sd_id128_t vendor, const char *name, uint32_t *attribute, void **value, size_t *size) {
_cleanup_close_ int fd = -1;
_cleanup_free_ char *p = NULL;

View file

@ -26,5 +26,8 @@
#include "sd-id128.h"
bool is_efiboot(void);
int efi_get_variable(sd_id128_t vendor, const char *name, uint32_t *attribute, void **value, size_t *size);
int efi_get_boot_timestamps(const dual_timestamp *n, dual_timestamp *firmware, dual_timestamp *loader);

View file

@ -77,10 +77,6 @@ char **saved_argv = NULL;
static volatile unsigned cached_columns = 0;
static volatile unsigned cached_lines = 0;
bool is_efiboot(void) {
return access("/sys/firmware/efi", F_OK) >= 0;
}
size_t page_size(void) {
static __thread size_t pgsz = 0;
long r;

View file

@ -60,8 +60,6 @@ union dirent_storage {
#define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m"
#define ANSI_HIGHLIGHT_OFF "\x1B[0m"
bool is_efiboot(void);
size_t page_size(void);
#define PAGE_ALIGN(l) ALIGN_TO((l), page_size())