PDA

View Full Version : do I need to build a custom kernel?



CurioCT
2019-08-11, 21:03
Hi Guys,

I had an old nexus 7 2012 knocking around so I decided to have a play

realised quickly no newer version of Kali would work with the old kernel so I used the unlegacy nougat rom with a 3.4 kernel

flashed magisk and gapps and a couple of magisk nethunter modules

everything worked a charm using minimal chroot

got apt running no worries did the usual apt-get update && apt-get upgrade -y && apt-get dist-upgrade

rebooted
did apt-get install kali-linux-all -y
ages later everything finish bar the linux header, once I created a couple of folder for these they installed fine.

go me

except when I start to try using some basics all sorts of problems

postgresql seems to have a shared memory issue

/etc/init.d/postgresql start
returns No PostgreSQL clusters exist


pg_createcluster 11 main --start
returns FATAL: could not create shared memory segment :Function not implemented


sysctl -w kernel.shmmax=268435456
returns cannot stat /proc/sys/kernel/shmmax: No such file or directory

nmap -A x.x.x.x
reboots the device completely no error returned first (get the first line of a normal nmap run first then reboot)

finally whilst the vncserver runs ok (tight) the desktop delivered lacks all the tools menus (seems like some old throw back with a very few menu items that actually relate to kali) not really had much of a play with that save changing a few lines in /root/.vnc/xstartup with little effect


The postgresql issue seemed like a kernel image issue so i did a bit of googling found the git hub and the python script and the cross compiler githubs downloaded all that and the kernel builds etc something like 6GB worth on a full kali vm went to build the kernel (after the bootstrap.sh by running the python script) before realising there are no kernel configs for grouper for nougat

So ... I am wondering if it is even possible to get the latest version of kali working on an old grouper device. so I have a few questions

1. would the lack of linux headers during the build (apt-get install kali-linux-full) have made any difference
2. has anyone successfully done a build with any grouper rom with a 3.4 kernel? if so which ones?

going to retry the minimal chroot again tonight making sure I get the linux headers right before anything this time.

If I download a kitkat rom with 3.4 kernel will I be able to use the nethunter install scripts with it?
If not where would I look to build something from scratch? or does anyone have any other suggestions

pretty close to just buying a nexus 9 :)

re4son
2019-08-13, 00:53
Holy moly! Respect - most people would have given up a long time ago :-)

Before we get too far into building a new kernel, I'd sugest you install a nethunter image without kernel first and check the device performance. If that works properly we can add the kernel.
Here the steps to create your own image:
https://gitlab.com/kalilinux/nethunter/build-scripts/kali-nethunter-project/wikis/Building-Nethunter


To build an image without kernel just run:
python build.py -l -nk -d grouper -fs full -r 2019.2-grouper


How does that sound?

CurioCT
2019-08-13, 08:35
So flash a lollipop rom, gapps (pico), magisk etc then this ok will give that a crack

Thanks for the respect, Yeah not my first rodeo, back in the day I tried unsuccessfully to compile kernels to enable monitor mode for USB. The kernels worked but the USB support didn't I suspected at the time that the android sources for the S2 didnt support it this was back before kitkat. though I have to confess it's been a long time since I did this hence coming here first :)

just building the image and grabbing the loolipop rom will let you know

euphoria360
2020-08-16, 06:21
Hello there. I'm trying to do the same on my old Nexus 7 lying around gathering dust.
Did you manage to do this? Were you successful on making an up to date Kali image for your grouper and successfully boot and use it?

munawar02584
2023-07-21, 08:08
Hi Guys,

I had an old nexus 7 2012 knocking around so I decided to have a play

realised quickly no newer version of Kali would work with the old kernel so I used the unlegacy nougat rom with a 3.4 kernel

flashed magisk and gapps and a Archerypick (https://archerypick.com/best-crossbow-under-500/)couple of magisk nethunter modules

everything worked a charm using minimal chroot

got apt running no worries did the usual apt-get update && apt-get upgrade -y && apt-get dist-upgrade

rebooted
did apt-get install kali-linux-all -y
ages later everything finish bar the linux header, once I created a couple of folder for these they installed fine.

go me

except when I start to try using some basics all sorts of problems

postgresql seems to have a shared memory issue

/etc/init.d/postgresql start
returns No PostgreSQL clusters exist


pg_createcluster 11 main --start
returns FATAL: could not create shared memory segment :Function not implemented


sysctl -w kernel.shmmax=268435456
returns cannot stat /proc/sys/kernel/shmmax: No such file or directory

nmap -A x.x.x.x
reboots the device completely no error returned first (get the first line of a normal nmap run first then reboot)

finally whilst the vncserver runs ok (tight) the desktop delivered lacks all the tools menus (seems like some old throw back with a very few menu items that actually relate to kali) not really had much of a play with that save changing a few lines in /root/.vnc/xstartup with little effect


The postgresql issue seemed like a kernel image issue so i did a bit of googling found the git hub and the python script and the cross compiler githubs downloaded all that and the kernel builds etc something like 6GB worth on a full kali vm went to build the kernel (after the bootstrap.sh by running the python script) before realising there are no kernel configs for grouper for nougat

So ... I am wondering if it is even possible to get the latest version of kali working on an old grouper device. so I have a few questions

1. would the lack of linux headers during the build (apt-get install kali-linux-full) have made any difference
2. has anyone successfully done a build with any grouper rom with a 3.4 kernel? if so which ones?

going to retry the minimal chroot again tonight making sure I get the linux headers right before anything this time.

If I download a kitkat rom with 3.4 kernel will I be able to use the nethunter install scripts with it?
If not where would I look to build something from scratch? or does anyone have any other suggestions

pretty close to just buying a nexus 9 :)


Hardware Support: If you have very new or rare hardware that is not fully supported by the default kernel, building a custom kernel with the necessary drivers or configurations may be necessary to ensure proper hardware functionality.

Performance Optimization: In certain situations, you might want to fine-tune the kernel to optimize performance for specific workloads or hardware configurations.

Custom Features: Building a custom kernel allows you to enable or disable specific features, subsystems, or options based on your requirements, potentially reducing the kernel size and minimizing security risks.

Security Patching: If you need to apply specific security patches or updates to the kernel that are not yet included in the default distribution, building a custom kernel can help you apply those patches directly.

Embedded Systems: For embedded systems or specialized environments, a custom kernel might be necessary to achieve a minimal footprint or tailor the kernel to specific hardware constraints.

Kernel Development: If you are a kernel developer or enthusiast, building a custom kernel is essential for experimentation, testing new features, and contributing to kernel development.