barebox/lib/bootstrap/disk.c
Masahiro Yamada d8753571b2 sizes.h: move include/sizes.h to include/linux/sizes.h
This file originates in Linux.  Linux has it under include/linux/
directory since commit dccd2304cc90.
Let's move it to the same place as well in barebox.

This commit was generated by the following commands:

  find -name '*.[chS]' | xargs sed -i -e 's:<sizes.h>:<linux/sizes.h>:'
  git mv include/sizes.h include/linux/

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-08 14:00:26 +01:00

39 lines
715 B
C

/*
* Copyright (C) 2011 Sascha Hauer, Pengutronix
* Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
*
* Under GPLv2
*/
#include <common.h>
#include <fs.h>
#include <fcntl.h>
#include <linux/sizes.h>
#include <errno.h>
#include <malloc.h>
#include <libfile.h>
#include <bootstrap.h>
void* bootstrap_read_disk(char *dev, char *fstype)
{
int ret;
void *buf;
int len;
char *path = "/";
ret = mount(dev, fstype, path, NULL);
if (ret) {
bootstrap_err("mounting %s failed with %d\n", dev, ret);
return NULL;
}
buf = read_file("/barebox.bin", &len);
if (!buf) {
bootstrap_err("could not read barebox.bin from %s\n", dev);
umount(path);
return NULL;
}
return buf;
}