Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a228822c authored by Dan Willemsen's avatar Dan Willemsen
Browse files

Compile toolbox's newfs_msdos for the host

For potential use with build/make/tools/fat16copy.py

Bug: 63035155
Test: mmma system/core/toolbox; newfs_msdos
Change-Id: I8ad50b8c181fc4ec21e191ec9fea8e9aa11d2d9b
parent 78393951
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -61,3 +61,10 @@ cc_binary {
    defaults: ["toolbox_defaults"],
    defaults: ["toolbox_defaults"],
    srcs: ["r.c"],
    srcs: ["r.c"],
}
}

cc_binary_host {
    name: "newfs_msdos",
    defaults: ["toolbox_defaults"],
    srcs: ["newfs_msdos.c"],
    cflags: ["-Dnewfs_msdos_main=main"]
}
+15 −6
Original line number Original line Diff line number Diff line
@@ -32,15 +32,17 @@ static const char rcsid[] =


#include <sys/param.h>
#include <sys/param.h>


#ifndef ANDROID
#ifdef __APPLE__
#elif defined(ANDROID)
#include <linux/fs.h>
#include <linux/hdreg.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#else
#include <sys/fdcio.h>
#include <sys/fdcio.h>
#include <sys/disk.h>
#include <sys/disk.h>
#include <sys/disklabel.h>
#include <sys/disklabel.h>
#include <sys/mount.h>
#include <sys/mount.h>
#else
#include <stdarg.h>
#include <linux/fs.h>
#include <linux/hdreg.h>
#endif
#endif


#include <sys/stat.h>
#include <sys/stat.h>
@@ -58,6 +60,10 @@ static const char rcsid[] =
#include <time.h>
#include <time.h>
#include <unistd.h>
#include <unistd.h>


#ifndef __unused
#define __unused __attribute__((__unused__))
#endif

#define MAXU16   0xffff     /* maximum unsigned 16-bit quantity */
#define MAXU16   0xffff     /* maximum unsigned 16-bit quantity */
#define BPN      4          /* bits per nibble */
#define BPN      4          /* bits per nibble */
#define NPB      2          /* nibbles per byte */
#define NPB      2          /* nibbles per byte */
@@ -794,7 +800,10 @@ static void getstdfmt(const char *fmt, struct bpb *bpb)
 * Get disk slice, partition, and geometry information.
 * Get disk slice, partition, and geometry information.
 */
 */


#ifdef ANDROID
#ifdef __APPLE__
static void getdiskinfo(__unused int fd, __unused const char* fname, __unused const char* dtype,
                        __unused int oflag, __unused struct bpb* bpb) {}
#elif ANDROID
static void getdiskinfo(int fd, const char *fname, const char *dtype,
static void getdiskinfo(int fd, const char *fname, const char *dtype,
                        __unused int oflag,struct bpb *bpb)
                        __unused int oflag,struct bpb *bpb)
{
{