yashsingh1/xdaforums huggingface dataset:
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=639326]CalcProgrammer1[/MENTION] and others

I do really appreciate your comments. Please forgive my ignorance in this area. I am about to say some stupiditty. jijijiji. I see you have point some concerned about " PowerVR" and "GPU acceleration". I just want to boot into Linux Distro as best at it can. Acceleration of any kind is not a priority. But if any driver limitation prevent us from displaying in a std mode then that can be a show stop.

I understood you say

Step one is to get a kexec-capable kernel working. Kexecboot is just a frontend for kexec..

1-Our Samsung Tab3 10.1 "OS Open source" is incomplete, that is why CM11 has been to slow on release. Still guys at "[SIGNUP] [DEVELOPMENT] signup sheet for aosp build team" had work hard to produce a pre-alpha.

2-Good news is that

Open Source

for the

Kernel

works fine

.

So can you pointing me in the right direction. How to build this " kexec-capable kernel". I had play with kernel build and even added some missing modules to have CIFS capability. SO compiling Kernel should not be hard for me.

Clearly adding "kexec" may not bee that easy. I am hoping to see an option in the building process.

kexec is a system call that enables you to load and boot into another kernel from the currently running kernel.

I had played some what with boot.img initramfs and hacked /init to do perform similar task.

!/sbin/busybox sh

# initramfs pre-boot init script

# Mount the /proc and /sys filesystems
/sbin/busybox mount -t proc none /proc
/sbin/busybox mount -t sysfs none /sys
/sbin/busybox mount -t tmpfs none /dev

# Something (what?) needs a few cycles here
/sbin/busybox sleep 1

# Populate /dev
/sbin/busybox mdev -s

# Mount the root filesystem, second partition on micro SDcard
/sbin/busybox mount -t ext4 -o noatime,nodiratime,errors=panic /dev/mmcblk1p2 /data/local/mnt/ubuntu

# Clean up
/sbin/busybox umount /proc
/sbin/busybox umount /sys
/sbin/busybox umount /dev

# Transfer root to SDcard
[COLOR="Red"]exec[/COLOR] /sbin/busybox [COLOR="Red"]switch_root[/COLOR] /data/local/mnt/ubuntu /etc/init.stage1]

This is a C& P from =>

As you see I take the second partition in External SDCARD "/dev/mmcblk1p2" and mounted in "/data/local/mnt/ubuntu" and transfer to a secondary init in Ubuntu with "exec switch root".

[COLOR="Red"]exec[/COLOR] /sbin/busybox [COLOR="Red"]switch_root [/COLOR]/data/local/mnt/ubuntu /etc/init.stage1

I guess this exec switch root is performing similar function as "kexec"

Can we work with this? -> Edited: I had already compile kexec in kernel.

Any help will be really really appreciated. Thanks.
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=639326]CalcProgrammer1[/MENTION]

Ok

First step DONE!

I had compiled a new kernel with kexec. kexec stock from Kernel, just enabled. Do not know about hardboot but willing to see the patch!.

Listen Arm/mips/x86 should be the same kernel(clearly on same kernel number!). So, arm should not matter. Any way the code for kexec seems small enogth to compare with yours.

One thing I have to mention I am working with 4.2.2 since it is less molested by SELinux protection.

What is next step? Pleaseeeeeee.
[Galaxy Tab 3 General] workdowg:
[MENTION=4582979]JoinTheRealms[/MENTION] [MENTION=1626944]cogano[/MENTION] [MENTION=890183]jcfunk[/MENTION] any kexec help or advice for these guys?
[Galaxy Tab 3 General] r2d23cpo:
[MENTION=3971563]workdowg[/MENTION] [MENTION=4582979]JoinTheRealms[/MENTION] [MENTION=1626944]cogano[/MENTION] [MENTION=890183]jcfunk[/MENTION]

Wao pretty nice string of mention jijiji. Do not feel obligated, but any help really appreciated.

Listen guys do not feel ignore but since [MENTION=639326]CalcProgrammer1[/MENTION] first approach me, I am trying to follow his work at [UTIL] Kexecboot Bootloader for Galaxy Note i717 - Boot Multiple Kernels. Still I you point me to another one I will gladly read on it.

So I build a kernel with kexec enabled! Will that maters or I need to compile one kexec from source?

Next I had downloaded your kernel_kexecboot_quincyatt_v2.zip and open the initramfs. Also compare it to your source. Looks similar. I see I need the following files:

ramdisk/bin/busybox need to veryfy my busybox compitibility but ok in general
ramdisk/bin/[COLOR="Blue"]kexecboot[/COLOR]
ramdisk/bin/[COLOR="Blue"]lvm[/COLOR]
ramdisk/bin/sh->busybox should be ok

ramdisk/bin/[COLOR="Blue"]tssrv[/COLOR]
ramdisk/sbin/kexec
ramdisk/sbin/[COLOR="Blue"]refresh[/COLOR]

ramdisk/init -> it is a sh script ok

So assuming my enabled kexec is ok for now, I also need to compiled kexecboot, lvm, tssrv, refresh but I have no source for lvm, tssrv, refresh.

Where can I get sources for: lvm, tssrv, refresh? I will check if lvm and tssrv may be part of any busybox, toolbox or recovery I have around.

Files from CalcProgrammer1 project "[UTIL] Kexecboot Bootloader for Galaxy Note i717 - Boot Multiple Kernels."

h__ps://github.com/CalcProgrammer1/kernel_quincyatt_kexec

h__ps://mega.co.nz/#F!0ct3EaTD!wHWnGo1M_2smyKdzGMIYmw
[Galaxy Tab 3 General] moonbutt74:
r2,

chroot to your distro and run in terminal

apt-get update

apt-get install gcc gcc-4.7

check /etc/apt/sources.list to see if you have source repositories entries, for example [in debian]

deb-src http://ftp.us.debian.org/debian/ wheezy main

your distro will vary, then

apt-cache search lvm <-----and so forth for every package you need from [src] and compile right on your tab natively

i've been doing this on arm, the end/native result should be similar. Be aware you may need to establish a repository locally for your

kernel source in case you need to generate headers for your toolchain

cd [kernel-source-$TOP]

make mrproper

make ARCH=x86 [correct_defconfig]

make ARCH=x86 headers_check

make ARCH=x86 [your toolchain's correct location for]/sysroot/usr headers_install

with your mount points correct for your ubuntu project you should be able to do all that via terminal.

m
[Galaxy Tab 3 General] CalcProgrammer1:
You don't need them. My sloppy work is showing lol. I took most of that from another kexecboot from the HP TouchPad. Chances are your Tab3 doesn't use LVM, though the TouchPad did so that's where that came from. You can remove it.

The tssrv binary is the userspace HP TouchPad touchscreen driver. Most tablets and phones have a kernelspace touchscreen driver, so you can just remove this (plus kexecboot isn't touch driven anyways).

Refresh was something I was testing for my Note 3, as it uses a software-refreshed panel. If your Tab3 uses a video mode panel you won't need a software refresher but if it does, well, you may run into an issue that I don't know about as refreshing seems SoC-specific and I'm only used to Qualcomm chips. Remove it for now as well.
[Galaxy Tab 3 General] r2d23cpo:
Wao spent over 18 consecutive hours, I had to sleep. I had trouble always with this so call automatic makefile that never work!! It is simpler to create my own makefile and adjust, ad subtract commands as it show error.

So I am working. just having some programing issues that do not let me go at a better speed. See you latter friends.

IMPORTANT:

PLEASE if you downloaded the zimage I have previously gave link,

DO NOT USED IT

.

Yes it has KEXEC Enabled 100%. BUTTTTT, I did something wrong in the selection that prevent WIFICommunication!!! You been warned. If you had such an accident, Use Odin To reinstall a good Booot Image or a zip package using the External SDCARD. If You need help please ask. But As I said I am going to sleep now.
[Galaxy Tab 3 General] rjmm13:
Congratulations, it´s a very useful idea and i hope it gets developed :) Good luck!
[Galaxy Tab 3 General] r2d23cpo:
Good morning Folks! It is 12:07AM in the Atlantic Zone with a nice star sky.

So after 322 views and 11 replys [MENTION=6181515]rjmm13[/MENTION] is our first non-developer that had show and post interest. Congratulations! [Applause ]

And we are ready do some more tests today.

To my friends with the right knowledge I need the full kexec instruction I will use to boot Ubuntu. From the Ubuntu manuals it seems some thing like:

kexec -l /boot/vmlinux --append=root=/dev/hda1 --initrd=/boot/initrd

For now I am using [MENTION=639326]CalcProgrammer1[/MENTION] work on Galaxy Note i717. init shows he mounted proc, sys & dev. I had place or should I say extracted Ubuntu in my 2nd ext4 partition on the external SdCard or partition "/dev/mmcblk1p2" So I guess my command should look like

kexec -l /boot/vmlinux --append=root=/dev/mmcblk1p2 --initrd=/boot/initrd

But I wonder, that partition is not mounted!!!! Or I am wrong.

My other Option will be to mount mmcblk1p2 in /data/local/mnt/ubuntu

Then partial code may looks like:

busybox mount -t ext4 /dev/block/mmcblk1p2 /data/local/mnt/ubuntu
kexec -l /boot/vmlinux --append=root=/data/local/mnt/ubuntu --initrd=/boot/initrd

So witch one is the good command sequence?

------------------------------------------------------------------------------

Edited.

To [MENTION=5864662]moonbutt74[/MENTION] I have not ignored you in try to build on same TAB3 device. But If I do then I will have to worry about backing up every time I have to do test on TAB3!!

Listen I am having troubles compiling automated makefiles. So I recall your comments. And I am up to building kexec-tools with same Ubuntu deb packages. That should be pretty easy.

I have Ubuntu amd64 desktop but I will try to install i386 debs for maximum compatibility! Just as a test.

apt-get update
apt-get install kexec-tools_2.0.2-3ubuntu4_i386

Do you know if there is a way to then force my out kernel source to used Ubuntu Desktop files? I know may sound stupid.

Now regards

cd [kernel-source-$TOP]
make mrproper
make ARCH=x86 [correct_defconfig]
make ARCH=x86 headers_check
make ARCH=x86 [your toolchain's correct location for]/sysroot/usr headers_install

What "make mrproper" commads do?

What "correct_defconfig" do you used?

"make ARCH=x86 [your toolchain's correct location for]/sysroot/usr headers_install" I do not recalled doing this And I compiled it ok. What the kernel sources ask was to edit a config file and add my tool location?

Thanks body. Take your time I know you are busy in your own projects.
[Galaxy Tab 3 General] r2d23cpo:
I am doing it again, making a full conversation my self! jijijiji

[MENTION=5864662]moonbutt74[/MENTION] you are genius, if I run Ubuntu in a VNC server in TAB3, I can work in my PC. And walaaaaa! I am in fact running from external sdcard partition. I do not have to worry about backup!!! As always you are the man.

With the advantage that the code generated by Ubuntu should be 100% compatible with TAB310.1 x86.

In the future I do really have to look more deep in your comments.

I will test to see how it goes.

I waist 7 hours doing some needed backup, my desktop was getting low in memory. Almost lost my files due to corruption. But I am back.

So I tested leaving the tablet as Ubuntu VNC Server and works but I still think is slow. But I do not need VNC.!!! Nor the GUI.

I had recall installing "shh" previously in my Ubuntu, So I can just do Putty "shh" in Win7 and it works much better!!! In fact I can just use WinSCP also to even load or take files easily from the TAB3 Ubuntu system file. Thanks body for the Idea.

Now then I will start doing what you did a week ago, Installing inside the Tab310.1 the SDK toolchain, platform and the Kernel source just in case I need it. I know I am continue wasting more time without doing real-work on kexecboot. But if it works I will improve my developing speed in the future. I hope to report soon.
[Galaxy Tab 3 General] CalcProgrammer1:
1. The root= option will automatically mount that given device as the root partition (aka /). If you use root= you do not need an initramfs at all, because the kernel will mount the partition and run the /init script automatically. If you don't use a root= command or wish to run more complex boot sequences, then you will need an initramfs. In that case, the initramfs gets mounted as / and then must do its own work to mount the real root partition and do switch_root to replace the temporary initramfs root with the new proper root partition.

2. "make mrproper" is a better version of "make clean". It basically resets your entire kernel build to a clean state. Do this if you want to make sure your build is pure rather than reusing already-compiled temporary files.

3. You must create your own defconfig since you're using a new device. Use make menuconfig to edit your .config file to how you like it, then copy it to arch/<architecture>/configs/your_defconfig_name and then you will be able to use make your_defconfig_name to setup your .config file each time you want to rebuild it. I think x86 is "i386" in the tree, ARM is "arm".

4. If you're building for an x86 device on another x86 device you should just be able to make without the ARCH or CROSS_COMPILE flags. If you're using an x86_64 machine you'll want to set up a 32-bit chroot or something though if you want to build a 32-bit kernel. If you're building for ARM on an x86/amd64/anything-else-not-arm machine then you have to do ARCH=arm CROSS_COMPILER=name-of-your-arm-toolchain- so it builds it with the cross compiler.
[Galaxy Tab 3 General] moonbutt74:
hey guys,

just a quick note in reference to,

that is true if you are building/compiling natively on this tab. However if you are compiling on a pc [x86][x86_64} you do need to cross compile and pass flags.

The reason is you need to link [for some reason] with ld.gold for the binary to execute else you get the bad/incorrect/invalid magic error.

If building on pc for this tab through buildroot set arch for i386 and arch variant for i686. for building through gcc on your own makefile recipe

you will need to pass the following flags for CFLAGS , CXXFLAGS and LDFLAGS ; -m32 -static, and pass/export ARCH=x86,this goes for building on 32bit or 64bit pc.

m
[Galaxy Tab 3 General] r2d23cpo:
Nicessss, I was looking for that. So it does not requires the "toolchain" other that really compiling on a desire vesrion number. Did I understood correct or I need to setup toolchain some where? What about gcc on the Ubuntu?

What I do is create my own Makefile like

NDKROOT=/home/<username>/bin/androidndk
NDKSYSROOT=$(NDKROOT)/platforms/android-8/arch-x86
TOOLCHAIN := $(NDKROOT)/toolchains/x86-4.6/prebuilt/linux-x86
CC := $(TOOLCHAIN)/bin/i686-linux-android-gcc

#INCLD_DIR := $(TOOLCHAIN)/usr/include
INCLD_DIR := $(TOOLCHAIN)/include
LIB_DIR := $(TOOLCHAIN)/lib
#LIBS = -L$(LIB_DIR)

TARGET := kexecboot
#CFLAGS := -Wall
CFLAGS = -DNO_MNTENT -UHAVE_ICONV -DNO_MALLINFO=1 \
--sysroot=$(NDKSYSROOT) \
-isystem $(NDKSYSROOT) \
-I$(NDKSYSROOT)/usr/include \
-mandroid \
-D_GNU_SOURCE=1 \
-L$(NDKSYSROOT)/usr/lib

#	-I$(NDKSYSROOT)/usr/include/sys \
#	-I$(NDKSYSROOT)/usr/include/linux \

LDFLAGS := -L$(TOOLCHAIN)/lib -Wl,-rpath-link $(TOOLCHAIN)/lib

SRCS := $(TARGET).c util.c cfgparser.c devicescan.c evdevs.c fb.c gui.c \
menu.c xpm.c rgb.c tui.c fstype/fstype.c machine/zaurus.c

OBJS := $(TARGET).o util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o \
menu.o xpm.o rgb.o tui.o fstype.o
#OBJS := util.o cfgparser.o devicescan.o evdevs.o fb.o gui.o \
#	menu.o xpm.o rgb.o tui.o fstype.o zaurus.o
LIBS := -L$(LIB_DIR)
#-lutil -lpthread

$(TARGET): $(OBJS)
#	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) $(TARGET).c -o $(TARGET)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)

$(TARGET).o: $(TARGET).c $(TARGET).h
$(CC) $(CFLAGS) -c $(TARGET).c
util.o: util.c util.h
$(CC) $(CFLAGS) -c util.c
cfgparser.o: cfgparser.c cfgparser.h
$(CC) $(CFLAGS) -c cfgparser.c
devicescan.o: devicescan.c devicescan.h
$(CC) $(CFLAGS) -c devicescan.c
evdevs.o: evdevs.c evdevs.h
$(CC) $(CFLAGS) -c evdevs.c
fb.o: fb.c fb.h
$(CC) $(CFLAGS) -c fb.c
gui.o: gui.c gui.h
$(CC) $(CFLAGS) -c gui.c
menu.o: menu.c menu.h
$(CC) $(CFLAGS) -c menu.c
xpm.o: xpm.c xpm.h
$(CC) $(CFLAGS) -c xpm.c
rgb.o: rgb.c rgb.h
$(CC) $(CFLAGS) -c rgb.c
tui.o: tui.c tui.h
$(CC) $(CFLAGS) -c tui.c
fstype.o: fstype/fstype.c fstype/fstype.h
$(CC) $(CFLAGS) -c fstype/fstype.c
#zaurus.o: machine/zaurus.c machine/zaurus.h
#	$(CC) $(CFLAGS) -c machine/zaurus.c

clean:
rm -f *.o *~ $(TARGET)

By the way, my Kernel Build took 2 hours on the TAB310.1. Now I need to test it.
[Galaxy Tab 3 General] moonbutt74:
r2,

hi,

if compiling on the tab for the tab [natively through tab's ubuntu distro], compile straight and you should be good to go.

if compiling outside the tab [host/build] for the tab [target] [cross compile], then yes you need to pass flags and such.

For my experiments when i had the tab, i first built my toolchain through the 32bit version of android ndk and geared to

jellybean api.

In my makefile the flags i included were

CFLAGS := -m32

LDFLAGS := -static <------this is/can be optional, i like static binaries for portability reasons.

on -Wall , i usually leave that on.

on -werror, i usually turn that off.

m
[Galaxy Tab 3 General] r2d23cpo:
Wao still tryint to leave the Starting Line but one after the other. jijiji

But Good news. To strip out all problems I decided to start from scrach. And after loking at the config as it is I found that kexec was set to enable from the beguining.

hsbadr said in his thread [KERNEL] [KEXEC] Kernel EXECution for locked devices [N900V] [WIP] to check kexec by doing cat /proc/kallsyms | grep kexec

and here is the output of the system calls:

root@android:/ # cat /proc/kallsyms | grep kexec
00000000 t machine_kexec_page_table_set_one
00000000 t machine_kexec_free_page_tables
00000000 T machine_kexec_prepare
00000000 T machine_kexec_cleanup
00000000 T machine_kexec
00000000 T log_buf_kexec_setup
00000000 W compat_sys_kexec_load
00000000 t kexec_crash_loaded_show
00000000 t kexec_loaded_show
00000000 t kexec_crash_size_store
00000000 t kexec_crash_size_show
00000000 T kexec_should_crash
00000000 T sys_kexec_load
00000000 T crash_kexec
00000000 T kernel_kexec
00000000 d kexec_loaded_attr
00000000 d kexec_crash_loaded_attr
00000000 d kexec_crash_size_attr
00000000 d event_exit__kexec_load
00000000 d event_enter__kexec_load
00000000 d __syscall_meta__kexec_load
00000000 d kexec_mutex
00000000 d types__kexec_load
00000000 d args__kexec_load
00000000 t __event_exit__kexec_load
00000000 t __event_enter__kexec_load
00000000 t __p_syscall_meta__kexec_load
00000000 B in_crash_kexec
00000000 B kexec_crash_image
00000000 B kexec_image
root@android:/ #
[Galaxy Tab 3 General] r2d23cpo:
CalcProgrammer1

Listen I also need more help with configuration files. It get e confused.

From what I see the configuration file I think is "boot.cfg"

I could not make the autoconfiguartion work. Spent to much time on it allready. So I will go with a manual Makefile. Now this brings a problem. There are desition or even selected subroutines that are skip or selected depending in a set of Define Variables. There are many from what I see the minimum I need to compile are. PLease see that I did not said TO WORK correctly. This are

/* confdefs.h */
#define PACKAGE_NAME "kexecboot"
#define PACKAGE_TARNAME "kexecboot"
#define PACKAGE_VERSION "0.6"
#define PACKAGE_STRING "kexecboot 0.6"
#define PACKAGE_BUGREPORT "kexecboot-devel@linuxtogo.org"
#define PACKAGE_URL ""
#define KEXEC_PATH "/usr/sbin/kexec"
#define UBIATTACH_PATH "/usr/sbin/ubiattach"

Now auto make seems to store then in "confdefs.h". To mi this is the weirdest thing I ever seen. Auto Make creating Header Files to be used in compilation. I guess I need to learn a lot. jijiji.

For now I have them store in config.h, witch the files requested but it is not in the source!!!! jijiji another strange thing. In any case can you post here what do you used in your image As an Example. I guess on keexecboot you can drop to ash. I guess you can then look at it.
[Galaxy Tab 3 General] r2d23cpo:
I see yesterday was quiet no responses. That is Ok. Sundays should always be dedicated to the God of your preference and to your Family.

[MENTION=5864662]moonbutt74[/MENTION]

Listen I will like to see how any of the improved recoveries does make to manage screen output. And since you are the lucky guy that help us in that development. I know DutchDanny & trevd did gave us the very first cwm recovery, thank to them too.

In any case, now that you have sell or give away your TAB310.1 can you post your Sources. I guess will be nice to ask for inclusion in their respective Official Sites. That is just a suggestion.

So yes I will like to see how any of the recoveries that you help build us, do setup the Screen for Output. Did you yourself had this problem?

1) That the watchdogd and uevend are simlink to init. So if we removed init or change it first we observe that the tablet reboots for ever. Then If I provide a solution to that then the Tab get stock in Samsung TAB3 screen.

2) Did you turn off the whatchdogd off? What is the command to turn whatchdogd off?

I know I did recall you telling me to let init do all the init.*.rc first before doing anything!

I will check that to, in fact I will look for "pvr" in all *.rc that I find not in boot.init but in recovery.img.

As always to both of you and any other. Help me when you can. Do your stuff first. Then you can come by to check on this poor learning programmer. I know all this is because the bone is to big for my teeth but thats life.
[Galaxy Tab 3 General] :
r2,

i am at a bit of a disadvantage, not owning the tab anymore, am working on getting another one.

for watchdog, i believe it can be disabled/deactivated in the kernel source;

after you establish you build/compile setup, run

make menuconfig

once in the program, use the search function

/

and enter the string you want to search, in this case;

watchdog

as to the recovery source for philz https://github.com/PhilZ-cwm6/philz_touch_cwm6

you will need to have your build system set up, cm11

my thought is modifying libtouchgui and the recovery's interface [maybe] to that end i am pretty much guessing.

Get in touch with [MENTION=1649190]Angel_666[/MENTION] and [MENTION=4479363]Hazou[/MENTION] to find out what patches to cm11 and recovery source you will need.

An interesting note concerning this tab is that you can interchangeably flash either boot/recovery .img's to boot/recovery partition.

Meaning, with the image packed to flash to the appropriate block you can write your test recovery.img to the boot.img's partition and vice-versa.

so you could actually have a full boot.img in both boot AND recovery.

In some way, I believe, your are tied to the android kernel and ueventd, if I find out more about that , I will post.

On a side note, jf you are encountering TERM not set error/message while in chroot, add the following line to you bash.rc at the bottom;

export TERM=linux

m
[Galaxy Tab 3 General] r2d23cpo:
jijijii This is funny, I love to chat with you. I went back to my original work in the previous thread. Using A modify Recovery as a boot.img. In fact I am doing some test on it. And here you go and post that. I guess we are in the same page. I know I ask you for the Sources. I bet that makes you remember the recovery on boot.

Now why are you getting a P5210 again? That is strange? I only could imaging that you want to Play with this. But you had told me before you are really busy in you projects. huummm.

That is phil's github! I thought you did something spacial to tweak so that recoveries did not have lags!! Do not bother with that any way, Lets see what comes with your Idea of hacking after init.rc perform its settings. I will report what I find. I am using your cwm-6.0.50-gt-p5210-v2-alien as a base boot image, just not calling "recovery service".