Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: bumsnudel on February 20, 2014, 05:09:55 PM

Title: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel on February 20, 2014, 05:09:55 PM
Hi.
I'm new to this.
I got my first own kernel compiled using this Guide (http://forum.tinycorelinux.net/index.php?topic=541.0).
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
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: gerald_clark on February 20, 2014, 05:16:57 PM
Edit your bootloader config file and add an entry that boots your custom kernel.
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel on February 20, 2014, 05:39:31 PM
What bootloader config file and what to add?
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: gerald_clark 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
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: tinypoodle 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.
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel 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
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: gerald_clark 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?
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel 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).
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bmarkus on February 21, 2014, 11:45:56 AM
NTFS read/write doesn't require custom kernel, just install ntfs-3g.tcz
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: gerald_clark 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
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel 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
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: gerald_clark on February 21, 2014, 12:21:26 PM
http://wiki.tinycorelinux.net/wiki:dynamic_root_filesystem_remastering
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel on February 21, 2014, 12:36:00 PM
http://wiki.tinycorelinux.net/wiki:dynamic_root_filesystem_remastering

Sorry for being such a noob but I can't find anything about building initrd in there?
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: gerald_clark on February 21, 2014, 12:45:17 PM
http://wiki.tinycorelinux.net/wiki:remastering

It tells you how to unpack and pack the initrd.
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: tinypoodle 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
Title: Re: How to Usb-Boot my own compiled kernel?
Post by: bumsnudel on February 21, 2014, 05:14:28 PM
Can't get it to work.
I figured out how to build the initrd but when I try to boot, the boot process hangs after view seconds without any message or log information  >:(
Now giving up here, before I have to destroy something.

Thanks anyway for support  :-*