Can't Compile Android Oreo Kernel - ONE Q&A, Help & Troubleshooting

Hi guys,
I'm trying to compile fourkbomb's Oreo Kernel but I'm stuck on:
drivers/power/qpnp-bms.c:432:13: error: redefinition of 'disable_bms_irq_nosync'
drivers/power/qpnp-bms.c:421:13: note: previous definition of 'disable_bms_irq_nosync' was here
drivers/power/qpnp-bms.c:421:13: warning: 'disable_bms_irq_nosync' defined but not used [-Wunused-function]
error, forbidden warning: qpnp-bms.c:421
scripts/Makefile.build:307: recipe for target 'drivers/power/qpnp-bms.o' failed
make[2]: *** [drivers/power/qpnp-bms.o] Error 1
scripts/Makefile.build:443: recipe for target 'drivers/power' failed
make[1]: *** [drivers/power] Error 2
Makefile:954: recipe for target 'drivers' failed
make: *** [drivers] Error 2
The only things I added are the mac80211 injection patch( http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch ) and the keyboard gadget patch ( https://github.com/pelya/android-ke...eric-kernel-version/generic_kernel_3.04.patch )
Does anyone know how to solve this?

nik012003 said:
Hi guys,
I'm trying to compile fourkbomb's Oreo Kernel but I'm stuck on:
drivers/power/qpnp-bms.c:432:13: error: redefinition of 'disable_bms_irq_nosync'
drivers/power/qpnp-bms.c:421:13: note: previous definition of 'disable_bms_irq_nosync' was here
drivers/power/qpnp-bms.c:421:13: warning: 'disable_bms_irq_nosync' defined but not used [-Wunused-function]
error, forbidden warning: qpnp-bms.c:421
scripts/Makefile.build:307: recipe for target 'drivers/power/qpnp-bms.o' failed
make[2]: *** [drivers/power/qpnp-bms.o] Error 1
scripts/Makefile.build:443: recipe for target 'drivers/power' failed
make[1]: *** [drivers/power] Error 2
Makefile:954: recipe for target 'drivers' failed
make: *** [drivers] Error 2
The only things I added are the mac80211 injection patch( http://patches.aircrack-ng.org/mac80211.compat08082009.wl_frag+ack_v1.patch ) and the keyboard gadget patch ( https://github.com/pelya/android-ke...eric-kernel-version/generic_kernel_3.04.patch )
Does anyone know how to solve this?
Click to expand...
Click to collapse
This should be the kernel you're trying to build, right?
Look at the compiler errors. The first one tells you that a function in drivers/power/qpnp-bms.c is defined twice. This should not happen. A quick look to the commit history of that file reveals that this commit added a second definition of that function that was not needed, since the other definition was already present. Compare the two definitions: they're similar but not equal. The other one has been improved with the addition of some code by previous commits. So revert this commit: b48e3d6c4c41822f21b0967b0663cbf6a521ec3b to remove the second, useless definition. The second error (unused function) should disappear too, after reverting that commit. Anyway, neither one nor the other error was caused by the patches you applied to the kernel source. fourkbomb probably made a little mistake when merging some commits, I guess.

Tomoms said:
This should be the kernel you're trying to build, right?
Look at the compiler errors. The first one tells you that a function in drivers/power/qpnp-bms.c is defined twice. This should not happen. A quick look to the commit history of that file reveals that this commit added a second definition of that function that was not needed, since the other definition was already present. Compare the two definitions: they're similar but not equal. The other one has been improved with the addition of some code by previous commits. So revert this commit: b48e3d6c4c41822f21b0967b0663cbf6a521ec3b to remove the second, useless definition. The second error (unused function) should disappear too, after reverting that commit. Anyway, neither one nor the other error was caused by the patches you applied to the kernel source. fourkbomb probably made a little mistake when merging some commits, I guess.
Click to expand...
Click to collapse
Looks like it worked!
Thank you so much!
Now I got another error:
CC drivers/staging/android/binder.o
drivers/staging/android/binder.c: In function 'binder_transaction_buffer_release':
drivers/staging/android/binder.c:1629:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
error, forbidden warning: binder.c:1629
scripts/Makefile.build:307: recipe for target 'drivers/staging/android/binder.o' failed
make[3]: *** [drivers/staging/android/binder.o] Error 1
scripts/Makefile.build:443: recipe for target 'drivers/staging/android' failed
make[2]: *** [drivers/staging/android] Error 2
scripts/Makefile.build:443: recipe for target 'drivers/staging' failed
make[1]: *** [drivers/staging] Error 2
Makefile:954: recipe for target 'drivers' failed
make: *** [drivers] Error 2
I'll try to figure out where the problem is

nik012003 said:
Looks like it worked!
Thank you so much!
Now I got another error:
CC drivers/staging/android/binder.o
drivers/staging/android/binder.c: In function 'binder_transaction_buffer_release':
drivers/staging/android/binder.c:1629:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
error, forbidden warning: binder.c:1629
scripts/Makefile.build:307: recipe for target 'drivers/staging/android/binder.o' failed
make[3]: *** [drivers/staging/android/binder.o] Error 1
scripts/Makefile.build:443: recipe for target 'drivers/staging/android' failed
make[2]: *** [drivers/staging/android] Error 2
scripts/Makefile.build:443: recipe for target 'drivers/staging' failed
make[1]: *** [drivers/staging] Error 2
Makefile:954: recipe for target 'drivers' failed
make: *** [drivers] Error 2
I'll try to figure out where the problem is
Click to expand...
Click to collapse
I've found the problem, but this one might be trickier for you to solve it. Should you need any advice or help, just ask me

Tomoms said:
I've found the problem, but this one might be trickier for you to solve it. Should you need any advice or help, just ask me
Click to expand...
Click to collapse
I'm so tempted to revert back this commit but I have a feeling that it's not going to work...
There is a problem with the function binder_transaction_buffer_release on line 1629 where I can see:
fd_array = (u32 *)(parent_buffer + fda->parent_offset);
I think "(u32 *)" that is wrong because the function isn't returning 32bit values but I have no idea how to fix that.
I have to nail down the bug further or find a LineageOs Oreo Kernel that compiles...

nik012003 said:
I'm so tempted to revert back this commit but I have a felling that it's not going to work...
There is a problem with the function binder_transaction_buffer_release on line 1629 where I can see:
fd_array = (u32 *)(parent_buffer + fda->parent_offset);
I think "(u32 *)" that is wrong because the function isn't returning 32bit values but I have no idea how to fix that.
I have to nail down the bug further or find a LineageOs Oreo Kernel that compiles...
Click to expand...
Click to collapse
No, that commit is not the cause of the issue. The issue is related to a new binder configuration option that is needed to ensure Oreo compatibility. Revert this commit: https://github.com/fourkbomb/android_kernel_oppo_msm8974/commit/b9bb71ce90bfb91740ac72d2a5584897cdee07a6 and set CONFIG_ANDROID_BINDER_IPC_32BIT=y in your defconfig.

Tomoms said:
No, that commit is not the cause of the issue. The issue is related to a new binder configuration option that is needed to ensure Oreo compatibility. Revert this commit: https://github.com/fourkbomb/android_kernel_oppo_msm8974/commit/b9bb71ce90bfb91740ac72d2a5584897cdee07a6 and set CONFIG_ANDROID_BINDER_IPC_32BIT=y in your defconfig.
Click to expand...
Click to collapse
I'll try that tomorrow and I'll let you know how it goes.
Thank you very much!

Ok, it worked!
Now I'm getting errors regarding the android usb gadget patch:
CC drivers/usb/gadget/android.o
In file included from drivers/usb/gadget/android.c:82:0:
drivers/usb/gadget/f_hid_android_keyboard.c:5:36: warning: 'ghid_device_android_keyboard' defined but not used [-Wunused-variable]
error, forbidden warning: f_hid_android_keyboard.c:5
scripts/Makefile.build:307: recipe for target 'drivers/usb/gadget/android.o' failed
make[3]: *** [drivers/usb/gadget/android.o] Error 1
scripts/Makefile.build:443: recipe for target 'drivers/usb/gadget' failed
make[2]: *** [drivers/usb/gadget] Error 2
scripts/Makefile.build:443: recipe for target 'drivers/usb' failed
make[1]: *** [drivers/usb] Error 2
Makefile:954: recipe for target 'drivers' failed
My f_hid_android_keyboard.c contains only a struct:
#include <linux/platform_device.h>
#include <linux/usb/g_hid.h>
/* hid descriptor for a keyboard */
static struct hidg_func_descriptor ghid_device_android_keyboard = {
.subclass = 1, /* Boot Interface Subclass */
.protocol = 1, /* Keyboard */
.report_length = 8,
.report_desc_length = 63,
.report_desc = {
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x06, /* USAGE (Keyboard) */
0xa1, 0x01, /* COLLECTION (Application) */
0x05, 0x07, /* USAGE_PAGE (Keyboard) */
0x19, 0xe0, /* USAGE_MINIMUM (Keyboard LeftControl) */
0x29, 0xe7, /* USAGE_MAXIMUM (Keyboard Right GUI) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x95, 0x08, /* REPORT_COUNT (8) */
0x81, 0x02, /* INPUT (Data,Var,Abs) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x81, 0x03, /* INPUT (Cnst,Var,Abs) */
0x95, 0x05, /* REPORT_COUNT (5) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x05, 0x08, /* USAGE_PAGE (LEDs) */
0x19, 0x01, /* USAGE_MINIMUM (Num Lock) */
0x29, 0x05, /* USAGE_MAXIMUM (Kana) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x75, 0x03, /* REPORT_SIZE (3) */
0x91, 0x03, /* OUTPUT (Cnst,Var,Abs) */
0x95, 0x06, /* REPORT_COUNT (6) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x65, /* LOGICAL_MAXIMUM (101) */
0x05, 0x07, /* USAGE_PAGE (Keyboard) */
0x19, 0x00, /* USAGE_MINIMUM (Reserved) */
0x29, 0x65, /* USAGE_MAXIMUM (Keyboard Application) */
0x81, 0x00, /* INPUT (Data,Ary,Abs) */
0xc0 /* END_COLLECTION */
}
};
I can see that the patch wasn't applied correctly due to some missing code in my android.c file.( I can't see the function hid_function_bind_config, but It's there in the patch file)
Can I just manually apply the patches?

nik012003 said:
Ok, it worked!
Now I'm getting errors regarding the android usb gadget patch:
CC drivers/usb/gadget/android.o
In file included from drivers/usb/gadget/android.c:82:0:
drivers/usb/gadget/f_hid_android_keyboard.c:5:36: warning: 'ghid_device_android_keyboard' defined but not used [-Wunused-variable]
error, forbidden warning: f_hid_android_keyboard.c:5
scripts/Makefile.build:307: recipe for target 'drivers/usb/gadget/android.o' failed
make[3]: *** [drivers/usb/gadget/android.o] Error 1
scripts/Makefile.build:443: recipe for target 'drivers/usb/gadget' failed
make[2]: *** [drivers/usb/gadget] Error 2
scripts/Makefile.build:443: recipe for target 'drivers/usb' failed
make[1]: *** [drivers/usb] Error 2
Makefile:954: recipe for target 'drivers' failed
My f_hid_android_keyboard.c contains only a struct:
#include <linux/platform_device.h>
#include <linux/usb/g_hid.h>
/* hid descriptor for a keyboard */
static struct hidg_func_descriptor ghid_device_android_keyboard = {
.subclass = 1, /* Boot Interface Subclass */
.protocol = 1, /* Keyboard */
.report_length = 8,
.report_desc_length = 63,
.report_desc = {
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
0x09, 0x06, /* USAGE (Keyboard) */
0xa1, 0x01, /* COLLECTION (Application) */
0x05, 0x07, /* USAGE_PAGE (Keyboard) */
0x19, 0xe0, /* USAGE_MINIMUM (Keyboard LeftControl) */
0x29, 0xe7, /* USAGE_MAXIMUM (Keyboard Right GUI) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x95, 0x08, /* REPORT_COUNT (8) */
0x81, 0x02, /* INPUT (Data,Var,Abs) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x81, 0x03, /* INPUT (Cnst,Var,Abs) */
0x95, 0x05, /* REPORT_COUNT (5) */
0x75, 0x01, /* REPORT_SIZE (1) */
0x05, 0x08, /* USAGE_PAGE (LEDs) */
0x19, 0x01, /* USAGE_MINIMUM (Num Lock) */
0x29, 0x05, /* USAGE_MAXIMUM (Kana) */
0x91, 0x02, /* OUTPUT (Data,Var,Abs) */
0x95, 0x01, /* REPORT_COUNT (1) */
0x75, 0x03, /* REPORT_SIZE (3) */
0x91, 0x03, /* OUTPUT (Cnst,Var,Abs) */
0x95, 0x06, /* REPORT_COUNT (6) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x65, /* LOGICAL_MAXIMUM (101) */
0x05, 0x07, /* USAGE_PAGE (Keyboard) */
0x19, 0x00, /* USAGE_MINIMUM (Reserved) */
0x29, 0x65, /* USAGE_MAXIMUM (Keyboard Application) */
0x81, 0x00, /* INPUT (Data,Ary,Abs) */
0xc0 /* END_COLLECTION */
}
};
I can see that the patch wasn't applied correctly due to some missing code in my android.c file.( I can't see the function hid_function_bind_config, but It's there in the patch file)
Can I just manually apply the patches?
Click to expand...
Click to collapse
Revert the patch you applied, and add this one: https://github.com/Tomoms/neon_kernel/commit/7707cc859fe788af5af9a9cba5ab2c21c66470be
It's working properly for me.

Related

Mounting HFS+ and Journaled FS for MAC

With BRD's TIAMAT kernel, I am able to mount just about any file system, except for something HFS+ formatted...
BRD, will there be some mac love in one of your new kernels??
This is the last piece to make this device optimal for me...and probably a lot of other people as well.
Any insight would be great!! Really dig your work as well!! Love my xoom!!
is hfs built into Linux tree? If not, post up the source and I'll add it in.
I found this a link but I cant post it due to site restrictions...
But it includes this
/*
* linux/fs/hfs/hfs.h
*
* Copyright (C) 1995-1997 Paul H. Hargrove
* (C) 2003 Ardis Technologies <[email protected]>
* This file may be distributed under the terms of the GNU General Public License.
*/
#ifndef _HFS_H
#define _HFS_H
/* offsets to various blocks */
#define HFS_DD_BLK 0 /* Driver Descriptor block */
#define HFS_PMAP_BLK 1 /* First block of partition map */
#define HFS_MDB_BLK 2 /* Block (w/i partition) of MDB */
/* magic numbers for various disk blocks */
#define HFS_DRVR_DESC_MAGIC 0x4552 /* "ER": driver descriptor map */
#define HFS_OLD_PMAP_MAGIC 0x5453 /* "TS": old-type partition map */
#define HFS_NEW_PMAP_MAGIC 0x504D /* "PM": new-type partition map */
#define HFS_SUPER_MAGIC 0x4244 /* "BD": HFS MDB (super block) */
#define HFS_MFS_SUPER_MAGIC 0xD2D7 /* MFS MDB (super block) */
/* various FIXED size parameters */
#define HFS_SECTOR_SIZE 512 /* size of an HFS sector */
#define HFS_SECTOR_SIZE_BITS 9 /* log_2(HFS_SECTOR_SIZE) */
#define HFS_NAMELEN 31 /* maximum length of an HFS filename */
#define HFS_MAX_NAMELEN 128
#define HFS_MAX_VALENCE 32767U
/* Meanings of the drAtrb field of the MDB,
* Reference: _Inside Macintosh: Files_ p. 2-61
*/
#define HFS_SB_ATTRIB_HLOCK (1 << 7)
#define HFS_SB_ATTRIB_UNMNT (1 << 8)
#define HFS_SB_ATTRIB_SPARED (1 << 9)
#define HFS_SB_ATTRIB_INCNSTNT (1 << 11)
#define HFS_SB_ATTRIB_SLOCK (1 << 15)
/* Some special File ID numbers */
#define HFS_POR_CNID 1 /* Parent Of the Root */
#define HFS_ROOT_CNID 2 /* ROOT directory */
#define HFS_EXT_CNID 3 /* EXTents B-tree */
#define HFS_CAT_CNID 4 /* CATalog B-tree */
#define HFS_BAD_CNID 5 /* BAD blocks file */
#define HFS_ALLOC_CNID 6 /* ALLOCation file (HFS+) */
#define HFS_START_CNID 7 /* STARTup file (HFS+) */
#define HFS_ATTR_CNID 8 /* ATTRibutes file (HFS+) */
#define HFS_EXCH_CNID 15 /* ExchangeFiles temp id */
#define HFS_FIRSTUSER_CNID 16
/* values for hfs_cat_rec.cdrType */
#define HFS_CDR_DIR 0x01 /* folder (directory) */
#define HFS_CDR_FIL 0x02 /* file */
#define HFS_CDR_THD 0x03 /* folder (directory) thread */
#define HFS_CDR_FTH 0x04 /* file thread */
/* legal values for hfs_ext_key.FkType and hfs_file.fork */
#define HFS_FK_DATA 0x00
#define HFS_FK_RSRC 0xFF
/* bits in hfs_fil_entry.Flags */
#define HFS_FIL_LOCK 0x01 /* locked */
#define HFS_FIL_THD 0x02 /* file thread */
#define HFS_FIL_DOPEN 0x04 /* data fork open */
#define HFS_FIL_ROPEN 0x08 /* resource fork open */
#define HFS_FIL_DIR 0x10 /* directory (always clear) */
#define HFS_FIL_NOCOPY 0x40 /* copy-protected file */
#define HFS_FIL_USED 0x80 /* open */
/* bits in hfs_dir_entry.Flags. dirflags is 16 bits. */
#define HFS_DIR_LOCK 0x01 /* locked */
#define HFS_DIR_THD 0x02 /* directory thread */
#define HFS_DIR_INEXPFOLDER 0x04 /* in a shared area */
#define HFS_DIR_MOUNTED 0x08 /* mounted */
#define HFS_DIR_DIR 0x10 /* directory (always set) */
#define HFS_DIR_EXPFOLDER 0x20 /* share point */
/* bits hfs_finfo.fdFlags */
#define HFS_FLG_INITED 0x0100
#define HFS_FLG_LOCKED 0x1000
#define HFS_FLG_INVISIBLE 0x4000
/*======== HFS structures as they appear on the disk ========*/
/* Pascal-style string of up to 31 characters */
struct hfs_name {
u8 len;
u8 name[HFS_NAMELEN];
} __packed;
struct hfs_point {
__be16 v;
__be16 h;
} __packed;
struct hfs_rect {
__be16 top;
__be16 left;
__be16 bottom;
__be16 right;
} __packed;
struct hfs_finfo {
__be32 fdType;
__be32 fdCreator;
__be16 fdFlags;
struct hfs_point fdLocation;
__be16 fdFldr;
} __packed;
struct hfs_fxinfo {
__be16 fdIconID;
u8 fdUnused[8];
__be16 fdComment;
__be32 fdPutAway;
} __packed;
struct hfs_dinfo {
struct hfs_rect frRect;
__be16 frFlags;
struct hfs_point frLocation;
__be16 frView;
} __packed;
struct hfs_dxinfo {
struct hfs_point frScroll;
__be32 frOpenChain;
__be16 frUnused;
__be16 frComment;
__be32 frPutAway;
} __packed;
union hfs_finder_info {
struct {
struct hfs_finfo finfo;
struct hfs_fxinfo fxinfo;
} file;
struct {
struct hfs_dinfo dinfo;
struct hfs_dxinfo dxinfo;
} dir;
} __packed;
/* Cast to a pointer to a generic bkey */
#define HFS_BKEY(X) (((void)((X)->KeyLen)), ((struct hfs_bkey *)(X)))
/* The key used in the catalog b-tree: */
struct hfs_cat_key {
u8 key_len; /* number of bytes in the key */
u8 reserved; /* padding */
__be32 ParID; /* CNID of the parent dir */
struct hfs_name CName; /* The filename of the entry */
} __packed;
/* The key used in the extents b-tree: */
struct hfs_ext_key {
u8 key_len; /* number of bytes in the key */
u8 FkType; /* HFS_FK_{DATA,RSRC} */
__be32 FNum; /* The File ID of the file */
__be16 FABN; /* allocation blocks number*/
} __packed;
typedef union hfs_btree_key {
u8 key_len; /* number of bytes in the key */
struct hfs_cat_key cat;
struct hfs_ext_key ext;
} hfs_btree_key;
#define HFS_MAX_CAT_KEYLEN (sizeof(struct hfs_cat_key) - sizeof(u8))
#define HFS_MAX_EXT_KEYLEN (sizeof(struct hfs_ext_key) - sizeof(u8))
typedef union hfs_btree_key btree_key;
struct hfs_extent {
__be16 block;
__be16 count;
};
typedef struct hfs_extent hfs_extent_rec[3];
/* The catalog record for a file */
struct hfs_cat_file {
s8 type; /* The type of entry */
u8 reserved;
u8 Flags; /* Flags such as read-only */
s8 Typ; /* file version number = 0 */
struct hfs_finfo UsrWds; /* data used by the Finder */
__be32 FlNum; /* The CNID */
__be16 StBlk; /* obsolete */
__be32 LgLen; /* The logical EOF of the data fork*/
__be32 PyLen; /* The physical EOF of the data fork */
__be16 RStBlk; /* obsolete */
__be32 RLgLen; /* The logical EOF of the rsrc fork */
__be32 RPyLen; /* The physical EOF of the rsrc fork */
__be32 CrDat; /* The creation date */
__be32 MdDat; /* The modified date */
__be32 BkDat; /* The last backup date */
struct hfs_fxinfo FndrInfo; /* more data for the Finder */
__be16 ClpSize; /* number of bytes to allocate
when extending files */
hfs_extent_rec ExtRec; /* first extent record
for the data fork */
hfs_extent_rec RExtRec; /* first extent record
for the resource fork */
u32 Resrv; /* reserved by Apple */
} __packed;
/* the catalog record for a directory */
struct hfs_cat_dir {
s8 type; /* The type of entry */
u8 reserved;
__be16 Flags; /* flags */
__be16 Val; /* Valence: number of files and
dirs in the directory */
__be32 DirID; /* The CNID */
__be32 CrDat; /* The creation date */
__be32 MdDat; /* The modification date */
__be32 BkDat; /* The last backup date */
struct hfs_dinfo UsrInfo; /* data used by the Finder */
struct hfs_dxinfo FndrInfo; /* more data used by Finder */
u8 Resrv[16]; /* reserved by Apple */
} __packed;
/* the catalog record for a thread */
struct hfs_cat_thread {
s8 type; /* The type of entry */
u8 reserved[9]; /* reserved by Apple */
__be32 ParID; /* CNID of parent directory */
struct hfs_name CName; /* The name of this entry */
} __packed;
/* A catalog tree record */
typedef union hfs_cat_rec {
s8 type; /* The type of entry */
struct hfs_cat_file file;
struct hfs_cat_dir dir;
struct hfs_cat_thread thread;
} hfs_cat_rec;
struct hfs_mdb {
__be16 drSigWord; /* Signature word indicating fs type */
__be32 drCrDate; /* fs creation date/time */
__be32 drLsMod; /* fs modification date/time */
__be16 drAtrb; /* fs attributes */
__be16 drNmFls; /* number of files in root directory */
__be16 drVBMSt; /* location (in 512-byte blocks)
of the volume bitmap */
__be16 drAllocPtr; /* location (in allocation blocks)
to begin next allocation search */
__be16 drNmAlBlks; /* number of allocation blocks */
__be32 drAlBlkSiz; /* bytes in an allocation block */
__be32 drClpSiz; /* clumpsize, the number of bytes to
allocate when extending a file */
__be16 drAlBlSt; /* location (in 512-byte blocks)
of the first allocation block */
__be32 drNxtCNID; /* CNID to assign to the next
file or directory created */
__be16 drFreeBks; /* number of free allocation blocks */
u8 drVN[28]; /* the volume label */
__be32 drVolBkUp; /* fs backup date/time */
__be16 drVSeqNum; /* backup sequence number */
__be32 drWrCnt; /* fs write count */
__be32 drXTClpSiz; /* clumpsize for the extents B-tree */
__be32 drCTClpSiz; /* clumpsize for the catalog B-tree */
__be16 drNmRtDirs; /* number of directories in
the root directory */
__be32 drFilCnt; /* number of files in the fs */
__be32 drDirCnt; /* number of directories in the fs */
u8 drFndrInfo[32]; /* data used by the Finder */
__be16 drEmbedSigWord; /* embedded volume signature */
__be32 drEmbedExtent; /* starting block number (xdrStABN)
and number of allocation blocks
(xdrNumABlks) occupied by embedded
volume */
__be32 drXTFlSize; /* bytes in the extents B-tree */
hfs_extent_rec drXTExtRec; /* extents B-tree's first 3 extents */
__be32 drCTFlSize; /* bytes in the catalog B-tree */
hfs_extent_rec drCTExtRec; /* catalog B-tree's first 3 extents */
} __packed;
/*======== Data structures kept in memory ========*/
struct hfs_readdir_data {
struct list_head list;
struct file *file;
struct hfs_cat_key key;
};
#endif
Click to expand...
Click to collapse
and this...
/*
* linux/fs/hfs/hfs_fs.h
*
* Copyright (C) 1995-1997 Paul H. Hargrove
* (C) 2003 Ardis Technologies <[email protected]>
* This file may be distributed under the terms of the GNU General Public License.
*/
#ifndef _LINUX_HFS_FS_H
#define _LINUX_HFS_FS_H
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/mutex.h>
#include <linux/buffer_head.h>
#include <linux/fs.h>
#include <asm/byteorder.h>
#include <asm/uaccess.h>
#include "hfs.h"
#define DBG_BNODE_REFS 0x00000001
#define DBG_BNODE_MOD 0x00000002
#define DBG_CAT_MOD 0x00000004
#define DBG_INODE 0x00000008
#define DBG_SUPER 0x00000010
#define DBG_EXTENT 0x00000020
#define DBG_BITMAP 0x00000040
//#define DBG_MASK (DBG_EXTENT|DBG_INODE|DBG_BNODE_MOD|DBG_CAT_MOD|DBG_BITMAP)
//#define DBG_MASK (DBG_BNODE_MOD|DBG_CAT_MOD|DBG_INODE)
//#define DBG_MASK (DBG_CAT_MOD|DBG_BNODE_REFS|DBG_INODE|DBG_EXTENT)
#define DBG_MASK (0)
#define dprint(flg, fmt, args...) \
if (flg & DBG_MASK) printk(fmt , ## args)
/*
* struct hfs_inode_info
*
* The HFS-specific part of a Linux (struct inode)
*/
struct hfs_inode_info {
atomic_t opencnt;
unsigned int flags;
/* to deal with localtime ugliness */
int tz_secondswest;
struct hfs_cat_key cat_key;
struct list_head open_dir_list;
struct inode *rsrc_inode;
struct mutex extents_lock;
u16 alloc_blocks, clump_blocks;
sector_t fs_blocks;
/* Allocation extents from catlog record or volume header */
hfs_extent_rec first_extents;
u16 first_blocks;
hfs_extent_rec cached_extents;
u16 cached_start, cached_blocks;
loff_t phys_size;
struct inode vfs_inode;
};
#define HFS_FLG_RSRC 0x0001
#define HFS_FLG_EXT_DIRTY 0x0002
#define HFS_FLG_EXT_NEW 0x0004
#define HFS_IS_RSRC(inode) (HFS_I(inode)->flags & HFS_FLG_RSRC)
/*
* struct hfs_sb_info
*
* The HFS-specific part of a Linux (struct super_block)
*/
struct hfs_sb_info {
struct buffer_head *mdb_bh; /* The hfs_buffer
holding the real
superblock (aka VIB
or MDB) */
struct hfs_mdb *mdb;
struct buffer_head *alt_mdb_bh; /* The hfs_buffer holding
the alternate superblock */
struct hfs_mdb *alt_mdb;
__be32 *bitmap; /* The page holding the
allocation bitmap */
struct hfs_btree *ext_tree; /* Information about
the extents b-tree */
struct hfs_btree *cat_tree; /* Information about
the catalog b-tree */
u32 file_count; /* The number of
regular files in
the filesystem */
u32 folder_count; /* The number of
directories in the
filesystem */
u32 next_id; /* The next available
file id number */
u32 clumpablks; /* The number of allocation
blocks to try to add when
extending a file */
u32 fs_start; /* The first 512-byte
block represented
in the bitmap */
u32 part_start;
u16 root_files; /* The number of
regular
(non-directory)
files in the root
directory */
u16 root_dirs; /* The number of
directories in the
root directory */
u16 fs_ablocks; /* The number of
allocation blocks
in the filesystem */
u16 free_ablocks; /* the number of unused
allocation blocks
in the filesystem */
u32 alloc_blksz; /* The size of an
"allocation block" */
int s_quiet; /* Silent failure when
changing owner or mode? */
__be32 s_type; /* Type for new files */
__be32 s_creator; /* Creator for new files */
umode_t s_file_umask; /* The umask applied to the
permissions on all files */
umode_t s_dir_umask; /* The umask applied to the
permissions on all dirs */
uid_t s_uid; /* The uid of all files */
gid_t s_gid; /* The gid of all files */
int session, part;
struct nls_table *nls_io, *nls_disk;
struct mutex bitmap_lock;
unsigned long flags;
u16 blockoffset;
int fs_div;
};
#define HFS_FLG_BITMAP_DIRTY 0
#define HFS_FLG_MDB_DIRTY 1
#define HFS_FLG_ALT_MDB_DIRTY 2
/* bitmap.c */
extern u32 hfs_vbm_search_free(struct super_block *, u32, u32 *);
extern int hfs_clear_vbm_bits(struct super_block *, u16, u16);
/* catalog.c */
extern int hfs_cat_keycmp(const btree_key *, const btree_key *);
struct hfs_find_data;
extern int hfs_cat_find_brec(struct super_block *, u32, struct hfs_find_data *);
extern int hfs_cat_create(u32, struct inode *, struct qstr *, struct inode *);
extern int hfs_cat_delete(u32, struct inode *, struct qstr *);
extern int hfs_cat_move(u32, struct inode *, struct qstr *,
struct inode *, struct qstr *);
extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *);
/* dir.c */
extern const struct file_operations hfs_dir_operations;
extern const struct inode_operations hfs_dir_inode_operations;
/* extent.c */
extern int hfs_ext_keycmp(const btree_key *, const btree_key *);
extern int hfs_free_fork(struct super_block *, struct hfs_cat_file *, int);
extern void hfs_ext_write_extent(struct inode *);
extern int hfs_extend_file(struct inode *);
extern void hfs_file_truncate(struct inode *);
extern int hfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
/* inode.c */
extern const struct address_space_operations hfs_aops;
extern const struct address_space_operations hfs_btree_aops;
extern struct inode *hfs_new_inode(struct inode *, struct qstr *, int);
extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *);
extern int hfs_write_inode(struct inode *, struct writeback_control *);
extern int hfs_inode_setattr(struct dentry *, struct iattr *);
extern void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext,
__be32 log_size, __be32 phys_size, u32 clump_size);
extern struct inode *hfs_iget(struct super_block *, struct hfs_cat_key *, hfs_cat_rec *);
extern void hfs_evict_inode(struct inode *);
extern void hfs_delete_inode(struct inode *);
/* attr.c */
extern int hfs_setxattr(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags);
extern ssize_t hfs_getxattr(struct dentry *dentry, const char *name,
void *value, size_t size);
extern ssize_t hfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
/* mdb.c */
extern int hfs_mdb_get(struct super_block *);
extern void hfs_mdb_commit(struct super_block *);
extern void hfs_mdb_close(struct super_block *);
extern void hfs_mdb_put(struct super_block *);
/* part_tbl.c */
extern int hfs_part_find(struct super_block *, sector_t *, sector_t *);
/* string.c */
extern const struct dentry_operations hfs_dentry_operations;
extern int hfs_hash_dentry(const struct dentry *, const struct inode *,
struct qstr *);
extern int hfs_strcmp(const unsigned char *, unsigned int,
const unsigned char *, unsigned int);
extern int hfs_compare_dentry(const struct dentry *parent,
const struct inode *pinode,
const struct dentry *dentry, const struct inode *inode,
unsigned int len, const char *str, const struct qstr *name);
/* trans.c */
extern void hfs_asc2mac(struct super_block *, struct hfs_name *, struct qstr *);
extern int hfs_mac2asc(struct super_block *, char *, const struct hfs_name *);
extern struct timezone sys_tz;
/*
* There are two time systems. Both are based on seconds since
* a particular time/date.
* Unix: unsigned lil-endian since 00:00 GMT, Jan. 1, 1970
* mac: unsigned big-endian since 00:00 GMT, Jan. 1, 1904
*
*/
#define __hfs_u_to_mtime(sec) cpu_to_be32(sec + 2082844800U - sys_tz.tz_minuteswest * 60)
#define __hfs_m_to_utime(sec) (be32_to_cpu(sec) - 2082844800U + sys_tz.tz_minuteswest * 60)
#define HFS_I(inode) (list_entry(inode, struct hfs_inode_info, vfs_inode))
#define HFS_SB(sb) ((struct hfs_sb_info *)(sb)->s_fs_info)
#define hfs_m_to_utime(time) (struct timespec){ .tv_sec = __hfs_m_to_utime(time) }
#define hfs_u_to_mtime(time) __hfs_u_to_mtime((time).tv_sec)
#define hfs_mtime() __hfs_u_to_mtime(get_seconds())
static inline const char *hfs_mdb_name(struct super_block *sb)
{
return sb->s_id;
}
static inline void hfs_bitmap_dirty(struct super_block *sb)
{
set_bit(HFS_FLG_BITMAP_DIRTY, &HFS_SB(sb)->flags);
sb->s_dirt = 1;
}
#define sb_bread512(sb, sec, data) ({ \
struct buffer_head *__bh; \
sector_t __block; \
loff_t __start; \
int __offset; \
\
__start = (loff_t)(sec) << HFS_SECTOR_SIZE_BITS;\
__block = __start >> (sb)->s_blocksize_bits; \
__offset = __start & ((sb)->s_blocksize - 1); \
__bh = sb_bread((sb), __block); \
if (likely(__bh != NULL)) \
data = (void *)(__bh->b_data + __offset);\
else \
data = NULL; \
__bh; \
})
#endif
Click to expand...
Click to collapse
Not sure if thats what your looking for...I really appreciate the help!
BRD,
I know you're working on the new kernel...I was just wondering if you had any further thoughts on this?
I'm not sure if what I posted is even what you need to accomplish this ...
Thanks!
Sent from my Xoom using Tapatalk
mradlauer said:
BRD,
I know you're working on the new kernel...I was just wondering if you had any further thoughts on this?
I'm not sure if what I posted is even what you need to accomplish this ...
Thanks!
Sent from my Xoom using Tapatalk
Click to expand...
Click to collapse
OK. That should point me in the right direction. Ill see what I can whip up
Your awesome! Thanks a bunch and if you need a beta tester for it, let me know...
I'm sure this will be welcome to a lot of folks out there with a mac.
BRD,
I have loaded your new kernel and everything looks to be pretty smooth now.
A quick question about mounting HFS/HFSPlus...
I know you have to disable journaling on the disk to make it RW...I am curious as to how to mount hfs tho...When I plug in a drive, it shows up in USB_OTG with 200mb avail....
I'm thinking that we'll need an app similar to that of the NTFS mount tool...Which works perfecty...
Any thoughts? Or should I just app request something like the NTFS mount tool?
Thanks again! Your work is greatly appreciated!

[Q] Compiling gcc and toolchain for use ON android device

Hello all. I have built the android-ndk-r9d toolchain on my Ubuntu machine, and it will compile a few things like nmap and perl just fine with some tweaking (I forgot the links but there are projects that give the options to use when compiling these). But I haven't seen any successful compilations of more recent versions of gcc with bionic.
I did some digging around in spartacus' terminal-ide project, the point of which is to have java, vim, gcc for use on the device itself, I found that gcc was version 4.4.0. I have tried to reach him via email to see what ./configure settings he used, but to no response.
Has anyone else attempted this, to build android gcc in versions more recent than 4.4.0 for compiling software on the device? What configure settings have you tried, and how much have you modified the gcc source code itself? Or is everyone content to build other projects using their regular Linux box?
My device in question is a nexus 5, which has more than enough CPU power to do this, to quell any concerns people will have to that end.
Well, I had a day free yesterday and tried everything again, and I believe I hit the same stopping point error after correcting several others. Only this time, I made an actual script and patchfiles to handle everything to make this more organized. Again has anyone attempted to do this?
First, the script.
Code:
#!/bin/bash
HOME_DIR=/home/jmanley
GCC_BUILD_DIR=$HOME_DIR/gcc-android-build
HOST=arm-linux-androideabi
CFLAGS='-Wall -O -mandroid -mbionic'
LIBCFLAGS='-O2 -mandroid -mbionic'
LIBCPPFLAGS='-O2 -mandroid -mbionic'
LIBCXXFLAGS='-O2 -mandroid -mbionic -fno-implicit-templates'
PREFIX=/data
TOOLCHAIN_DIR=$HOME_DIR/arm-linux-androideabi-4.8
SYSROOT=$TOOLCHAIN_DIR/sysroot
GCC_VERSION=4.9.0
MPFR_VERSION=3.1.2
GMP_VERSION=6.0.0a
RENAMED_GMP_VERSION=6.0.0
MPC_VERSION=1.0.2
LDFLAGS='-lc -ldl -lgcc -lm -static'
LIBS='-lc -ldl -lgcc -lm -lsupc++ -lgnustl_shared -lgmp'
CC=arm-linux-androideabi-gcc
CXX=arm-linux-androideabi-g++
LD=arm-linux-androideabi-ld
RANLIB=arm-linux-androideabi-ranlib
AR=arm-linux-androideabi-ar
STRIP=arm-linux-androideabi-strip
PATH=$TOOLCHAIN_DIR/bin:$PATH
cd $HOME_DIR
mkdir $GCC_BUILD_DIR
tar -jxf gcc-$GCC_VERSION.tar.bz2
cd $HOME_DIR/gcc-$GCC_VERSION
tar -jxf ../gmp-$GMP_VERSION.tar.bz2
mv gmp-$RENAMED_GMP_VERSION gmp
tar -jxf ../mpfr-$MPFR_VERSION.tar.bz2
mv mpfr-$MPFR_VERSION mpfr
tar -zxf ../mpc-$MPC_VERSION.tar.gz
mv mpc-$MPC_VERSION mpc
patch -Np0 -i $HOME_DIR/getpagesize-gcc.patch
patch -Np0 -i $HOME_DIR/mpfr-impl.patch
patch -Np0 -i $HOME_DIR/libcpp-files.patch
patch -Np0 -i $HOME_DIR/libcpp-macro.patch
cd $GCC_BUILD_DIR
../gcc-$GCC_VERSION/configure \
--prefix=$PREFIX --host=$HOST --disable-option-checking --disable-ld \
--enable-shared --enable-languages=c \
--disable-bootstrap -disable-gold --disable-fortran --disable-libssp \
--disable-libquadmath --disable-libquadmath-support --disable-libada \
--disable-multilib --disable-libgomp --disable-cloog --disable-werror \
--with-sysroot=$SYSROOT --disable-nls --disable-long-long
make
sudo make install
Second, the actual error in question.
Code:
../../../gcc-4.9.0/gmp/mpz/powm_ui.c:162: error: undefined reference to '__gmpn_invert_limb'
divrem_1.c:228: error: undefined reference to '__gmpn_invert_limb'
divrem_1.c:149: error: undefined reference to '__gmpn_invert_limb'
divrem_2.c:91: error: undefined reference to '__gmpn_invert_limb'
collect2: error: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/home/jmanley/gcc-android-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/jmanley/gcc-android-build'
make: *** [all] Error 2
Now, some of the patchfiles I made to fix previous errors. Is any of this recommended?
Code:
*** libiberty/getpagesize.c 2005-03-27 07:31:13.000000000 -0800
--- getpagesize.c 2014-07-13 14:59:40.270231633 -0700
***************
*** 60,71 ****
# endif /* PAGESIZE */
#endif /* GNU_OUR_PAGESIZE */
- int
- getpagesize (void)
- {
- return (GNU_OUR_PAGESIZE);
- }
-
#else /* VMS */
#if 0 /* older distributions of gcc-vms are missing <syidef.h> */
--- 60,65 ----
Code:
*** libcpp/files.c 2014-01-02 14:24:45.000000000 -0800
--- files.c 2014-07-13 19:09:23.685783988 -0700
***************
*** 716,726 ****
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
! &file->st.st_size);
file->buffer_valid = true;
return true;
--- 716,728 ----
cpp_error (pfile, CPP_DL_WARNING,
"%s is shorter than expected", file->path);
+ off_t ot = (off_t) file->st.st_size;
file->buffer = _cpp_convert_input (pfile,
CPP_OPTION (pfile, input_charset),
buf, size + 16, total,
&file->buffer_start,
! &ot);
! file->st.st_size = ot;
file->buffer_valid = true;
return true;
Code:
*** libcpp/macro.c 2014-02-18 22:05:55.000000000 -0800
--- macro.c 2014-07-13 19:55:27.751477291 -0700
***************
*** 250,256 ****
struct tm *tb = NULL;
struct stat *st = _cpp_get_file_stat (file);
if (st)
! tb = localtime (&st->st_mtime);
if (tb)
{
char *str = asctime (tb);
--- 250,260 ----
struct tm *tb = NULL;
struct stat *st = _cpp_get_file_stat (file);
if (st)
! {
! time_t tt = (time_t) st->st_mtime;
! tb = localtime (&tt);
! st->st_mtime = tt;
! }
if (tb)
{
char *str = asctime (tb);
Code:
*** mpfr/src/mpfr-impl.h 2013-03-13 08:37:36.000000000 -0700
--- mpfr-impl.h 2014-07-13 18:44:36.599599742 -0700
***************
*** 1135,1142 ****
#include <locale.h>
/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
be negative (the ISO C99 does not seem to forbid negative values). */
! #define MPFR_DECIMAL_POINT (localeconv()->decimal_point[0])
! #define MPFR_THOUSANDS_SEPARATOR (localeconv()->thousands_sep[0])
#else
#define MPFR_DECIMAL_POINT ((char) '.')
#define MPFR_THOUSANDS_SEPARATOR ('\0')
--- 1135,1142 ----
#include <locale.h>
/* Warning! In case of signed char, the value of MPFR_DECIMAL_POINT may
be negative (the ISO C99 does not seem to forbid negative values). */
! #define MPFR_DECIMAL_POINT ((char) '.')
! #define MPFR_THOUSANDS_SEPARATOR ('\0')
#else
#define MPFR_DECIMAL_POINT ((char) '.')
#define MPFR_THOUSANDS_SEPARATOR ('\0')

[Xperia E][C1505] Error compile kernel. Help

I'm trying compile My own kernel but always show error
Code:
[email protected]:~/Desktop/kernel_jb/kernel$ export ARCH=arm
[email protected]:~/Desktop/kernel_jb/kernel$ export CROSS_COMPILE=/home/jbliz/Desktop/kernel_jb/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
[email protected]:~/Desktop/kernel_jb/kernel$ make -j2
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --silentoldconfig Kconfig
warning: (SCSI_SRP) selects SCSI_TGT which has unmet direct dependencies (SCSI && EXPERIMENTAL)
warning: (DRM && ION) selects DMA_SHARED_BUFFER which has unmet direct dependencies (EXPERIMENTAL)
warning: (USB_DWC3) selects USB_XHCI_PLATFORM which has unmet direct dependencies (USB_SUPPORT && USB_XHCI_HCD)
warning: (SCSI_SRP) selects SCSI_TGT which has unmet direct dependencies (SCSI && EXPERIMENTAL)
warning: (DRM && ION) selects DMA_SHARED_BUFFER which has unmet direct dependencies (EXPERIMENTAL)
warning: (USB_DWC3) selects USB_XHCI_PLATFORM which has unmet direct dependencies (USB_SUPPORT && USB_XHCI_HCD)
CHK include/linux/version.h
CHK include/generated/utsrelease.h
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/genksyms/lex.lex.o
HOSTCC scripts/genksyms/parse.tab.o
HOSTLD scripts/genksyms/genksyms
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/mod/modpost.o
HOSTCC scripts/mod/sumversion.o
HOSTCC scripts/kallsyms
HOSTLD scripts/mod/modpost
make[1]: `include/generated/mach-types.h' is up to date.
HOSTCC scripts/conmakehash
CC kernel/bounds.s
GEN include/generated/bounds.h
CC arch/arm/kernel/asm-offsets.s
In file included from include/linux/spinlock.h:50:0,
from include/linux/seqlock.h:29,
from include/linux/time.h:8,
from include/linux/timex.h:56,
from include/linux/sched.h:57,
from arch/arm/kernel/asm-offsets.c:13:
include/linux/preempt.h:110:0: warning: "inc_preempt_count" redefined [enabled by default]
error, forbidden warning: preempt.h:110
make[1]: *** [arch/arm/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
[email protected]:~/Desktop/kernel_jb/kernel$
preempt.h
Code:
#ifndef __LINUX_PREEMPT_H
#define __LINUX_PREEMPT_H
/*
* include/linux/preempt.h - macros for accessing and manipulating
* preempt_count (used for kernel preemption, interrupt count, etc.)
*/
#include <linux/thread_info.h>
#include <linux/linkage.h>
#include <linux/list.h>
#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER)
extern void add_preempt_count(int val);
extern void sub_preempt_count(int val);
#else
# define add_preempt_count(val) do { preempt_count() += (val); } while (0)
# define sub_preempt_count(val) do { preempt_count() -= (val); } while (0)
#endif
#define inc_preempt_count() add_preempt_count(1)
#define dec_preempt_count() sub_preempt_count(1)
#define preempt_count() (current_thread_info()->preempt_count)
#ifdef CONFIG_PREEMPT
asmlinkage void preempt_schedule(void);
#define preempt_check_resched() \
do { \
if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
preempt_schedule(); \
} while (0)
#else /* !CONFIG_PREEMPT */
#define preempt_check_resched() do { } while (0)
#endif /* CONFIG_PREEMPT */
#ifdef CONFIG_PREEMPT_COUNT
#define preempt_disable() \
do { \
inc_preempt_count(); \
barrier(); \
} while (0)
#define sched_preempt_enable_no_resched() \
do { \
barrier(); \
dec_preempt_count(); \
} while (0)
#define preempt_enable_no_resched() sched_preempt_enable_no_resched()
#define preempt_enable() \
do { \
preempt_enable_no_resched(); \
barrier(); \
preempt_check_resched(); \
} while (0)
/* For debugging and tracer internals only! */
#define add_preempt_count_notrace(val) \
do { preempt_count() += (val); } while (0)
#define sub_preempt_count_notrace(val) \
do { preempt_count() -= (val); } while (0)
#define inc_preempt_count_notrace() add_preempt_count_notrace(1)
#define dec_preempt_count_notrace() sub_preempt_count_notrace(1)
#define preempt_disable_notrace() \
do { \
inc_preempt_count_notrace(); \
barrier(); \
} while (0)
#define preempt_enable_no_resched_notrace() \
do { \
barrier(); \
dec_preempt_count_notrace(); \
} while (0)
/* preempt_check_resched is OK to trace */
#define preempt_enable_notrace() \
do { \
preempt_enable_no_resched_notrace(); \
barrier(); \
preempt_check_resched(); \
} while (0)
#else /* !CONFIG_PREEMPT_COUNT */
#define preempt_disable() do { } while (0)
#define sched_preempt_enable_no_resched() do { } while (0)
#define preempt_enable_no_resched() do { } while (0)
#define preempt_enable() do { } while (0)
#define preempt_disable_notrace() do { } while (0)
#define preempt_enable_no_resched_notrace() do { } while (0)
#define preempt_enable_notrace() do { } while (0)
//20130122-JordanChen
#define add_preempt_count_notrace(val) do { } while (0)
#define sub_preempt_count_notrace(val) do { } while (0)
#define inc_preempt_count_notrace() do { } while (0)
#define dec_preempt_count_notrace() do { } while (0)
#define inc_preempt_count() do { } while (0)
#define dec_preempt_count() do { } while (0)
//20130122-JordanChen
#endif /* CONFIG_PREEMPT_COUNT */
#ifdef CONFIG_PREEMPT_NOTIFIERS
struct preempt_notifier;
/**
* preempt_ops - notifiers called when a task is preempted and rescheduled
* @sched_in: we're about to be rescheduled:
* notifier: struct preempt_notifier for the task being scheduled
* cpu: cpu we're scheduled on
* @sched_out: we've just been preempted
* notifier: struct preempt_notifier for the task being preempted
* next: the task that's kicking us out
*
* Please note that sched_in and out are called under different
* contexts. sched_out is called with rq lock held and irq disabled
* while sched_in is called without rq lock and irq enabled. This
* difference is intentional and depended upon by its users.
*/
struct preempt_ops {
void (*sched_in)(struct preempt_notifier *notifier, int cpu);
void (*sched_out)(struct preempt_notifier *notifier,
struct task_struct *next);
};
/**
* preempt_notifier - key for installing preemption notifiers
* @link: internal use
* @ops: defines the notifier functions to be called
*
* Usually used in conjunction with container_of().
*/
struct preempt_notifier {
struct hlist_node link;
struct preempt_ops *ops;
};
void preempt_notifier_register(struct preempt_notifier *notifier);
void preempt_notifier_unregister(struct preempt_notifier *notifier);
static inline void preempt_notifier_init(struct preempt_notifier *notifier,
struct preempt_ops *ops)
{
INIT_HLIST_NODE(&notifier->link);
notifier->ops = ops;
}
#endif
#endif /* __LINUX_PREEMPT_H */
Toolchains by DooMLoRD
Code:
/home/jbliz/Desktop/kernel_jb/toolchains/arm-2009q3/
/home/jbliz/Desktop/kernel_jb/toolchains/arm-2010.09/
/home/jbliz/Desktop/kernel_jb/toolchains/arm-2011.03/
/home/jbliz/Desktop/kernel_jb/toolchains/arm-2011.09/
/home/jbliz/Desktop/kernel_jb/toolchains/arm-eabi-4.4.3/
/home/jbliz/Desktop/kernel_jb/toolchains/arm-eabi-linaro-4.6.2/

[HELP] weird errors with compiling kernel for s3ve3g

So, I decided I want to put Kali-Linux on my samsung s3 neo device, and I succeeded after hard work and a lots of research... Now I had another problem, that my built-in chipset does not support aircrack-ng, so i decided to work around it, and use a wireless usb adapter.
what i did is modifying the kernel, to be able to support some of the wireless devices... the point where i got stuck is at compiling the new-made kernel... basically i followed the following guide:
PHP:
http://forum.xda-developers.com/showthread.php?t=2338179
and i got stuck at the final section of the compiling segment...
So here is my error.
arch/arm/crypto/sha512_neon_glue.c: In function 'sha512_neon_update':
arch/arm/crypto/sha512_neon_glue.c:144:3: warning: implicit declaration of function 'crypto_sha512_update' [-Wimplicit-function-declaration]
error, forbidden warning: sha512_neon_glue.c:144
scripts/Makefile.build:307: recipe for target 'arch/arm/crypto/sha512_neon_glue.o' failed
make[1]: *** [arch/arm/crypto/sha512_neon_glue.o] Error 1
Makefile:950: recipe for target 'arch/arm/crypto' failed
make: *** [arch/arm/crypto] Error 2
Click to expand...
Click to collapse
so, first of all I have a question, where exactly do i put "KCONFIG_CFLAGS += -w" in the code of the Makefile, and if it would solve the error? according to the guide it should ignore errors that the compiler makes.
2nd question right under the code lines.
Makefile:
PHP:
https://github.com/CyanogenMod/android_kernel_samsung_s3ve3g/blob/cm-12.1/Makefile
Couldn't post it here, too long.
Second question, in case the first solution would not work, if i wanted to edit the problematic file, so it would see the declared functions, how do i do that?
NOTE: the error is in line 144
(will be marked with "------->")
Code:
*
* Glue code for the SHA512 Secure Hash Algorithm assembly implementation
* using NEON instructions.
*
* Copyright © 2014 Jussi Kivilinna <[email protected]>
*
* This file is based on sha512_ssse3_glue.c:
* Copyright (C) 2013 Intel Corporation
* Author: Tim Chen <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
*/
#include <crypto/internal/hash.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/cryptohash.h>
#include <linux/types.h>
#include <linux/string.h>
#include <crypto/sha.h>
#include <asm/byteorder.h>
#include <asm/simd.h>
#include <asm/neon.h>
static const u64 sha512_k[] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL,
0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL,
0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL,
0xd807aa98a3030242ULL, 0x12835b0145706fbeULL,
0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL,
0x9bdc06a725c71235ULL, 0xc19bf174cf692694ULL,
0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL,
0x2de92c6f592b0275ULL, 0x4a7484aa6ea6e483ULL,
0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL,
0xb00327c898fb213fULL, 0xbf597fc7beef0ee4ULL,
0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
0x06ca6351e003826fULL, 0x142929670a0e6e70ULL,
0x27b70a8546d22ffcULL, 0x2e1b21385c26c926ULL,
0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL,
0x81c2c92e47edaee6ULL, 0x92722c851482353bULL,
0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL,
0xd192e819d6ef5218ULL, 0xd69906245565a910ULL,
0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL,
0x2748774cdf8eeb99ULL, 0x34b0bcb5e19b48a8ULL,
0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL,
0x748f82ee5defb2fcULL, 0x78a5636f43172f60ULL,
0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL,
0xbef9a3f7b2c67915ULL, 0xc67178f2e372532bULL,
0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL,
0x06f067aa72176fbaULL, 0x0a637dc5a2c898a6ULL,
0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
0x28db77f523047d84ULL, 0x32caab7b40c72493ULL,
0x3c9ebe0a15c9bebcULL, 0x431d67c49c100d4cULL,
0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL
};
asmlinkage void sha512_transform_neon(u64 *digest, const void *data,
const u64 k[], unsigned int num_blks);
static int sha512_neon_init(struct shash_desc *desc)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
sctx->state[0] = SHA512_H0;
sctx->state[1] = SHA512_H1;
sctx->state[2] = SHA512_H2;
sctx->state[3] = SHA512_H3;
sctx->state[4] = SHA512_H4;
sctx->state[5] = SHA512_H5;
sctx->state[6] = SHA512_H6;
sctx->state[7] = SHA512_H7;
sctx->count[0] = sctx->count[1] = 0;
return 0;
}
static int __sha512_neon_update(struct shash_desc *desc, const u8 *data,
unsigned int len, unsigned int partial)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
unsigned int done = 0;
sctx->count[0] += len;
if (sctx->count[0] < len)
sctx->count[1]++;
if (partial) {
done = SHA512_BLOCK_SIZE - partial;
memcpy(sctx->buf + partial, data, done);
sha512_transform_neon(sctx->state, sctx->buf, sha512_k, 1);
}
if (len - done >= SHA512_BLOCK_SIZE) {
const unsigned int rounds = (len - done) / SHA512_BLOCK_SIZE;
sha512_transform_neon(sctx->state, data + done, sha512_k,
rounds);
done += rounds * SHA512_BLOCK_SIZE;
}
memcpy(sctx->buf, data + done, len - done);
return 0;
}
static int sha512_neon_update(struct shash_desc *desc, const u8 *data,
unsigned int len)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
unsigned int partial = sctx->count[0] % SHA512_BLOCK_SIZE;
int res;
/* Handle the fast case right here */
if (partial + len < SHA512_BLOCK_SIZE) {
sctx->count[0] += len;
if (sctx->count[0] < len)
sctx->count[1]++;
memcpy(sctx->buf + partial, data, len);
return 0;
}
if (!may_use_simd()) {
------------> res = crypto_sha512_update(desc, data, len);
} else {
kernel_neon_begin();
res = __sha512_neon_update(desc, data, len, partial);
kernel_neon_end();
}
return res;
}
/* Add padding and return the message digest. */
static int sha512_neon_final(struct shash_desc *desc, u8 *out)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
unsigned int i, index, padlen;
__be64 *dst = (__be64 *)out;
__be64 bits[2];
static const u8 padding[SHA512_BLOCK_SIZE] = { 0x80, };
/* save number of bits */
bits[1] = cpu_to_be64(sctx->count[0] << 3);
bits[0] = cpu_to_be64(sctx->count[1] << 3 | sctx->count[0] >> 61);
/* Pad out to 112 mod 128 and append length */
index = sctx->count[0] & 0x7f;
padlen = (index < 112) ? (112 - index) : ((128+112) - index);
if (!may_use_simd()) {
crypto_sha512_update(desc, padding, padlen);
crypto_sha512_update(desc, (const u8 *)&bits, sizeof(bits));
} else {
kernel_neon_begin();
/* We need to fill a whole block for __sha512_neon_update() */
if (padlen <= 112) {
sctx->count[0] += padlen;
if (sctx->count[0] < padlen)
sctx->count[1]++;
memcpy(sctx->buf + index, padding, padlen);
} else {
__sha512_neon_update(desc, padding, padlen, index);
}
__sha512_neon_update(desc, (const u8 *)&bits,
sizeof(bits), 112);
kernel_neon_end();
}
/* Store state in digest */
for (i = 0; i < 8; i++)
dst[i] = cpu_to_be64(sctx->state[i]);
/* Wipe context */
memset(sctx, 0, sizeof(*sctx));
return 0;
}
static int sha512_neon_export(struct shash_desc *desc, void *out)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
memcpy(out, sctx, sizeof(*sctx));
return 0;
}
static int sha512_neon_import(struct shash_desc *desc, const void *in)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
memcpy(sctx, in, sizeof(*sctx));
return 0;
}
static int sha384_neon_init(struct shash_desc *desc)
{
struct sha512_state *sctx = shash_desc_ctx(desc);
sctx->state[0] = SHA384_H0;
sctx->state[1] = SHA384_H1;
sctx->state[2] = SHA384_H2;
sctx->state[3] = SHA384_H3;
sctx->state[4] = SHA384_H4;
sctx->state[5] = SHA384_H5;
sctx->state[6] = SHA384_H6;
sctx->state[7] = SHA384_H7;
sctx->count[0] = sctx->count[1] = 0;
return 0;
}
static int sha384_neon_final(struct shash_desc *desc, u8 *hash)
{
u8 D[SHA512_DIGEST_SIZE];
sha512_neon_final(desc, D);
memcpy(hash, D, SHA384_DIGEST_SIZE);
memset(D, 0, SHA512_DIGEST_SIZE);
return 0;
}
static struct shash_alg algs[] = { {
.digestsize = SHA512_DIGEST_SIZE,
.init = sha512_neon_init,
.update = sha512_neon_update,
.final = sha512_neon_final,
.export = sha512_neon_export,
.import = sha512_neon_import,
.descsize = sizeof(struct sha512_state),
.statesize = sizeof(struct sha512_state),
.base = {
.cra_name = "sha512",
.cra_driver_name = "sha512-neon",
.cra_priority = 250,
.cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = SHA512_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
}, {
.digestsize = SHA384_DIGEST_SIZE,
.init = sha384_neon_init,
.update = sha512_neon_update,
.final = sha384_neon_final,
.export = sha512_neon_export,
.import = sha512_neon_import,
.descsize = sizeof(struct sha512_state),
.statesize = sizeof(struct sha512_state),
.base = {
.cra_name = "sha384",
.cra_driver_name = "sha384-neon",
.cra_priority = 250,
.cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = SHA384_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
} };
static int __init sha512_neon_mod_init(void)
{
if (!cpu_has_neon())
return -ENODEV;
return crypto_register_shashes(algs, ARRAY_SIZE(algs));
}
static void __exit sha512_neon_mod_fini(void)
{
crypto_unregister_shashes(algs, ARRAY_SIZE(algs));
}
module_init(sha512_neon_mod_init);
module_exit(sha512_neon_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SHA512 Secure Hash Algorithm, NEON accelerated");
MODULE_ALIAS("sha512");
MODULE_ALIAS("sha384");
Please help me I will be very thankful.
(NOTE: I am not a developer, and I wish I was, or at least i'm ought to be so please explain carefully your solutions since I'm not familiar with any coding language, and for me, reaching this stage of the kernel compiling was time consuming and my only tools were my logic and the internet). thanks in advance for any help i can get i wish it will work so i can move on in learning kali better!

Error while compiling Kernel from source (Mediatek)

So I was compiling kernel for my Meizu m2 note and I encountered this error :
Code:
In file included from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/io.h:243:0,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/clocksource.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/clocksource/arm_arch_timer.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/arch_timer.h:27,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/timex.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timex.h:65,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/jiffies.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/ktime.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timer.h:5,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/workqueue.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/pm.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/device.h:25,
from drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:11:
/home/suvam/RRMM/kernel/meizu/m2note/include/asm-generic/iomap.h:31:21: note: expected 'void *' but argument is of type 'long unsigned int'
extern unsigned int ioread32(void __iomem *);
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:99:26: warning: passing argument 1 of 'ioread32' makes pointer from integer without a cast
#define ISP_RD32(addr) ioread32(addr)
^
/home/suvam/RRMM/kernel/meizu/m2note/include/linux/printk.h:248:38: note: in expansion of macro 'ISP_RD32'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:87:37: note: in expansion of macro 'pr_debug'
#define LOG_DBG(format, args...) pr_debug(MyTag format, ##args)
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:10828:3: note: in expansion of macro 'LOG_DBG'
LOG_DBG("0x%08X %08X", (unsigned int)(ISP_TPIPE_ADDR + 0x00a8), (unsigned int)ISP_RD32(ISP_ADDR + 0x00a8));
^
In file included from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/io.h:243:0,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/clocksource.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/clocksource/arm_arch_timer.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/arch_timer.h:27,
from /home/suvam/RRMM/kernel/meizu/m2note/arch/arm64/include/asm/timex.h:19,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timex.h:65,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/jiffies.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/ktime.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/timer.h:5,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/workqueue.h:8,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/pm.h:25,
from /home/suvam/RRMM/kernel/meizu/m2note/include/linux/device.h:25,
from drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:11:
/home/suvam/RRMM/kernel/meizu/m2note/include/asm-generic/iomap.h:31:21: note: expected 'void *' but argument is of type 'long unsigned int'
extern unsigned int ioread32(void __iomem *);
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: At top level:
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:175:22: warning: 'g_isp_base_dase' defined but not used [-Wunused-variable]
static void __iomem *g_isp_base_dase;
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:176:22: warning: 'g_isp_inner_base_dase' defined but not used [-Wunused-variable]
static void __iomem *g_isp_inner_base_dase;
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:177:22: warning: 'g_imgsys_config_base_dase' defined but not used [-Wunused-variable]
static void __iomem *g_imgsys_config_base_dase;
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: In function 'compat_put_isp_read_register_data':
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:8407:6: warning: 'err' is used uninitialized in this function [-Wuninitialized]
err |= get_user(count, &data->Count);
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: In function 'ISP_DONE_Buf_Time.isra.4':
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:5522:49: warning: 'out' may be used uninitialized in this function [-Wmaybe-uninitialized]
pstRTBuf->ring_buf[i_dma].img_cnt = sof_count[out];
^
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c: In function 'ISP_Buf_CTRL_FUNC':
drivers/misc/mediatek/mach/mt6735/camera_isp_D1.c:4447:34: warning: 'out' may be used uninitialized in this function [-Wmaybe-uninitialized]
deque_buf.sof_cnt = sof_count[out];
^
LD drivers/misc/mediatek/mach/mt6735/built-in.o
LD drivers/misc/mediatek/mach/built-in.o
make[4]: *** [drivers/misc/mediatek] Error 2
make[3]: *** [drivers/misc] Error 2
make[2]: *** [drivers] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/suvam/RRMM/kernel/meizu/m2note'
make: *** [TARGET_KERNEL_BINARIES] Error 2
#### make failed to build some targets (09:32 (mm:ss)) ####
Can somebody please help me out ?

Categories

Resources