OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Need cross compile tutorials.
cain2pang
post Sep 17 2019, 08:07 PM
Post #1





Group: Members
Posts: 11
Joined: 16-September 19
From: China
Member No.: 855,729



Hi, I'm trying to build linux kernel for c3100, can anybody give me some cross compile tutorials.

Thanks in advance
Go to the top of the page
 
+Quote Post
Varti
post Sep 18 2019, 03:58 AM
Post #2





Group: Admin
Posts: 931
Joined: 30-April 08
From: Italy
Member No.: 21,713



Hi, you should ask for help to our Zaurus kernel expert, greguu. Why would you want to compile it yourself btw, is there any feature or module in the current kernel which you need and is missing?

Varti
Go to the top of the page
 
+Quote Post
cain2pang
post Sep 18 2019, 09:21 PM
Post #3





Group: Members
Posts: 11
Joined: 16-September 19
From: China
Member No.: 855,729



QUOTE(Varti @ Sep 18 2019, 07:58 PM) *
Hi, you should ask for help to our Zaurus kernel expert, greguu. Why would you want to compile it yourself btw, is there any feature or module in the current kernel which you need and is missing?

Varti

em.... Just wanna try. I'm free recently, have a lot time to try something.
Go to the top of the page
 
+Quote Post
greguu
post Sep 23 2019, 09:43 PM
Post #4





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(cain2pang @ Sep 19 2019, 05:21 PM) *
QUOTE(Varti @ Sep 18 2019, 07:58 PM) *
Hi, you should ask for help to our Zaurus kernel expert, greguu. Why would you want to compile it yourself btw, is there any feature or module in the current kernel which you need and is missing?

Varti

em.... Just wanna try. I'm free recently, have a lot time to try something.

I switched to Void Linux for building some time ago. You can find my kernel build template here:https://github.com/greguu/voidz-packages/tree/voidz-packages-v03-(build8)/srcpkgs/linux5.0-zaurus
I would recommend to use Void Linux 64 bit musl as a build host for building voidz rootfs images and packages.
You find some instructions on how to build using xbps-src here: https://github.com/greguu/voidz-packages
You can also build the kernel under Arch Linux. For this get the ArchLinuxARM toolchain for armv5tel.https://archlinuxarm.org/builder/xtools/x-tools.tar.xz
Then get the kernel src 5.0.0 and patch it with the patches provided under my void template.
or write a pkgbuild file to apply the patches.
"Manual" cross-compile you can do with a wrapper bash/sh file like this:
CODE
export ARCH=arm export PATH='/usr/local/x-tools/arm-unknown-linux-gnueabi/bin':$PATH export CROSS_COMPILE=arm-unknown-linux-gnueabi- export STAGING_DIR=/usr/local/x-tools/arm-unknown-linux-gnueabi export CC=arm-unknown-linux-gnueabi-gcc export LD=arm-unknown-linux-gnueabi-ld export TARGET=arm export HOSTCC=gcc
make -j4 "$1"



Go to the top of the page
 
+Quote Post
cain2pang
post Sep 23 2019, 10:44 PM
Post #5





Group: Members
Posts: 11
Joined: 16-September 19
From: China
Member No.: 855,729



Thanks greguu.

My target is to write a detailed document to help anothers to build a Linux distribution by themself, include boot loader, kernel and rootfs.

I had built the linux 5.0 kernel successfully with the config file and patch files in https://github.com/greguu/voidz-packages/tr...linux5.0-zaurus, and it works well with the ZALARM rootfs which provide by you. Many thanks.

Now I'm trying to build the kexecboot, here are the steps I'm working on:

1. build kexecboot
2. make a initramfs with the kexecboot in step one and kexec.
3. build the linux kernel zImage with the initramfs in step two.

Are the steps correct?
Go to the top of the page
 
+Quote Post
cain2pang
post Sep 25 2019, 08:00 PM
Post #6





Group: Members
Posts: 11
Joined: 16-September 19
From: China
Member No.: 855,729



QUOTE(greguu @ Sep 24 2019, 01:43 PM) *
QUOTE(cain2pang @ Sep 19 2019, 05:21 PM) *
QUOTE(Varti @ Sep 18 2019, 07:58 PM) *
Hi, you should ask for help to our Zaurus kernel expert, greguu. Why would you want to compile it yourself btw, is there any feature or module in the current kernel which you need and is missing?

Varti

em.... Just wanna try. I'm free recently, have a lot time to try something.

I switched to Void Linux for building some time ago. You can find my kernel build template here:https://github.com/greguu/voidz-packages/tree/voidz-packages-v03-(build8)/srcpkgs/linux5.0-zaurus
I would recommend to use Void Linux 64 bit musl as a build host for building voidz rootfs images and packages.
You find some instructions on how to build using xbps-src here: https://github.com/greguu/voidz-packages
You can also build the kernel under Arch Linux. For this get the ArchLinuxARM toolchain for armv5tel.https://archlinuxarm.org/builder/xtools/x-tools.tar.xz
Then get the kernel src 5.0.0 and patch it with the patches provided under my void template.
or write a pkgbuild file to apply the patches.
"Manual" cross-compile you can do with a wrapper bash/sh file like this:
CODE
export ARCH=arm export PATH='/usr/local/x-tools/arm-unknown-linux-gnueabi/bin':$PATH export CROSS_COMPILE=arm-unknown-linux-gnueabi- export STAGING_DIR=/usr/local/x-tools/arm-unknown-linux-gnueabi export CC=arm-unknown-linux-gnueabi-gcc export LD=arm-unknown-linux-gnueabi-ld export TARGET=arm export HOSTCC=gcc
make -j4 "$1"



Hi greguu

I want to build Kexecboot with linux 5.0, but I don't know how to start, the wiki in https://github.com/kexecboot/kexecboot/wiki is too old and I don't want to use OpenEmbedded.
Can you give me some tutorials how to start the work?

Thanks.
Go to the top of the page
 
+Quote Post
greguu
post Sep 25 2019, 10:42 PM
Post #7





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(cain2pang @ Sep 26 2019, 04:00 PM) *
Hi greguu

I want to build Kexecboot with linux 5.0, but I don't know how to start, the wiki in https://github.com/kexecboot/kexecboot/wiki is too old and I don't want to use OpenEmbedded.
Can you give me some tutorials how to start the work?

Thanks.


Hi cain2pang,
I am not sure you will get a 5.0.0 kernel kexecboot to work without taking out some features from the kernel config.
The last version I build was using 4.14 kernel.After that version the kexec kernel got too large to fit in the Zaurus kernel partition. sad.gif
This is the latest kexecboot kernel. https://github.com/greguu/voidz-packages-ol...execboot.tar.xz
I need to check my build server and get the .config file and patches for the kexecboot kernel. Its the same source as https://github.com/greguu/linux-4.14.18-c3x00 but does need a different .config and initramfs.cpio containing kexecboot.

Do you want to rebuild kexecboot as well or just the kernel ?
Cheers!

This post has been edited by Varti: Sep 25 2019, 11:31 PM
Reason for edit: Removed most of the quoted text.
Go to the top of the page
 
+Quote Post
greguu
post Sep 25 2019, 11:07 PM
Post #8





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(greguu @ Sep 26 2019, 06:42 PM) *
Hi cain2pang,
I am not sure you will get a 5.0.0 kernel kexecboot to work without taking out some features from the kernel config.
The last version I build was using 4.14 kernel.After that version the kexec kernel got too large to fit in the Zaurus kernel partition. sad.gif
This is the latest kexecboot kernel. https://github.com/greguu/voidz-packages-ol...execboot.tar.xz
I need to check my build server and get the .config file and patches for the kexecboot kernel. Its the same source as https://github.com/greguu/linux-4.14.18-c3x00 but does need a different .config and initramfs.cpio containing kexecboot.

Do you want to rebuild kexecboot as well or just the kernel ?
Cheers!



Attached the 4.14.18 kernel .config for void linux kexecboot and the initramfs. This should help you get going.
Source is same as https://github.com/greguu/linux-4.14.18-c3x00

This post has been edited by Varti: Sep 25 2019, 11:32 PM
Reason for edit: Removed most of the quoted text.

Attached File(s)
Attached File  kexecboot.tar.gz ( 82.08K ) Number of downloads: 4
 
Go to the top of the page
 
+Quote Post
cain2pang
post Sep 25 2019, 11:21 PM
Post #9





Group: Members
Posts: 11
Joined: 16-September 19
From: China
Member No.: 855,729



QUOTE(greguu @ Sep 26 2019, 02:42 PM) *
Hi cain2pang,
I am not sure you will get a 5.0.0 kernel kexecboot to work without taking out some features from the kernel config.
The last version I build was using 4.14 kernel.After that version the kexec kernel got too large to fit in the Zaurus kernel partition. sad.gif
This is the latest kexecboot kernel. https://github.com/greguu/voidz-packages-ol...execboot.tar.xz
I need to check my build server and get the .config file and patches for the kexecboot kernel. Its the same source as https://github.com/greguu/linux-4.14.18-c3x00 but does need a different .config and initramfs.cpio containing kexecboot.

Do you want to rebuild kexecboot as well or just the kernel ?
Cheers!


Thanks greguu, I had built the kexecboot, my problems is how to make a image with the kexecboot.
I noticed the CONFIG_INITRAMFS_SOURCE="initramfs.cpio.xz" in you config file, I will try to make a initramfs.cpio.xz file and then the kernel image.
I will have a 7 days holiday from October 1st, hope I can go through the building of kernel and kexecboot, and make them boot on my c3100 device.
If everything is OK, I will organize these steps to write a tutorial document.
Thanks again for all your help, greguu.
Go to the top of the page
 
+Quote Post
greguu
post Sep 26 2019, 12:17 AM
Post #10





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(cain2pang @ Sep 26 2019, 07:21 PM) *
QUOTE(greguu @ Sep 26 2019, 02:42 PM) *
Hi cain2pang,
I am not sure you will get a 5.0.0 kernel kexecboot to work without taking out some features from the kernel config.
The last version I build was using 4.14 kernel.After that version the kexec kernel got too large to fit in the Zaurus kernel partition. sad.gif
This is the latest kexecboot kernel. https://github.com/greguu/voidz-packages-ol...execboot.tar.xz
I need to check my build server and get the .config file and patches for the kexecboot kernel. Its the same source as https://github.com/greguu/linux-4.14.18-c3x00 but does need a different .config and initramfs.cpio containing kexecboot.

Do you want to rebuild kexecboot as well or just the kernel ?
Cheers!


Thanks greguu, I had built the kexecboot, my problems is how to make a image with the kexecboot.
I noticed the CONFIG_INITRAMFS_SOURCE="initramfs.cpio.xz" in you config file, I will try to make a initramfs.cpio.xz file and then the kernel image.
I will have a 7 days holiday from October 1st, hope I can go through the building of kernel and kexecboot, and make them boot on my c3100 device.
If everything is OK, I will organize these steps to write a tutorial document.
Thanks again for all your help, greguu.

You can build your own initramfs.cpio.xz like this example:

CODE
cd cpio/
find . | cpio -o -H newc | xz --check=crc32 --lzma2=dict=512KB > ../initramfs.cpio.xz

Go to the top of the page
 
+Quote Post
greguu
post Sep 26 2019, 12:25 AM
Post #11





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(cain2pang @ Sep 26 2019, 07:21 PM) *
If everything is OK, I will organize these steps to write a tutorial document.

Please share your success with our community. rolleyes.gif

This post has been edited by greguu: Sep 26 2019, 12:25 AM
Go to the top of the page
 
+Quote Post
cain2pang
post Sep 26 2019, 01:11 AM
Post #12





Group: Members
Posts: 11
Joined: 16-September 19
From: China
Member No.: 855,729



QUOTE(greguu @ Sep 26 2019, 04:25 PM) *
QUOTE(cain2pang @ Sep 26 2019, 07:21 PM) *
If everything is OK, I will organize these steps to write a tutorial document.

Please share your success with our community. rolleyes.gif


OK, this is the reason why I do these things. smile.gif
Go to the top of the page
 
+Quote Post
greguu
post Sep 27 2019, 12:47 AM
Post #13





Group: Moderators
Posts: 372
Joined: 14-November 05
From: New Zealand
Member No.: 8,535



QUOTE(cain2pang @ Sep 26 2019, 09:11 PM) *
QUOTE(greguu @ Sep 26 2019, 04:25 PM) *
QUOTE(cain2pang @ Sep 26 2019, 07:21 PM) *
If everything is OK, I will organize these steps to write a tutorial document.

Please share your success with our community. rolleyes.gif


OK, this is the reason why I do these things. smile.gif

No worries, nice to see someone working on Zaurus. Happy to help anytime cool.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2019 - 05:14 AM