Related
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!
Hi, I am trying to recompile the screencap executable to tweak the code for my needs.
Unfortunetaly, I get some compilation error when i compile the code
I am compiling with ndk-build from android-ndk-r9
Here is the log:
[email protected]:~/Development/Hello_Screencap-2$ /home/lafd/Development/android-ndk-r9/ndk-build
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile++ thumb : Hello-Sreencap-2 <= Hello_Screencap-2.cpp
Executable : Hello-Sreencap-2
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:36: error: undefined reference to 'android::ScreenshotClient::ScreenshotClient()'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:41: error: undefined reference to 'android::SurfaceComposerClient::getBuiltInDisplay(int)'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:41: error: undefined reference to 'android::ScreenshotClient::update(android::sp<android::IBinder> const&)'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/utils/StrongPointer.h:149: error: undefined reference to 'android::RefBase::decStrong(void const*) const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:44: error: undefined reference to 'android::ScreenshotClient::getWidth() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:45: error: undefined reference to 'android::ScreenshotClient::getHeight() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:46: error: undefined reference to 'android::ScreenshotClient::getFormat() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:47: error: undefined reference to 'android::ScreenshotClient::getSize() const'
/home/lafd/Development/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/Hello-Sreencap-2/Hello_Screencap-2.o: in function main:jni/Hello_Screencap-2.cpp:54: error: undefined reference to 'android::ScreenshotClient::~ScreenshotClient()'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/Hello-Sreencap-2] Error 1
Well it seems that every calls that needs the android namespace can't be referenced.
But, SurfaceComposerClient is included which defines the android namespace
Here is the c++ code snippet:
#include <utils/RefBase.h>
#include <binder/IBinder.h>
#include <binder/MemoryHeapBase.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
using namespace android;
static void do_save(const char *filename, const void *buf, size_t size)
{
int out = open(filename, O_RDWR|O_CREAT, 0666);
int len = write(out, buf, size);
printf("Wrote %d bytes to out.\n", len);
close(out);
}
int main (int ac, char **av)
{
ScreenshotClient ssc;
const void *pixels;
size_t size;
int buffer_index;
if(ssc.update( android::SurfaceComposerClient::getBuiltInDisplay( android::ISurfaceComposer::eDisplayIdMain)) != NO_ERROR )
{
//printf("Captured: w=%d, h=%d, format=%d\n");
ssc.getWidth();
ssc.getHeight();
ssc.getFormat();
size = ssc.getSize();
do_save(av[1], pixels, size);
}
else
{
printf(" screen shot client Captured Failed");
}
return 0;
}
And The Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := \
libcutils \
libutils \
libbinder \
libskia \
libui \
libgui
LOCAL_SRC_FILES:= \
Hello_Screencap-2.cpp
LOCAL_MODULE:= Hello-Sreencap-2
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES += \
external/skia/include/core \
external/skia/include/effects \
external/skia/include/images \
external/skia/src/ports \
external/skia/src/core \
external/skia/include/utils \
include $(BUILD_EXECUTABLE)
When I compile the screencap from cyanogenmod, the compilation works but when the executable runs it shows an error about CANNOT LINK EXECUTABLE cannot locate symbol Zn7androidscreenshotclient...
If you need more don't hesitate
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')
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!
When I reboot into the "secret menu I don't have the option to unlock the bootloader I bought it directly from Samsung website
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Maybe it makes sense if you give more details about your "plan"...
Because it makes at the moment no big sense without Firmware... Kernel and/or knowledge...
Only if you want kill your device.
Only my personal "feeling" about your question...
For other users... here is the """Secret""" in Video:
Firmware and Combination Firmware and FOTA Delta and CSC change and...
Looks like it could be harder since Tizen... A Stock Firmware for netOdin/Odin not available yet... B Combination Firmware not available yet C FOTA Delta File for study I have...
forum.xda-developers.com
Best Regards
adfree said:
Maybe it makes sense if you give more details about your "plan"...
Because it makes at the moment no big sense without Firmware... Kernel and/or knowledge...
Only if you want kill your device.
Only my personal "feeling" about your question...
For other users... here is the """Secret""" in Video:
Firmware and Combination Firmware and FOTA Delta and CSC change and...
Looks like it could be harder since Tizen... A Stock Firmware for netOdin/Odin not available yet... B Combination Firmware not available yet C FOTA Delta File for study I have...
forum.xda-developers.com
Best Regards
Click to expand...
Click to collapse
You don't need details about my plan To answer my question. All I'm asking is if anyone knows why I do t have the option to unlock the bootloader in the boot menu. It's an unlock galaxy watch 4 bought from Samsungs website not carrier specific. Is anyone else in the US missing this option
Its LTE = Security +1
Oh US LTE + + Security +1
It makes 0 sense if you have nothing to flash...
No Kernel nor full Firmware...
Thanx for your cooparation.
If I am wrong and you have Firmware and/or Kernel to flash...
Feel free to share your files...
Best Regards
Btw...
IMHO also other ways possible to reach this option... with ADB maybe...
Code:
/*
* Copyright (c) 2014 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/io.h>
#include <linux/gpio.h>
#ifdef CONFIG_OF
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/input.h>
#endif
#include <linux/sec_ext.h>
#include "./debug/sec_debug_internal.h"
#include "../battery_v2/include/sec_charging_common.h"
#include <linux/sec_batt.h>
#include <asm/cacheflush.h>
#include <asm/system_misc.h>
#include <linux/reset/exynos-reset.h>
#include <soc/samsung/exynos-pmu.h>
#include <soc/samsung/acpm_ipc_ctrl.h>
#include <linux/battery/sec_charging_common.h>
#include <linux/notifier.h>
#include <linux/string.h>
//#include <soc/samsung/exynos-sci.h>
#if defined(CONFIG_SEC_ABC)
#include <linux/sti/abc_common.h>
#endif
#if IS_ENABLED(CONFIG_SEC_PARAM)
extern unsigned int lpcharge;
#endif
extern void hard_reset_delay(void);
/* MULTICMD
* reserve 8bit | dumpsink_sel 1bit | clk_change 1bit | dumpsink 2bit | param 1bit | dram_test 1bit | cp_debugmem 2bit | debuglevel 2bit | forceupload 2bit
*/
#define FORCEUPLOAD_ON (0x5)
#define FORCEUPLOAD_OFF (0x0)
#define DEBUGLEVEL_LOW (0x4f4c)
#define DEBUGLEVEL_MID (0x494d)
#define DEBUGLEVEL_HIGH (0x4948)
#define DUMPSINK_USB (0x0)
#define DUMPSINK_BOOTDEV (0x42544456)
#define DUMPSINK_SDCARD (0x73646364)
#define DUMPSINK_SELECT (0x65254478)
#define MULTICMD_CNT_MAX 10
#define MULTICMD_LEN_MAX 50
#define MULTICMD_FORCEUPLOAD_SHIFT 0
#define MULTICMD_FORCEUPLOAD_ON (0x1)
#define MULTICMD_FORCEUPLOAD_OFF (0x2)
#define MULTICMD_DEBUGLEVEL_SHIFT (MULTICMD_FORCEUPLOAD_SHIFT + 2)
#define MULTICMD_DEBUGLEVEL_LOW (0x1)
#define MULTICMD_DEBUGLEVEL_MID (0x2)
#define MULTICMD_DEBUGLEVEL_HIGH (0x3)
#define MULTICMD_CPMEM_SHIFT (MULTICMD_DEBUGLEVEL_SHIFT + 2)
#define MULTICMD_CPMEM_ON (0x1)
#define MULTICMD_CPMEM_OFF (0x2)
#define MULTICMD_DRAMTEST_SHIFT (MULTICMD_CPMEM_SHIFT + 2)
#define MULTICMD_DRAMTEST_ON (0x1)
#define MULTICMD_PARAM_SHIFT (MULTICMD_DRAMTEST_SHIFT + 1)
#define MULTICMD_PARAM_ON (0x1)
#define MULTICMD_DUMPSINK_SHIFT (MULTICMD_PARAM_SHIFT + 1)
#define MULTICMD_DUMPSINK_USB (0x1)
#define MULTICMD_DUMPSINK_BOOT (0x2)
#define MULTICMD_DUMPSINK_SD (0x3)
#define MULTICMD_CLKCHANGE_SHIFT (MULTICMD_DUMPSINK_SHIFT + 2)
#define MULTICMD_CLKCHANGE_ON (0x1)
#define MULTICMD_DUMPSINK_SEL_SHIFT (MULTICMD_CLKCHANGE_SHIFT + 1)
#define MULTICMD_DUMPSINK_SEL (0x1)
extern void cache_flush_all(void);
extern void exynos_mach_restart(const char *cmd);
extern struct atomic_notifier_head panic_notifier_list;
extern struct exynos_reboot_helper_ops exynos_reboot_ops;
extern int exynos_reboot_pwrkey_status(void);
/* MINFORM */
#define SEC_REBOOT_START_OFFSET (24)
#define SEC_REBOOT_END_OFFSET (16)
enum sec_power_flags {
SEC_REBOOT_DEFAULT = 0x30,
SEC_REBOOT_NORMAL = 0x4E,
SEC_REBOOT_LPM = 0x70,
};
#define SEC_DUMPSINK_MASK 0x0000FFFF
/* PANIC INFORM */
#define SEC_RESET_REASON_PREFIX 0x12345600
#define SEC_RESET_SET_PREFIX 0xabc00000
#define SEC_RESET_MULTICMD_PREFIX 0xa5600000
enum sec_reset_reason {
SEC_RESET_REASON_UNKNOWN = (SEC_RESET_REASON_PREFIX | 0x00),
SEC_RESET_REASON_DOWNLOAD = (SEC_RESET_REASON_PREFIX | 0x01),
SEC_RESET_REASON_UPLOAD = (SEC_RESET_REASON_PREFIX | 0x02),
SEC_RESET_REASON_CHARGING = (SEC_RESET_REASON_PREFIX | 0x03),
SEC_RESET_REASON_RECOVERY = (SEC_RESET_REASON_PREFIX | 0x04),
SEC_RESET_REASON_FOTA = (SEC_RESET_REASON_PREFIX | 0x05),
SEC_RESET_REASON_FOTA_BL = (SEC_RESET_REASON_PREFIX | 0x06), /* update bootloader */
SEC_RESET_REASON_SECURE = (SEC_RESET_REASON_PREFIX | 0x07), /* image secure check fail */
SEC_RESET_REASON_FWUP = (SEC_RESET_REASON_PREFIX | 0x09), /* emergency firmware update */
SEC_RESET_REASON_EM_FUSE = (SEC_RESET_REASON_PREFIX | 0x0a), /* EMC market fuse */
SEC_RESET_REASON_FACTORY = (SEC_RESET_REASON_PREFIX | 0x0c), /* go to factory mode */
SEC_RESET_REASON_BOOTLOADER = (SEC_RESET_REASON_PREFIX | 0x0d), /* go to download mode */
SEC_RESET_REASON_WIRELESSD_BL = (SEC_RESET_REASON_PREFIX | 0x0e), /* go to wireless download BOTA mode */
SEC_RESET_REASON_RECOVERY_WD = (SEC_RESET_REASON_PREFIX | 0x0f), /* go to wireless download mode */
SEC_RESET_REASON_PKEY_HOLD = (SEC_RESET_REASON_PREFIX | 0x12), /* Power Key HOLD during shutdown */
SEC_RESET_REASON_EMERGENCY = 0x0,
SEC_RESET_SET_DPRM = (SEC_RESET_SET_PREFIX | 0x20000),
SEC_RESET_SET_FORCE_UPLOAD = (SEC_RESET_SET_PREFIX | 0x40000),
SEC_RESET_SET_DEBUG = (SEC_RESET_SET_PREFIX | 0xd0000),
SEC_RESET_SET_SWSEL = (SEC_RESET_SET_PREFIX | 0xe0000),
SEC_RESET_SET_SUD = (SEC_RESET_SET_PREFIX | 0xf0000),
SEC_RESET_CP_DBGMEM = (SEC_RESET_SET_PREFIX | 0x50000), /* cpmem_on: CP RAM logging */
SEC_RESET_SET_POWEROFF_WATCH = (SEC_RESET_SET_PREFIX | 0x90000), /* Power off Watch mode */
#if defined(CONFIG_SEC_ABC)
SEC_RESET_USER_DRAM_TEST = (SEC_RESET_SET_PREFIX | 0x60000), /* USER DRAM TEST */
#endif
#if defined(CONFIG_SEC_SYSUP)
SEC_RESET_SET_PARAM = (SEC_RESET_SET_PREFIX | 0x70000),
#endif
SEC_RESET_SET_DUMPSINK = (SEC_RESET_SET_PREFIX | 0x80000),
SEC_RESET_SET_MULTICMD = SEC_RESET_MULTICMD_PREFIX,
};
static int sec_reboot_on_panic;
static char panic_str[10] = "panic";
ATOMIC_NOTIFIER_HEAD(sec_power_off_notifier_list);
EXPORT_SYMBOL(sec_power_off_notifier_list);
static char * sec_strtok(char *s1, const char *delimit)
{
static char *lastToken = NULL;
char *tmp;
if (s1 == NULL) {
s1 = lastToken;
if (s1 == NULL)
return NULL;
} else {
s1 += strspn(s1, delimit);
}
tmp = strpbrk(s1, delimit);
if (tmp) {
*tmp = '\0';
lastToken = tmp + 1;
} else {
lastToken = NULL;
}
return s1;
}
static void sec_multicmd(const char *cmd)
{
unsigned long value = 0;
char *multicmd_ptr;
char *multicmd_cmd[MULTICMD_CNT_MAX];
char copy_cmd[100] = {0,};
unsigned long multicmd_value = 0;
int i, cnt = 0;
strcpy(copy_cmd, cmd);
multicmd_ptr = sec_strtok(copy_cmd, ":");
while (multicmd_ptr != NULL) {
if (cnt >= MULTICMD_CNT_MAX)
break;
multicmd_cmd[cnt++] = multicmd_ptr;
multicmd_ptr = sec_strtok(NULL, ":");
}
for (i = 1; i < cnt; i++) {
if (strlen(multicmd_cmd[i]) < MULTICMD_LEN_MAX) {
if (!strncmp(multicmd_cmd[i], "forceupload", 11) && !kstrtoul(multicmd_cmd[i] + 11, 0, &value)) {
if (value == FORCEUPLOAD_ON)
multicmd_value |= (MULTICMD_FORCEUPLOAD_ON << MULTICMD_FORCEUPLOAD_SHIFT);
else if (value == FORCEUPLOAD_OFF)
multicmd_value |= (MULTICMD_FORCEUPLOAD_OFF << MULTICMD_FORCEUPLOAD_SHIFT);
}
else if (!strncmp(multicmd_cmd[i], "debug", 5) && !kstrtoul(multicmd_cmd[i] + 5, 0, &value)) {
if (value == DEBUGLEVEL_HIGH)
multicmd_value |= (MULTICMD_DEBUGLEVEL_HIGH << MULTICMD_DEBUGLEVEL_SHIFT);
else if (value == DEBUGLEVEL_MID)
multicmd_value |= (MULTICMD_DEBUGLEVEL_MID << MULTICMD_DEBUGLEVEL_SHIFT);
else if (value == DEBUGLEVEL_LOW)
multicmd_value |= (MULTICMD_DEBUGLEVEL_LOW << MULTICMD_DEBUGLEVEL_SHIFT);
}
else if (!strncmp(multicmd_cmd[i], "cpmem_on", 8))
multicmd_value |= (MULTICMD_CPMEM_ON << MULTICMD_CPMEM_SHIFT);
else if (!strncmp(multicmd_cmd[i], "cpmem_off", 9))
multicmd_value |= (MULTICMD_CPMEM_OFF << MULTICMD_CPMEM_SHIFT);
#if defined(CONFIG_SEC_ABC)
else if (!strncmp(multicmd_cmd[i], "user_dram_test", 14) && sec_abc_get_enabled())
multicmd_value |= (MULTICMD_DRAMTEST_ON << MULTICMD_DRAMTEST_SHIFT);
#endif
#if defined(CONFIG_SEC_SYSUP)
else if (!strncmp(multicmd_cmd[i], "param", 5))
multicmd_value |= (MULTICMD_PARAM_ON << MULTICMD_PARAM_SHIFT);
#endif
else if (!strncmp(multicmd_cmd[i], "dump_sink", 9) && !kstrtoul(multicmd_cmd[i] + 9, 0, &value)) {
if (value == DUMPSINK_USB)
multicmd_value |= (MULTICMD_DUMPSINK_USB << MULTICMD_DUMPSINK_SHIFT);
else if (value == DUMPSINK_BOOTDEV)
multicmd_value |= (MULTICMD_DUMPSINK_BOOT << MULTICMD_DUMPSINK_SHIFT);
else if (value == DUMPSINK_SDCARD)
multicmd_value |= (MULTICMD_DUMPSINK_SD << MULTICMD_DUMPSINK_SHIFT);
else if (value == DUMPSINK_SELECT)
multicmd_value |= (MULTICMD_DUMPSINK_SEL << MULTICMD_DUMPSINK_SEL_SHIFT);
}
#if defined(CONFIG_ARM_EXYNOS_ACME_DISABLE_BOOT_LOCK) && defined(CONFIG_ARM_EXYNOS_DEVFREQ_DISABLE_BOOT_LOCK)
else if (!strncmp(multicmd_cmd[i], "clkchange_test", 14))
multicmd_value |= (MULTICMD_CLKCHANGE_ON << MULTICMD_CLKCHANGE_SHIFT);
#endif
}
}
pr_emerg("%s: multicmd_value: %lu\n", __func__, multicmd_value);
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_MULTICMD | multicmd_value);
}
void sec_set_reboot_magic(int magic, int offset, int mask)
{
u32 tmp = 0;
exynos_pmu_read(SEC_DEBUG_MAGIC_INFORM, &tmp);
pr_info("%s: prev: %x\n", __func__, tmp);
mask <<= offset;
tmp &= (~mask);
tmp |= magic << offset;
pr_info("%s: set as: %x\n", __func__, tmp);
exynos_pmu_write(SEC_DEBUG_MAGIC_INFORM, tmp);
}
EXPORT_SYMBOL(sec_set_reboot_magic);
static void sec_power_off(void)
{
u32 poweroff_try = 0;
union power_supply_propval ac_val = {0, };
union power_supply_propval usb_val = {0, };
union power_supply_propval wpc_val = {0, };
u32 reboot_charging = 0;
sec_set_reboot_magic(SEC_REBOOT_LPM, SEC_REBOOT_END_OFFSET, 0xFF);
psy_do_property("ac", get, POWER_SUPPLY_PROP_ONLINE, ac_val);
psy_do_property("usb", get, POWER_SUPPLY_PROP_ONLINE, usb_val);
psy_do_property("wireless", get, POWER_SUPPLY_PROP_ONLINE, wpc_val);
reboot_charging = ac_val.intval || usb_val.intval || wpc_val.intval;
pr_info("[%s] reboot_charging(%d), AC[%d], USB[%d], WPC[%d]\n",
__func__, reboot_charging, ac_val.intval, usb_val.intval, wpc_val.intval);
pr_info("Exynos reboot, PWR Key(%d)\n", exynos_reboot_pwrkey_status());
flush_cache_all();
/* before power off */
pr_crit("%s: call pre-power_off notifiers\n", __func__);
atomic_notifier_call_chain(&sec_power_off_notifier_list, 0, NULL);
while (1) {
/* Check reboot charging */
#if IS_ENABLED(CONFIG_SEC_PARAM)
if ((reboot_charging || (poweroff_try >= 5)) && !lpcharge) {
#else
if (reboot_charging || (poweroff_try >= 5)) {
#endif
/* if reboot_charging is true, to enter LP charging.
* else Power Key HOLD
*/
if (reboot_charging) {
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_UNKNOWN);
pr_emerg("%s: charger connected or power off failed(%d), reboot!\n", __func__, poweroff_try);
} else {
sec_set_reboot_magic(SEC_REBOOT_NORMAL, SEC_REBOOT_END_OFFSET, 0xFF);
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_PKEY_HOLD);
pr_emerg("%s: POWER KEY HOLD, reboot!\n", __func__);
}
exynos_mach_restart("sw reset");
pr_emerg("%s: waiting for reboot\n", __func__);
while (1);
}
/* wait for power button release.
* but after exynos_acpm_reboot is called
* power on status cannot be read */
if (exynos_reboot_pwrkey_status())
pr_info("PWR Key is not released (%d)(poweroff_try:%d)\n", exynos_reboot_pwrkey_status(), poweroff_try);
else {
if (exynos_reboot_ops.acpm_reboot)
exynos_reboot_ops.acpm_reboot();
else
pr_err("Exynos reboot, acpm_reboot not registered\n");
pr_emerg("Set PS_HOLD Low.\n");
exynos_pmu_update(EXYNOS_PMU_PS_HOLD_CONTROL, 0x1<<8, 0x0);
pr_emerg("Should not reach here! Device will be restarted after 950 msec.\n");
mdelay(950);
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_UNKNOWN);;
exynos_mach_restart("sw reset");
pr_emerg("%s: waiting for reboot\n", __func__);
while (1);
}
++poweroff_try;
mdelay(1000);
}
}
static int sec_reboot(struct notifier_block *this,
unsigned long mode, void *cmd)
{
local_irq_disable();
hard_reset_delay();
if (sec_reboot_on_panic && !cmd)
cmd = panic_str;
pr_emerg("%s (%d, %s)\n", __func__, reboot_mode, cmd ? cmd : "(null)");
/* LPM mode prevention */
sec_set_reboot_magic(SEC_REBOOT_NORMAL, SEC_REBOOT_END_OFFSET, 0xFF);
if (cmd) {
unsigned long value;
if (!strcmp(cmd, "fota"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_FOTA);
else if (!strcmp(cmd, "fota_bl"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_FOTA_BL);
else if (!strcmp(cmd, "recovery"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_RECOVERY);
else if (!strcmp(cmd, "download"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_DOWNLOAD);
else if (!strcmp(cmd, "bootloader"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_BOOTLOADER);
else if (!strcmp(cmd, "upload"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_UPLOAD);
else if (!strcmp(cmd, "secure"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_SECURE);
else if (!strcmp(cmd, "wdownload"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_RECOVERY_WD);
else if (!strcmp(cmd, "wirelessd"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_WIRELESSD_BL);
else if (!strcmp(cmd, "factory"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_FACTORY);
else if (!strcmp(cmd, "fwup"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_FWUP);
else if (!strcmp(cmd, "em_mode_force_user"))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_EM_FUSE);
#if defined(CONFIG_SEC_ABC)
else if (!strcmp(cmd, "user_dram_test") && sec_abc_get_enabled())
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_USER_DRAM_TEST);
#endif
else if (!strncmp(cmd, "emergency", 9))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_EMERGENCY);
else if (!strncmp(cmd, "debug", 5) && !kstrtoul(cmd + 5, 0, &value))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_DEBUG | value);
else if (!strncmp(cmd, "dump_sink", 9) && !kstrtoul(cmd + 9, 0, &value))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_DUMPSINK | (SEC_DUMPSINK_MASK & value));
else if (!strncmp(cmd, "forceupload", 11) && !kstrtoul(cmd + 11, 0, &value))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_FORCE_UPLOAD | value);
else if (!strncmp(cmd, "dprm", 4))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_DPRM);
else if (!strncmp(cmd, "swsel", 5) && !kstrtoul(cmd + 5, 0, &value))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_SWSEL | value);
else if (!strncmp(cmd, "sud", 3) && !kstrtoul(cmd + 3, 0, &value))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_SUD | value);
else if (!strncmp(cmd, "multicmd:", 9))
sec_multicmd(cmd);
#if defined(CONFIG_SEC_SYSUP)
else if (!strncmp(cmd, "param", 5))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_PARAM);
#endif
else if (!strncmp(cmd, "cpmem_on", 8))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_CP_DBGMEM | 0x1);
else if (!strncmp(cmd, "cpmem_off", 9))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_CP_DBGMEM | 0x2);
else if (!strncmp(cmd, "mbsmem_on", 9))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_CP_DBGMEM | 0x1);
else if (!strncmp(cmd, "mbsmem_off", 10))
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_CP_DBGMEM | 0x2);
else if (!strncmp(cmd, "watchonly", 9)){
int wcoff = 10;
if (!strncmp(cmd + wcoff, "exercise", 8))
wcoff += 9;
if (((char*)cmd)[wcoff] == '0')
kstrtoul(cmd + (wcoff + 1), 0, &value);
else
kstrtoul(cmd + wcoff, 0, &value);
if (((char*)cmd)[wcoff - 1] == '+')
value |= 1 << 0xf;
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_SET_POWEROFF_WATCH | value);
} else if (!strncmp(cmd, "panic", 5)) {
/*
* This line is intentionally blanked because the PANIC INFORM is used for upload cause
* in sec_debug_set_upload_cause() only in case of panic() .
*/
} else
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_UNKNOWN);
} else {
exynos_pmu_write(SEC_DEBUG_PANIC_INFORM, SEC_RESET_REASON_UNKNOWN);
}
flush_cache_all();
return NOTIFY_DONE;
}
static int sec_reboot_panic_handler(struct notifier_block *nb,
unsigned long l, void *buf)
{
pr_emerg("sec_reboot: %s\n", __func__);
sec_reboot_on_panic = 1;
return NOTIFY_DONE;
}
static struct notifier_block nb_panic_block = {
.notifier_call = sec_reboot_panic_handler,
.priority = 128,
};
static struct notifier_block sec_restart_nb = {
.notifier_call = sec_reboot,
.priority = 130,
};
static int __init sec_reboot_init(void)
{
int err;
err = atomic_notifier_chain_register(&panic_notifier_list, &nb_panic_block);
if (err) {
pr_err("cannot register panic handler (err=%d)\n", err);
}
err = register_restart_handler(&sec_restart_nb);
if (err) {
pr_err("cannot register restart handler (err=%d)\n", err);
}
pm_power_off = sec_power_off;
pr_info("register restart handler successfully\n");
return err;
}
subsys_initcall(sec_reboot_init);
Maybe via reboot...
Oh I know.... your project is Top Secret.
Your right I can't flash until I have kernel or full firmware but I would also like to no have to jump through this hoop when it does become available. That being said that is why I'm interested in figuring this out now instead of later. And yes I can use adb to boot to the boot menu but that still doesn't solve the problem of not having the bootloader unlock option
Maybe you know Samsung Phones and OEM unlock in Developer Mode...
Maybe you ever heard of fastboot...
Maybe it work...
Code:
fastboot oem unlock
Dangerous!
OWN risk!
No idea... never tested...
Best Regards