[Q] Extracting kernel image from a rom image - General Questions and Answers

I am trying to build some kernel modules for a Tronsmart MK808ii but Tronsmart have not provided the config (No proc/config.gz) after some messing about I have managed to get some kernel modules to load (I have the Init and Exit pointers in the right place). My first aim is to allow the device to read usb cdroms and iso files for which I need to load isofs.ko cdrom.ko and sr_mod.ko
Actually things go pretty well except there appears to be a misalignment between struct gendisk in the module and kernel. when the genhd driver dereferences gendisk->part0 i get an oops. Looking at the code the only definable length object before part0 seems to be disk_name
In order to be more precise about what's happening and to determine the relative alignment of structures between my kernel and the supplied one I need to be able to disassemble the original kernel which I've extracted from the eeprom - ony problem is that neither file nor objdump know what to do with this image, so I'm presupposing it has some sort of header on it so the bootloader can find the image. The Image starts with KRNL$
Does anyone have an idea of how vmlinux image can be extracted from this rom image?
int major; /* major number of driver */
int first_minor;
int minors; /* maximum number of minors, =1 for
* disks that can't be partitioned. */
char disk_name[DISK_NAME_LEN]; /* name of major driver */
char *(*devnode)(struct gendisk *gd, mode_t *mode);
unsigned int events; /* supported events */
unsigned int async_events; /* async events, subset of all */
/* Array of pointers to partitions indexed by partno.
* Protected with matching bdev lock but stat and other
* non-critical accesses use RCU. Always access through
* helpers.
*/
struct disk_part_tbl __rcu *part_tbl;
struct hd_struct part0;

Related

Getting BFS Scheduler working?

Im so sorry if this is in the wrong place but im a developer working on my first kernel and my question is only going to get some help by the most elite ROM dev's out there.
Ok so i got the BFS patch for the kernel im currently working on which is 2.6.32.9. Of course the patch is meant for a mainline kernel and not an Android kernel so i went through the patch file and applied the patch by hand, it was a pretty smooth process the diffs in the bfs patch were all the same code just wouldn't apply because all the line numbers were off. My first attempt bombed so i must have made some mistakes it was my first time patching by hand! Anyways took another crack and recompiled the kernel after every file patched so i could basically debug compiling problems well it all went smooth.
Heres the problem though, kernel compiles fine with out bfs checked, with it checked it compile a hell of alot of the kernel, but it eventually fails and it make no seance after my investigation of things. Here is my error
Code:
drivers/built-in.o: In function `mmc_wait_for_req':
lowmemorykiller.c:(.text+0xd2b3c): undefined reference to `wait_for_completion_io'
make: *** [.tmp_vmlinux1] Error 1
I found the decleration for wait_for_completion_io in kernel/sched.c the only thing i changed in sched.c was to at line 1 and it was basically to include sched_bfs.c, if the scheduler was seleted in the config, heres the patch stuff for sched, all i did was add the three lines to check if bfs was set in the config and then added the #endif at the bottom
Code:
*/
Index: linux-2.6.32-ck2/kernel/sched.c
===================================================================
--- linux-2.6.32-ck2.orig/kernel/sched.c 2009-12-03 21:02:30.565685697 +1100
+++ linux-2.6.32-ck2/kernel/sched.c 2009-12-29 10:15:00.820070753 +1100
@@ -1,3 +1,6 @@
+#ifdef CONFIG_SCHED_BFS
+#include "sched_bfs.c"
+#else
/*
* kernel/sched.c
*
@@ -10909,3 +10912,4 @@ void synchronize_sched_expedited(void)
EXPORT_SYMBOL_GPL(synchronize_sched_expedited);
#endif /* #else #ifndef CONFIG_SMP */
+#endif /* CONFIG_SCHED_BFS */
\ No newline at end of file
.
At the end of sched.c it starts exporting the functions and wait!!!! the first function it exports looks like this!
Code:
/**
* wait_for_completion: - waits for completion of a task
* @x: holds the state of this particular completion
*
* This waits to be signaled for completion of a specific task. It is NOT
* interruptible and there is no timeout.
*
* See also similar routines (i.e. wait_for_completion_timeout()) with timeout
* and interrupt capability. Also see complete().
*/
void __sched wait_for_completion(struct completion *x)
{
wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE, 0);
}
EXPORT_SYMBOL(wait_for_completion);
So maybe sched isnt exporting any functions anymore after the inclusion of sched_bfs.c into it? i dont know all i know it i didnt touch lowmemmory.c and im sooo close to getting BFS but this is boggling me!! Maybe there is a conflict in kernel options im not aware of? I turned off all c groups and the default scheduler.
I wont paste my .config here nothing annoys me more than that, heres a link to a gist of it on github (just like pastbin for thos not in the know lol) bfs enabled .config and here is my sched.c and my lowmemmorykiller.c! Any help would be awesome there are so many people patching bfs into there androif kernel so im hoping this is a common type of problem
EDIT if i remove the mmc drivers it finishes the compile, but i kind of need these have to sleep now ill experiment more, if neone has any ideas about what the heck is goin on id love to know
did you ever fix this? i ran into the same error. a quick google search got me this and it seems to be working. ill post later if it actually works.
edit: succesfully built tdm's gingerkernel with -ck patchset with this. working on bobzhome's kernel now
Sorry this is way late man!! I have been doing alot of hardware hacking as of late, my android stuff especially kernel modding has been pushed to the the side.
Anyways how did BFS turn out any speed improvements? Maybe ill see if I can patch it into cm9 if theres and good reason for that
I am getting this same error after adding bfs to my kernel.. the link you gave is 404. Any one who worked with bfs that can provide some insight, that would be greatly appreciated. Thanks
arch/arm/mach-msm/built-in.o:shooter-panel.c:function msm_dmov_exec_cmd: error: undefined reference to 'wait_for_completion_io'
drivers/built-in.o:clkdev.c:function mmc_wait_for_req: error: undefined reference to 'wait_for_completion_io'
drivers/built-in.o:clkdev.c:function mmc_wait_for_cmd: error: undefined reference to 'wait_for_completion_io'
drivers/built-in.o:clkdev.c:function mmc_erase: error: undefined reference to 'wait_for_completion_io'
make: *** [.tmp_vmlinux1] Error 1
You can get BFS working adding these lines in <kernel-path>/kernel/sched_bfs.c
Code:
/**
* wait_for_completion_io: - waits for completion of a task
* @x: holds the state of this particular completion
*
* This waits for completion of a specific task to be signaled. Treats any
* sleeping as waiting for IO for the purposes of process accounting.
*/
void __sched wait_for_completion_io(struct completion *x)
{
wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE);
}
EXPORT_SYMBOL(wait_for_completion_io);
After this line:
Code:
EXPORT_SYMBOL(wait_for_completion);

[Q] Jelly Bean wifi patch help

As many know, Jelly Bean wifi does not support enterprise wifi.
A fix was posted on the google forum that will hopefully work with the TF300t http://code.google.com/p/android/issues/detail?id=34212#c165
external/wpa_supplicant_8:
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index aaa920b..be94e8a 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -929,6 +929,11 @@ struct tls_connection * tls_connection_init(void *ssl_ctx)
#ifdef SSL_OP_NO_COMPRESSION
options |= SSL_OP_NO_COMPRESSION;
#endif /* SSL_OP_NO_COMPRESSION */
+#ifdef ANDROID
+ options |= SSL_OP_NO_TLSv1_1;
+ options |= SSL_OP_NO_TLSv1_2;
+ options |= SSL_OP_NO_TICKET;
+#endif /* ANDROID */
SSL_set_options(conn->ssl, options);
conn->ssl_in = BIO_new(BIO_s_mem());
(note similar patch in wpa_supplicant_6 if your build configuration uses that)
those shouldn't disable WiFi, just limit what TLS versions are used by wpa_supplicant to talk to the server. it should still use TLSv1.0 and SSLv3.0.
My understanding is that you have to apply the patch to the source code and recompile the file. I have no clue how to do this despite a few searches with explanations beyond my abilities. Could someone give me a newb guide on how to do this or uploaded a patched file to fix this common issue?
Many, many thanks!
Is it possible to apply the patch and recompile it in Windows 7? From my searches it seems that you need linux (Ubuntu?) or Mac. If so, can you point me in the right direction?
Thanks!

Sensorhub and Note 2 recovery maintainers

Please compile, if possible, your embedded recovery kernels without the sensorhub defconfig options.
CONFIG_SENSORS_SSP=y
CONFIG_SENSORS_SYSFS=y
CONFIG_SENSORS_SSP_ACCELEROMETER_POSITION=7
CONFIG_SENSORS_SSP_GYROSCOPE_POSITION=7
CONFIG_SENSORS_SSP_MAGNETOMETER_POSITION=7
CONFIG_SENSORS_SSP_LSM330=y
CONFIG_SENSORS_SSP_CM36651=y
CONFIG_SENSORS_SSP_AK8963C=y
CONFIG_SENSORS_SSP_BMP182=y
CONFIG_SENSORS_SSP_AT32UC3L0128=y
CONFIG_SENSORS_SSP_SENSORHUB=y
The kernel flashes over the sensorhub firmware on every single entry of recovery, and rebooting into the normal kernel, if the embedded kernel firmware mismatches the live hardware firmware. I consider this dangerous because firstly I don't know what happens if a firmware flash fails on boot, and secondly, the whole procedure is done over the I2C bus and takes about 22 seconds, increasing the boot time (and recovery entry) dramatically. The firmware changes relatively often and we have like 4 different versions out there in the wild at this moment and they will surely increase.
Off-topic: The sensorhub is a new dedicated micro-controller chip found on the Note 2 which handles all device sensors, instead of them being handled by the main CPU itself. The point of the thing is to offload that work from the CPU to vastly improve battery life.
Thank you a lot for the feedback and input about this issue
When compiling recoveries, we get the binary (recovery file) and the kernel. Sorry if I seem noob here, but I do not compile kernels, I am only used to cwm source. And in the recovery binary sources, there is no sensors flashed, it is the kernel that is repacked with it.
Now, if I take a recovery.img as it is outputted when compiled from cm10 sources, that is packed with a cm10 kernel, the recovery will boot without a delay.
However, that will break exfat support since we cannot insmod the external modules
So, the only choice is to repack the recovery ramdisk with a stock Samsung kernel, and that's what I do in my recoveries. However, this seems to induce the boot delay for people using custom kernels built around some sources (redpill, Perseus)
These recoveries repacked with a Samsung kernel will run fine along stock kernels and Note2core custom kernel (also a 4.1.2 source).
One of the potential causes is this part of code I believe (have no Note 2 to debug it)
drivers/sensor/ak8963.c
Code:
if (retry_count < 5) {
retry_count++;
pr_warn("############################################");
pr_warn("%s, retry_count=%d\n", __func__, retry_count);
pr_warn("############################################");
goto retry;
} else {
There is a check routine repeated 5 times, and on each repeat count a goto loop. The retry loop restarts much above in the code
retry:
Code:
#ifdef FACTORY_TESTstatic int ak8963c_selftest(struct akm8963_data *ak_data, int *sf){
.
.
.
retry:
/* read device info */
i2c_smbus_read_i2c_block_data(ak_data->this_client,
AK8963_REG_WIA, 2, buf);
pr_info("%s: device id = 0x%x, info = 0x%x\n",
__func__, buf[0], buf[1]);
/* set ATSC self test bit to 1 */
i2c_smbus_write_byte_data(ak_data->this_client,
AK8963_REG_ASTC, 0x40);
/* start self test */
i2c_smbus_write_byte_data(ak_data->this_client,
AK8963_REG_CNTL1,
AK8963_CNTL1_SELF_TEST);
/* wait for data ready */
while (1) {
msleep(20);
if (i2c_smbus_read_byte_data(ak_data->this_client,
AK8963_REG_ST1) == 1) {
break;
}
}
i2c_smbus_read_i2c_block_data(ak_data->this_client,
AK8963_REG_HXL, sizeof(buf), buf);
/* set ATSC self test bit to 0 */
i2c_smbus_write_byte_data(ak_data->this_client,
AK8963_REG_ASTC, 0x00);
x = buf[0] | (buf[1] << 8);
y = buf[2] | (buf[3] << 8);
z = buf[4] | (buf[5] << 8);
/* Hadj = (H*(Asa+128))/256 */
x = (x*(ak_data->asa[0] + 128)) >> 8;
y = (y*(ak_data->asa[1] + 128)) >> 8;
z = (z*(ak_data->asa[2] + 128)) >> 8;
pr_info("%s: self test x = %d, y = %d, z = %d\n",
__func__, x, y, z);
if ((x >= -200) && (x <= 200))
pr_info("%s: x passed self test, expect -200<=x<=200\n",
__func__);
else
pr_info("%s: x failed self test, expect -200<=x<=200\n",
__func__);
if ((y >= -200) && (y <= 200))
pr_info("%s: y passed self test, expect -200<=y<=200\n",
__func__);
else
pr_info("%s: y failed self test, expect -200<=y<=200\n",
__func__);
if ((z >= -3200) && (z <= -800))
pr_info("%s: z passed self test, expect -3200<=z<=-800\n",
__func__);
else
pr_info("%s: z failed self test, expect -3200<=z<=-800\n",
__func__);
sf[0] = x;
sf[1] = y;
sf[2] = z;
if (((x >= -200) && (x <= 200)) &&
((y >= -200) && (y <= 200)) &&
((z >= -3200) && (z <= -800))) {
pr_info("%s, Selftest is successful.\n", __func__);
return 1;
} else {
if (retry_count < 5) {
retry_count++;
pr_warn("############################################");
pr_warn("%s, retry_count=%d\n", __func__, retry_count);
pr_warn("############################################");
goto retry;
}
These are many retries using a non efficient goto loop.
Basically, here's the current possibilities I see:
- if we repack the recovery with your kernel or redpill, people will get delay issues on stock ROMs/Kernels
- if we use cm10 kernel: no delays but we loose exfat support
- if we use note2core kernel we'll probably loose exfat support
- if I recompile kernel from samsung sources without the sensors, it seems it will also break exfat
So, at the end I do not see a good choice that will satisfy every one. Either I wait for Samsung to release their sources so that you fix the kernel or I repack with 2 kernels: Samsung stock and redpill, so people can chose
Hope I am not getting it all wrong, but that's how I understand it
All that code is totally irrelevant and has nothing to do with the issue. I also don't understand what you want to say about that loop? Goto is inefficient? Nonsense.
The firmware flash and logic happens in /drivers/sensorhub/ssp_firmware.c and its just a few lines of code. The whole flash process is logged in kmsg at boot so you can just retrieve that and see for yourself.
And you're missing the point, as long as you embed ANY kernel with the sensorhub drivers, they will flash it. There are stock kernels out there with versions 91100, 92600, 92800, 102600 (just from the top of my head, might differ). If you use any recovery kernel whose version mismatches the boot.img kernel firmware, you will get the issue.
And to be honest, I don't understand what the fuss is about fixing it, TWRP includes now a kernel with exFat and removed sensor drivers. You just have to do the same.
Phil3759 said:
Either I wait for Samsung to release their sources so that you fix the kernel
Click to expand...
Click to collapse
There is nothing to fix from the live kernel side, I hope you understand that...
AndreiLux said:
All that code is totally irrelevant and has nothing to do with the issue. I also don't understand what you want to say about that loop? Goto is inefficient? Nonsense.
The firmware flash and logic happens in /drivers/sensorhub/ssp_firmware.c and its just a few lines of code. The whole flash process is logged in kmsg at boot so you can just retrieve that and see for yourself.
And you're missing the point, as long as you embed ANY kernel with the sensorhub drivers, they will flash it. There are stock kernels out there with versions 91100, 92600, 92800, 102600 (just from the top of my head, might differ). If you use any recovery kernel whose version mismatches the boot.img kernel firmware, you will get the issue.
And to be honest, I don't understand what the fuss is about fixing it, TWRP includes now a kernel with exFat and removed sensor drivers. You just have to do the same.
There is nothing to fix from the live kernel side, I hope you understand that...
Click to expand...
Click to collapse
AndreiLux said:
Sorry but you're a bit out of bound here with accusing kernel developers and doing such claims about the source of the issue while you seem pretty ignorant about the technical aspects of the problem.
As I said and explained in the thread you linked, the problem lies with the recovery and not the boot kernel. You're the one who will have to adapt your embedded kernel that you include here.
Click to expand...
Click to collapse
You also seem a bit ignorant about recoveries
TWRP doesn't included any custom kernel with exfat support. It comes with cm9 kernel and maybe now cm10.1 since they moved sources to 4.2 recently. Their source is just the android/bootable/recovery part built around cyanogenmod source. CM kernel, as I said in my answer, doesn't flash the sensors that's why there is no delay. That's the only reason why twrp won't have the delay. I can also include cm10 kernel and no more delays, but say good bye to exfat.
TWRP includes native exfat support where as CM and AOKP choose to not include it in their source (thus cwm) because it is not legal (MS patent). Only thing cwm devs can do:
- import twrp source for exfat support and break the MS patent
- use Samsung genuine kernel to get exfat support
So, not an easy decision / move as you suggest
Phil3759 said:
TWRP doesn't included any custom kernel with exfat support. It comes with cm9 kernel and maybe now cm10.1 since they moved sources to 4.2 recently. Their source is just the android/bootable/recovery part built around cyanogenmod source. CM kernel, as I said in my answer, doesn't flash the sensors that's why there is no delay. That's the only reason why twrp won't have the delay. I can also include cm10 kernel and no more delays, but say good bye to exfat.
TWRP includes native exfat support where as CM and AOKP choose to not include it in their source (thus cwm) because it is not legal (MS patent). Only thing cwm devs can do:
- import twrp source for exfat support and break the MS patent
- use Samsung genuine kernel to get exfat support
So, not an easy decision / move as you suggest
Click to expand...
Click to collapse
Sorry but almost everything you said its wrong.
TWRP includes a modified CM kernel with added exFat and since I've made Bigbiff aware, also removes the sensorhub drivers.
CM kernel, as I said in my answer, doesn't flash the sensors that's why there is no delay.
Click to expand...
Click to collapse
The CM kernel is based on the Samsung sources and has the flash logic intact, because it's obviously needed in the OS to even have functioning sensors. It's not flashing in your case because you have matching firmwares, and that's all.
Sorry but I suggest you inform yourself here a bit more, I've explained it pretty clearly yet you seem to be ranting about things which are just not correct.
delete

[Q] Help ?? trying to set up ddr ram for kernel 3.0.8 properly [ not a dummy ]

I was wondering if maybe someone here can maybe help me out with this. ive been working on it on and off for about 8 months now.
I am The lead developer for Team Osiris.
currently, still finishing up cm10 for the Zte warp.
Which is MSM8655 / MSM7X30 based
512mb ram
the problem iam having is with the 3.0.8 kernel iam developing.
we took the kernel source for the warp sequent. and modified it, and got it to boot on the warp.
we were using a moddified board-msm-7x30, but i recently made a new board file from scratch based on a Code Aurora generic board-msm-7x30.
i reworked the entire board, added and removed what needed to be done.
then i get to the real issue ive been trying to solve forever.
it seems no matter what i do. the system only sees 116mb ram. i know some is reserved for the os and what not. so i know thats not the issue.
on stock gb we had 512 physical, with 378 free.
this very same problem was also encounterd and fixed when we started cm10 using the 2.6.35.7 source for the phone.
that one turned out that memory4 was not online.. simple fix.
ive tried that on the 3x kernel with no luck.
memory4 doesnt even exist.
only memory0. using either board file.
Here is a snipet of the code iam trying to get memory online in the board.
Code:
// MEMBANKS
#define DDR_BANK1 0X20000000
#define DDR_BANK1_SIZE 0x00000100
#define DDR_BANK2 0X40000000
#define DDR_BANK2_SIZE 0x00000100
/// DO AWAY WITH ZTE FIXUP, IN FAVOR OF MSM7X30_FIXUP
static void __init msm7x30_fixup(struct machine_desc *desc,
struct tag *tags,
char **cmdline,
struct meminfo *mi)
{
mi->bank[0].start = DDR_BANK1 + PHYS_OFFSET;
mi->bank[0].size = DDR_BANK1_SIZE;
mi->bank[1].start = DDR_BANK2;
mi->bank[1].size = DDR_BANK2_SIZE;
return ;
}
static void __init msm7x30_init_early(void)
{
msm7x30_allocate_memory_regions();
}
again, the hex values may not be right.
ive done my research and iam kind of at a loss right now. in 2.6 it seems everything was in ebi0
and also with 8655 cpus everything is in ebi0.
ive tried other memory layouts from phones with the same hardware. no luck..
any help or direction would be appreciated

How To Guide [SOURCE] ASUS_I005_1-kernel (MacOS / Linux)

WARNING:
This is NOT a custom kernel!​
GPL requires that source is released for Android kernels.
It does not, however, require that the source is tracked.
ROG Phone 5 - Support
www.asus.com
Each release is downloaded, extracted, and added to git in a single repo in order to create a kernel changelog. Some commits may be added to improve building the kernel as a standalone binary. The core functionality and features will remain unchanged.
GitHub - Skywalker-I005/ASUS_I005_1-kernel
Contribute to Skywalker-I005/ASUS_I005_1-kernel development by creating an account on GitHub.
github.com
The IKCONFIG is then pulled from a running device to get the compiler hash
GitHub - Skywalker-I005/llvm-project_asus
Contribute to Skywalker-I005/llvm-project_asus development by creating an account on GitHub.
github.com
The source provided by ASUS is meant to be built as a complete firmware.
Some commits have been added to fix broken links and restore missing code.
The source, as it is provided, does not build without missing components.
There are changes required to use newer versions of LLVM that were already included in the CAF source, but not in the one from Asus.
ANDROID: vmlinux.lds.h: merge compound literal sections · Skywalker-I005/[email protected]
After LLVM rG9e33c096476a ("[ELF] Keep orphan section names (.rodata.foo .text.foo) unchanged if !hasSectionsCommand"), LLD splits compound literals to separate sections with -fdata-secti...
github.com
Code:
commit 210ecf9a8921bccf197372da9a91efb8aa38202f
Author: Sami Tolvanen <[email protected]>
Date: Wed Nov 25 08:44:09 2020 -0800
ANDROID: vmlinux.lds.h: merge compound literal sections
After LLVM rG9e33c096476a ("[ELF] Keep orphan section names
(.rodata.foo .text.foo) unchanged if !hasSectionsCommand"), LLD splits
compound literals to separate sections with -fdata-sections, which
it always enables with LTO. Merge these sections to allow LLVM to be
upgraded.
Bug: 174047799
Change-Id: I858c5fcc48283d5528c1d3e2b2d7a3c72f9e03d6
Link: https://github.com/ClangBuiltLinux/linux/issues/958
Suggested-by: Danny Lin <[email protected]0n.dev>
Suggested-by: Fangrui Song <[email protected]>
Signed-off-by: Sami Tolvanen <[email protected]>
(cherry picked from commit 559c23e691b8d0b25b055ecdf4c07f19c8407794)
(cherry picked from commit 6f7ffcefc7b0ad82dbe0975057ea82b045abe160)
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index ef257c136f11..b5c86d85f7b3 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -72,10 +72,10 @@
#if defined(CONFIG_LD_DEAD_CODE_DATA_ELIMINATION) || defined(CONFIG_LTO_CLANG)
#define TEXT_MAIN .text .text.[0-9a-zA-Z_]*
#define TEXT_CFI_MAIN .text.[0-9a-zA-Z_]*.cfi
-#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..LPBX*
+#define DATA_MAIN .data .data.[0-9a-zA-Z_]* .data..L* .data..compoundliteral*
#define SDATA_MAIN .sdata .sdata.[0-9a-zA-Z_]*
-#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]*
-#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]*
+#define RODATA_MAIN .rodata .rodata.[0-9a-zA-Z_]* .rodata..L*
+#define BSS_MAIN .bss .bss.[0-9a-zA-Z_]* .bss..compoundliteral*
#define SBSS_MAIN .sbss .sbss.[0-9a-zA-Z_]*
#else
#define TEXT_MAIN .text
The techpack is only a stub and folder layout, but is also missing parts.
For anyone unfamiliar with Asus source, it may not be immediately obvious that there are four additional components that are required.
platform/vendor/qcom/opensource/datarmnet - Unnamed repository; edit this file 'description' to name the repository.
source.codeaurora.org
platform/vendor/qcom/opensource/datarmnet-ext - Unnamed repository; edit this file 'description' to name the repository.
source.codeaurora.org
platform/vendor/opensource/dataipa - Unnamed repository; edit this file 'description' to name the repository.
source.codeaurora.org
platform/vendor/opensource/sched - Unnamed repository; edit this file 'description' to name the repository.
source.codeaurora.org
Techpack for ZS673KS
Being new to Asus devices that use the techpack, I was curious if anyone knows where to find current techpack source with the relevant changes for this device. I have found versions that support other current Asus devices, but they do not include...
forum.xda-developers.com
The modules do collide, but can be built in hybrid fashion to overcome the issues.
Code:
CONFIG_TOUCHSCREEN_ROG=y
CONFIG_TOUCHSCREEN2_ROG=m
Code:
CONFIG_INPUT_SX932X=y
CONFIG_INPUT_SX932X_2ND=m
The easiest method for building the kernel is to make all modules inline (replace m with y).
Modules will still be unable to load on their own, since the signatures and versions may be off. That is why the verification needs to be disabled.
kernel/module.c: safely bypass sig, vermagic, modversion · Skywalker-I005/[email protected]
Contrary to common modifications that disable all checks entirely, we should still verify the integrity of modules that have not been signed by the manufacturer and may be versioned differently. We...
github.com
Code:
commit e009a01e9cf2f0c64a87b84b6986fff01e278b3f
Author: Abandoned Cart <***************@gmail.com>
Date: Thu Sep 16 12:16:03 2021 -0400
kernel/module.c: safely bypass sig, vermagic, modversion
diff --git a/kernel/module.c b/kernel/module.c
index ab50f522b662..b9bbde4ad512 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2925,6 +2925,11 @@ static int module_sig_check(struct load_info *info, int flags)
const char *reason;
const void *mod = info->hdr;
+#ifdef CONFIG_MODULE_FORCE_PASS
+ info->sig_ok = true;
+ return 0;
+#endif
+
/*
* Require flags == 0, as a module with version information
* removed is no longer the module that was signed
@@ -3274,10 +3279,12 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
err = try_to_force_load(mod, "bad vermagic");
if (err)
return err;
+#ifndef CONFIG_MODULE_FORCE_PASS
} else if (!same_magic(modmagic, vermagic, info->index.vers)) {
pr_err("%s: version magic '%s' should be '%s'\n",
info->name, modmagic, vermagic);
return -ENOEXEC;
+#endif
}
if (!get_modinfo(info, "intree")) {
@@ -3988,11 +3995,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
goto free_copy;
}
err = rewrite_section_headers(info, flags);
if (err)
goto free_copy;
@@ -4199,9 +4201,11 @@ SYSCALL_DEFINE3(finit_module, int, fd, const char __user *, uargs, int, flags)
pr_debug("finit_module: fd=%d, uargs=%p, flags=%i\n", fd, uargs, flags);
+#ifndef CONFIG_MODULE_FORCE_PASS
if (flags & ~(MODULE_INIT_IGNORE_MODVERSIONS
|MODULE_INIT_IGNORE_VERMAGIC))
return -EINVAL;
+#endif
err = kernel_read_file_from_fd(fd, &hdr, &size, INT_MAX,
READING_MODULE);
Restoring Stock / Rooted Boot Image
Boot / DTBO Images [Root / Stock] - 5 / Pro / Ultimate (NOT S)
These images are NOT built from source. These are the stock images from the firmware provided by Asus that are extracted with payload dumper and uploaded without modification. 18.0840.2202.231 18.0840.2201.226 18.0840.2112.211...
forum.xda-developers.com
Compiling on MacOS (Mojave or lower)
Skywalker-ZS673KS/build at master · Skywalker-I005/Skywalker-ZS673KS
Contribute to Skywalker-I005/Skywalker-ZS673KS development by creating an account on GitHub.
github.com
Custom Kernel Development on MacOS
[Kernel] (Anakin) Skywalker ZS673KS - Stable Gaming [3/31/2022]
This kernel is (just barely a little) experimental. Use at your own risk. Feel free to skip past the first 5 pages when reading over this thread. This kernel assumes a few things about you, the user: 1. You have a ROG Phone 5 2. You have read...
forum.xda-developers.com
Thanks!
This process was probably much easier for the last generation. I have never seen a manufacturer hand over a device without any resources for development.
This time around, it seems they haven't even kept the source updated (or at least updated the page to reflect that it hasn't changed). Hopefully that will change once the device releases in the US.
Post moved to https://forum.xda-developers.com/t/kernel-starkissed-zs673ks.4283585/
Updated to V18.0840.2104.50
Adding the compiler (based on the extracted ikconfig) that Asus used to build the kernel. This will be updated alongside the kernel.
Updated to V18.0840.2104.56
Edit: Apologies to anyone tracking for the delayed notification.
Updated to V18.0840.2106.86
Also adding the newest Magisk patched boot / vendor_ boot combo here, since this is updated for every firmware release.
Updated to V18.0840.2107.151
Rooted images also updated
Moved the stocked and rooted images to AndroidFileHost and their own thread to keep previous versions and make them easier to locate.
No changes for V18.0840.2107.157
Currently a CN exclusive firmware
Adding all of important details from the posts for getting the custom kernel to boot as a tutorial alongside the kernel source. See the second and third posts.
Updated to V18.0840.2109.176
Currently a CN exclusive again
The main repo is freshly rebuilt as a completely stock log, including empty commits. Each commit has been tagged with Asus support as the author. This should allow it to be used for updating custom kernels and tracking version changes completely separate from any custom code.
Hi bro can you check this one?
https://dlcdnets.asus.com/pub/ASUS/ZenFone/ZS673KS/ASUS_I005_1-18.0840.2107.157-kernel-src.tar.gz
Is it installable? How?
Just wanted to fix my wifi bro. The wifi stopped after the update that's why I'm frustrated
TOYOBHUMAX said:
Hi bro can you check this one?
https://dlcdnets.asus.com/pub/ASUS/ZenFone/ZS673KS/ASUS_I005_1-18.0840.2107.157-kernel-src.tar.gz
Is it installable? How?
Click to expand...
Click to collapse
That's source. It can't be installed. You build a kernel with it.
TOYOBHUMAX said:
Just wanted to fix my wifi bro. The wifi stopped after the update that's why I'm frustrated
Click to expand...
Click to collapse
Might want to try a factory reset. If that doesn't work, it may be a hardware issue.

Categories

Resources