WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Kernel compiling woes part -1 --- or bug in tar?  (Read 10086 times)

Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #15 on: December 05, 2013, 10:53:56 AM »
Quote
$ grep SERIAL_8250_NR_UARTS config-3.8.13-tinycore
CONFIG_SERIAL_8250_NR_UARTS=32

I see. Then you think my problem with using /dev/ttyS4 is caused by something different?
(If I could get the kernel compiling business going I would just try setting CONFIG_SERIAL_8250_RUNTIME_UARTS=5 in the config file and report back, but unfortunately I'm still stuck with make oldconfig).

Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #16 on: December 05, 2013, 11:02:38 AM »
tmpfs is also limited by currently free shared mem (RAM + swapspace).

[Linux-Newbie-Question]
Thus tar is using space in the tmpfs while working and it could be running out of space while working but I would not see this with df after tar terminated with an error?
[/Linux-Newbie-Question]

(Just asking because after tar terminated the usage of tmpfs is just like 1% - both inodes and space)

Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #17 on: December 05, 2013, 11:05:10 AM »
Just checked, my kernel build dir including modules after compilation is 1.8 GByte. If you do not have 2 GB free file system space, no way to do that.

I now changed to sda1 which is a (still almost empty) 32GB CF-Card, so this should not be a problem.

Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part 1 --- make oldconfig can't find some files?
« Reply #18 on: December 05, 2013, 11:13:26 AM »
OK, so here is where I am at the moment:

Unpacking the sources works when I use a directory on sda1 instead of a directory in /home/.

The how-to http://wiki.tinycorelinux.net/wiki:custom_kernel tells me to:
"Move the kernel config file from the standard TC kernel into the same directory and rename it to ”.config”"
The "kernel config file from the standard TC kernel" is config-3.8.13-tinycore from http://tinycorelinux.net/5.x/x86/release/src/kernel/, right?
So I copied and renamed it.
However make oldconfig can't find linux/limits.h.
Some searching on the net brought up that the symbolic link to my sources in /usr/... might be missing (what I found was not tiny core related however) - and there's also nothing about this in the how-to?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #19 on: December 05, 2013, 11:28:05 AM »
tmpfs is also limited by currently free shared mem (RAM + swapspace).

[Linux-Newbie-Question]
Thus tar is using space in the tmpfs while working and it could be running out of space while working but I would not see this with df after tar terminated with an error?
[/Linux-Newbie-Question]

(Just asking because after tar terminated the usage of tmpfs is just like 1% - both inodes and space)
Sure the source code would reveal all the gory details, but I couldn't see any practical relevance in that question as it seems to be pretty obvious what is happening.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #20 on: December 05, 2013, 11:33:04 AM »
Just checked, my kernel build dir including modules after compilation is 1.8 GByte. If you do not have 2 GB free file system space, no way to do that.

I now changed to sda1 which is a (still almost empty) 32GB CF-Card, so this should not be a problem.

tmpfs could be resized on the fly, but of course that would require sufficient swapspace.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11675
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #21 on: December 05, 2013, 12:37:10 PM »
Hi bitpusher
Maro did a very good writeup of the kernel config relating to serial ports here:
http://forum.tinycorelinux.net/index.php/topic,12632.msg69097.html#msg69097

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #22 on: December 05, 2013, 04:40:05 PM »
I have already tried
8250.nr_uarts=5.
While this gives me /dev/ttyS4 in the filesystem:

tc@box:~$ ls /dev/ttyS* -l
crw-rw---- 1 root staff 4, 64 Dez  3 08:31 /dev/ttyS0
crw-rw---- 1 root staff 4, 65 Dez  3 08:31 /dev/ttyS1
crw-rw---- 1 root staff 4, 66 Dez  3 08:31 /dev/ttyS2
crw-rw---- 1 root staff 4, 67 Dez  3 08:31 /dev/ttyS3
crw-rw---- 1 root staff 4, 68 Dez  3 08:31 /dev/ttyS4


tc@box:~$ setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 3
/dev/ttyS4, UART: unknown, Port: 0x0000, IRQ: 0


The problems start when I try to configure ttyS4.
Setting the address and IRQ works OK, but the UART is not auto-detected:

tc@box:~$ setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 3
/dev/ttyS4, UART: unknown, Port: 0x03a8, IRQ: 2


I could live with setting the UART-type manually, but as soon as I set it with setserial I get:

tc@box:~$ setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 10
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 11
/dev/ttyS4: Device or resource busy


Perhaps IRQ's play a rule??

http://cateee.net/lkddb/web-lkddb/SERIAL_8250_SHARE_IRQ.html
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #23 on: December 06, 2013, 08:47:51 AM »
I stand corrected.
Most likely I mixed in some observations with Puppy-Linux.

My problem with having 5 UARTS usable was definitely not with CONFIG_SERIAL_8250_RUNTIME_UARTS or CONFIG_SERIAL_8250_NR_UARTS in the Kernel, and yes, boot code 8250.nr_uarts=5 does the trick.

@Rich: Thanks for pointing to the other thread. However the issue with CONFIG_SERIAL_8250_NR_UARTS=4 seems to be fixed, both the config files for 3.8.10 and 3.8.13 have CONFIG_SERIAL_8250_NR_UARTS=32, making boot code 8250.nr_uarts=n usable for up to 32 UARTS.

@tinypoodle: Seems your shot for the interrupt was in the right direction, however I am not trying to share interrupts, see below.

Summary:

Problem was using IRQ 9 for ttyS4 while the interrupt had already been grabbed by ACPI:

tc@box:~$ cat /proc/interrupts
           CPU0       
  0:      75839    XT-PIC-XT-PIC    timer
  1:       1783    XT-PIC-XT-PIC    i8042
  2:          0    XT-PIC-XT-PIC    cascade
  4:         10    XT-PIC-XT-PIC 
  6:          2    XT-PIC-XT-PIC    floppy
  7:        693    XT-PIC-XT-PIC    ehci_hcd:usb1, ohci_hcd:usb2, eth0
  8:          0    XT-PIC-XT-PIC    rtc0
  9:          0    XT-PIC-XT-PIC    acpi
 12:      10189    XT-PIC-XT-PIC    i8042
 14:       1666    XT-PIC-XT-PIC    pata_amd
[...]


After adding boot code acpi=off (my board doesn't have ACPI anyway) IRQ 9 was no longer in use, and after boot I get this (IRQs for ttyS2 and ttyS3 are not correctly detected, ttyS4 is unsurprisingly not detected at all):

tc@box:~$ setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 3
/dev/ttyS4, UART: unknown, Port: 0x0000, IRQ: 0


ttyS2 and ttyS3 are easily fixed:

tc@box:~$ sudo setserial /dev/ttyS2 irq 10
tc@box:~$ sudo setserial /dev/ttyS3 irq 11


ttyS4 can be configured by setting uart and baud_base manually (baud_base is necessary because only ttyS0-3 get this as a default):

tc@box:~$ sudo setserial /dev/ttyS4 port 0x03a8 irq 9 uart 16550a baud_base 115200

=> And now I have 5 working UARTs:

tc@box:~$ setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 10
/dev/ttyS3, UART: 16550A, Port: 0x02e8, IRQ: 11
/dev/ttyS4, UART: 16550A, Port: 0x03a8, IRQ: 2


However I still need to get the kernel compiling business going because of UIO.

« Last Edit: December 06, 2013, 09:00:32 AM by bitpusher »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11048
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #24 on: December 07, 2013, 05:22:01 AM »
With your compiling error, it seems you didn't install a complete compiling environment. Please install compiletc.tcz and try again.

Kernel builds also need perl5, bash, and (if you use menuconfig) ncurses and ncurses-dev.
The only barriers that can stop you are the ones you create yourself.

Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #25 on: December 10, 2013, 10:58:46 AM »
With your compiling error, it seems you didn't install a complete compiling environment. Please install compiletc.tcz and try again.

Kernel builds also need perl5, bash, and (if you use menuconfig) ncurses and ncurses-dev.

Thanks for the hint.
So far I installed:
•   ncurses
•   ncurses-dev
•   perl5
•   bash
•   compiletc
then there were still "kernel headers" missing.
I found and installed
•   linux-3.8.3_api_headers.tcz
this fixed the error message, but I wonder if using the headers from/for 3.8.3 with 3.8.13 might cause other problems?

This brought me up to step 10. of http://wiki.tinycorelinux.net/wiki:custom_kernel

I now have the new kernel, residing in arch/x86/boot/bzImage and the modules in lib/modules/kernel_version
Copying the kernel to /mnt/sda1/tce/boot and creating a boot-menu in extlinux.conf was easy enough - but how I am supposed to get my newly compiled modules into core.gz file? I understand that this is basically a filesystem packed into one file, but what is the most simple way to create it from my modules path without having to understand all the internals?




Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #26 on: December 10, 2013, 11:52:49 AM »
Read WIKI on remastering, how to unpack, modify and repack initrd:

Code: [Select]
zcat <initrd> | cpio -i -d -H newc
and

Code: [Select]
find | cpio -o -H newc | gzip > <newinitrd>
But if you don't want to understand what are you doing be prepared to fail and to waste more time than would spent to understand what are you doing.

As V. I. Lenin told:

Quote
Learn, learn and once again, learn!

:)
« Last Edit: December 10, 2013, 11:57:42 AM by bmarkus »
Béla
Ham Radio callsign: HA5DI

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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14832
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #27 on: December 10, 2013, 01:13:28 PM »
So far I installed:
•   ncurses
•   ncurses-dev
•   perl5
•   bash
•   compiletc
then there were still "kernel headers" missing.

linux-3.8.3_api_headers is one of the deps of compiletc, so it should have been loaded



Offline bitpusher

  • Newbie
  • *
  • Posts: 33
Re: Kernel compiling woes part -1 --- or bug in tar?
« Reply #28 on: December 11, 2013, 08:21:27 AM »
Read WIKI on remastering, how to unpack, modify and repack initrd:

Good advice indeed. I remember briefly looking at this wiki but skipping it as on the top it seems to be focusing on CDs and isos - and my system doesn't even have an optical drive...  ::)

Therefore I missed the section down the page:

Quote
Code: [Select]
zcat <initrd> | cpio -i -d -H newc
and

Code: [Select]
find | cpio -o -H newc | gzip > <newinitrd>

which was what I was looking for.

Quote
But if you don't want to understand what are you doing be prepared to fail and to waste more time than would spent to understand what are you doing.

I think as usually it is a question of finding the right balance.

Quote
As V. I. Lenin told: [...]

Yeah, but this guy also said and wrote some other stuff which in hte end did not always turned out in favour of the people affected...   :)

Anyway, thanks for the pointers, at least I was able to compile 3.8.13 (without any modifications by me - just as a prove of concept), pack up the modules and boot the thing - and everything seems normal so far.
« Last Edit: December 27, 2013, 12:01:37 PM by bitpusher »