ankur_r
Posts: 66
Joined: Sat Nov 12, 2016 9:49 am

Kernel img file and location to carry.

Wed Feb 21, 2018 4:54 pm

Hi All,

I have a 16GB memory card containing Raspbian OS, and I am boot it properly and visualize with VNC Viewer.

Now I am willing to boot it with separate Linux kernel parallel to Raspbian in dual boot fashion i.e. selecting as needed from boot loader like grub.

Now I initiated accordingly https://www.raspberrypi.org/documentati ... uilding.md

In the step given I am able to cross compile the downloaded kernel properly till below given command
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs

After same, I am having doubt on

1. Which file need to copy and where in card ?
2. As we do in normal process while working with laptop/desktop computer the image file a location and update the grub.conf manually in 2.6 version of kernel and automatically updated automatically in the install process via make install and make modules_install commands.

So I need your selp at three points ..

1. Mounting the card and partition.
2. which file.
3. Where to copy.

Above doubt lies in

sudo cp mnt/fat32/$KERNEL.img mnt/fat32/$KERNEL-backup.img
sudo cp arch/arm/boot/zImage mnt/fat32/$KERNEL.img
sudo cp arch/arm/boot/dts/*.dtb mnt/fat32/
sudo cp arch/arm/boot/dts/overlays/*.dtb* mnt/fat32/overlays/
sudo cp arch/arm/boot/dts/overlays/README mnt/fat32/overlays/
sudo umount mnt/fat32
sudo umount mnt/ext4

Pl help in this last steps of commands..

--Thanks
Ankur

ankur_r
Posts: 66
Joined: Sat Nov 12, 2016 9:49 am

Re: Kernel img file and location to carry.

Thu Feb 22, 2018 1:38 pm

Is this post hidden by admin ? No response ... I am sticking with this.. .Pls help if it is visible....

Regards.
Ankur

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Kernel img file and location to carry.

Thu Feb 22, 2018 2:14 pm

ankur_r wrote:
Thu Feb 22, 2018 1:38 pm
Is this post hidden by admin ? No response ... I am sticking with this.. .Pls help if it is visible....

Regards.
Ankur

Mulitiboot then try BerryBoot it shares the same Kernel / Firmware between installed OSes:

http://www.berryterminal.com/doku.php/berryboot
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

ankur_r
Posts: 66
Joined: Sat Nov 12, 2016 9:49 am

Re: Kernel img file and location to carry.

Thu Feb 22, 2018 8:36 pm

Hi All,

Given link is not opening...
http://www.berryterminal.com/doku.php/berryboot
Kindly provide an alternative.

--Thanks.
Ankur

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Kernel img file and location to carry.

Thu Feb 22, 2018 8:43 pm

ankur_r wrote:
Thu Feb 22, 2018 8:36 pm
Hi All,

Given link is not opening...
http://www.berryterminal.com/doku.php/berryboot
Kindly provide an alternative.

--Thanks.
Ankur

The linked URL works AOK :roll:
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Kernel img file and location to carry.

Thu Feb 22, 2018 10:44 pm

ankur_r wrote:
Thu Feb 22, 2018 8:36 pm
Hi All,

Given link is not opening...
http://www.berryterminal.com/doku.php/berryboot
Kindly provide an alternative.

--Thanks.
Ankur
It's the link in you OP that is not working. Note that you must copy and paste the link from your browser address bar when visiting the actual page. The compressed links found in forum posts will not work if you attempt to copy and paste them into another post.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

ankur_r
Posts: 66
Joined: Sat Nov 12, 2016 9:49 am

Re: Kernel img file and location to carry.

Fri Feb 23, 2018 9:28 pm

Hi All,

I went through http://www.berryterminal.com/doku.php/berryboot

I just asked after cross-compiling which file and what location to copy... i want to have dual boot card in which I can have raspbian and normal linux...in the given link a seperate installer have provided, which will initially format the card. If I format then old installation will be removed which I dont want. Therefore it is being kindly requested to give me some other way...or i feel its better to have idea from https://www.raspberrypi.org/documentati ... uilding.md I not getting the idea from last part of this web-page-

"Install directly onto the SD card

Having built the kernel, you need to copy it onto your Raspberry Pi and install the modules; this is best done directly using an SD card reader.

First, use lsblk before and after plugging in your SD card to identify it. You should end up with something like this:

sdb
sdb1
sdb2

with sdb1 being the FAT (boot) partition, and sdb2 being the ext4 filesystem (root) partition.

If it's a NOOBS card, you should see something like this:

sdb
sdb1
sdb2
sdb5
sdb6
sdb7

with sdb6 being the FAT (boot) partition, and sdb7 being the ext4 filesystem (root) partition.

Mount these first, adjusting the partition numbers for NOOBS cards:

mkdir mnt
mkdir mnt/fat32
mkdir mnt/ext4
sudo mount /dev/sdb1 mnt/fat32
sudo mount /dev/sdb2 mnt/ext4

Next, install the modules:

sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=mnt/ext4 modules_install

Finally, copy the kernel and Device Tree blobs onto the SD card, making sure to back up your old kernel:

sudo cp mnt/fat32/$KERNEL.img mnt/fat32/$KERNEL-backup.img
sudo cp arch/arm/boot/zImage mnt/fat32/$KERNEL.img
sudo cp arch/arm/boot/dts/*.dtb mnt/fat32/
sudo cp arch/arm/boot/dts/overlays/*.dtb* mnt/fat32/overlays/
sudo cp arch/arm/boot/dts/overlays/README mnt/fat32/overlays/
sudo umount mnt/fat32
sudo umount mnt/ext4

Another option is to copy the kernel into the same place, but with a different filename - for instance, kernel-myconfig.img - rather than overwriting the kernel.img file. You can then edit the config.txt file to select the kernel that the Pi will boot into:

kernel=kernel-myconfig.img

This has the advantage of keeping your kernel separate from the kernel image managed by the system and any automatic update tools, and allowing you to easily revert to a stock kernel in the event that your kernel cannot boot.



KIndly help me to clear my doubts ??

--Thanks
Ankur

Return to “Advanced users”