WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to Usb-Boot my own compiled kernel?  (Read 4340 times)

Offline bumsnudel

  • Newbie
  • *
  • Posts: 7
How to Usb-Boot my own compiled kernel?
« on: February 20, 2014, 05:09:55 PM »
Hi.
I'm new to this.
I got my first own kernel compiled using this Guide.
I got the ready bzImage file now and would like to boot it from usb stick (as Tiny Core Linux does).

But i don't know how to do this.
Can any1 help please?

Thanks

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to Usb-Boot my own compiled kernel?
« Reply #1 on: February 20, 2014, 05:16:57 PM »
Edit your bootloader config file and add an entry that boots your custom kernel.

Offline bumsnudel

  • Newbie
  • *
  • Posts: 7
Re: How to Usb-Boot my own compiled kernel?
« Reply #2 on: February 20, 2014, 05:39:31 PM »
What bootloader config file and what to add?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to Usb-Boot my own compiled kernel?
« Reply #3 on: February 20, 2014, 06:01:10 PM »
I Don't know which bootloader you are using, but I would guess it is extlinux if you used the installer to install it on the USB drive.

Please read the bootloader sections in the wiki.
http://wiki.tinycorelinux.net/wiki:extlinux
http://wiki.tinycorelinux.net/wiki:grub2_from_grub1
http://wiki.tinycorelinux.net/wiki:grub4dos
http://wiki.tinycorelinux.net/wiki:linld

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to Usb-Boot my own compiled kernel?
« Reply #4 on: February 20, 2014, 06:06:49 PM »
If you don't know, you should probably consult documentation of your bootloader.

If you remaster to include modules - as suggested in thread you linked to, you should of course also add path to new or additional cpio archive.

Alternatively you could possibly rename original core.gz and kernel first, and then rename remaster and new kernel to what your bootloader is already configured for.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline bumsnudel

  • Newbie
  • *
  • Posts: 7
Re: How to Usb-Boot my own compiled kernel?
« Reply #5 on: February 21, 2014, 11:18:42 AM »
Hi.
I'm using syslinux Bootloader.
All is running fine with original tiny core linux iso installed on boot-stick.
I replaced the original vmlinuz file with my new compliled bzImage file.

When I try to boot I'm getting this error:
modprobe: can't change directory to 3.8.13-tinycore64: No such file or directory


What am I doing wrong?

Thx
« Last Edit: February 21, 2014, 11:22:31 AM by bumsnudel »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to Usb-Boot my own compiled kernel?
« Reply #6 on: February 21, 2014, 11:26:27 AM »
You need to also provide the modules directory in the initrd, or load a second initrd that contains your modules.

Why did you need to compile your own kernel?
« Last Edit: February 21, 2014, 11:28:18 AM by gerald_clark »

Offline bumsnudel

  • Newbie
  • *
  • Posts: 7
Re: How to Usb-Boot my own compiled kernel?
« Reply #7 on: February 21, 2014, 11:42:35 AM »
You need to also provide the modules directory in the initrd, or load a second initrd that contains your modules.
How to get the initrd modified?


I need my own kernel because of UFS filesystem support (read/write) and also NTFS filesystem support (read/write).

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: How to Usb-Boot my own compiled kernel?
« Reply #8 on: February 21, 2014, 11:45:56 AM »
NTFS read/write doesn't require custom kernel, just install ntfs-3g.tcz
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to Usb-Boot my own compiled kernel?
« Reply #9 on: February 21, 2014, 11:50:18 AM »
I would recommend against compiling your own kernel.
Do you really need UFS?

If you feel you must, please read http://wiki.tinycorelinux.net/wiki:custom_kernel
« Last Edit: February 21, 2014, 11:55:00 AM by gerald_clark »

Offline bumsnudel

  • Newbie
  • *
  • Posts: 7
Re: How to Usb-Boot my own compiled kernel?
« Reply #10 on: February 21, 2014, 12:18:22 PM »
Yes, I need UFS support. I have to mount 3 hdds each 2TB of size UFS formatted and need to write to it.

Thx for the wiki link.
I missed the part with the modules.
I want to build the modules within the initrd. But how to build it? Is it a simple tar with the modules/firmware files?

Sorry, I m new to this.

Thanks

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254

Offline bumsnudel

  • Newbie
  • *
  • Posts: 7
Re: How to Usb-Boot my own compiled kernel?
« Reply #12 on: February 21, 2014, 12:36:00 PM »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to Usb-Boot my own compiled kernel?
« Reply #13 on: February 21, 2014, 12:45:17 PM »
http://wiki.tinycorelinux.net/wiki:remastering

It tells you how to unpack and pack the initrd.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: How to Usb-Boot my own compiled kernel?
« Reply #14 on: February 21, 2014, 05:07:38 PM »
Yes, I need UFS support. I have to mount 3 hdds each 2TB of size UFS formatted and need to write to it.
Sorry, I m new to this.

Please note:

config UFS_FS_WRITE
         bool "UFS file system write support (DANGEROUS)"
         depends on UFS_FS && EXPERIMENTAL
         help
           Say Y here if you want to try writing to UFS partitions. This is
           experimental, so you should back up your UFS partitions beforehand.

http://lxr.free-electrons.com/source/fs/ufs/Kconfig?v=3.8
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)