Source?


20 posts
by Andy Woolford » Wed Oct 31, 2012 10:34 pm
Hi,

I hope this is the right place to ask for help!

I am really having to teach myself Linux (and raspberry pi) and have in the past, generally follow the 'recipes' (howtos) posted by others. Of course the raspberry pi is breaking new ground and having used Asterisk and FreePBX (open source SIP/IAX based telephony PBX) on i386 systems in the past, I have recently been experimenting with an image for "incrediblepi", based on asterisk and FreePBX which is distributed by nerd vittles: http://nerdvittles.com/?p=3026

I have put the image onto a SanDisk 32Gb Class 4 card without too many problems, except I experienced some apparently random freezes. Looking into this a bit further, whenever I run apt-get or dpkg (with a view to installing additional utilities such as webmin) the Pi keeps crashing during the unpacking phase and rebooting.

I suspect the SD card may be responsible, but have run several tests in accordance with other guidance in this forum regarding SD card issues and cannot find anything obvious. Read / Write benchmarks seem to be reasonable and in line with other cards reported.

The kernel is (ostensibly) the latest kernel and I have also updated it to ensure that it really is.

Code: Select all
uname -a
Linux incrediblepbx 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux


To try and further my own knowledge, I have tried to look up some tools to start debugging the cause for this and some very good guidance is to be found within "The Crash Book" http://www.dedoimedo.com. However it would appear that in order to run crash analyisis utilities such as LKCD or Kdump, will require the kernel to be re-compiled in a very specific way in order to capture the memory after a crash.

To start with it recommends downloading the sources as follows:
Code: Select all
apt-get source linux-image-$(uname -r)

However, this returns the following error:
Code: Select all
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to find a source package for linux-image-3.2.27+


I'm now kind of stuck as to where to go now and I would very much appreciate a nod in the right direction.

Kind regards,

Andy Woolford
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by coldguy » Thu Nov 01, 2012 3:41 am
I had similar freezing problems to yours, but they were resolved at some point by a newer Raspbian image. I'm not sure what version was used for the basis of IncrediblePie, though. I've also heard that a dodgy power supply could cause problems like that. You should also check your config.txt to see if you're overclocking; my board doesn't seem to tolerate it very well.

The Raspberry Pi kernel source is available at https://github.com/raspberrypi/linux if you'd still like to dig into that. I'm not sure if there is a Debian source package available for it.
Posts: 23
Joined: Mon Jul 02, 2012 9:22 pm
by Andy Woolford » Thu Nov 01, 2012 10:59 am
Thanks. My first thought was "is this being overclocked?", because my board doesn't tolerate it either. There is a CLI utlitity included in Ultimatepi called "/root/raspbi-setup" which gives several options including overclocking. This is set to "none", but it still writes the following options into the config.txt file, (which I assume are default values):

Code: Select all
arm_freq=700
core_freq=250
sdram_freq=400
over_voltage=0
gpu_mem_256=32
gpu_mem_512=64


Anyway... deleting all of the above made no difference so I don't think it is an overclock issue.

This leaves me with the kernel... I have just completed apt-get update which results in exactly the same kernel as before.

Code: Select all
uname -a
Linux incrediblepbx 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux


I don't know how to tell if this is raspbian or debian... but what is interesting is that it all completed without an error! It still crashes when unpacking webmin.

Thanks for the link to the sources - I'll take a look.
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by bredman » Thu Nov 01, 2012 11:19 am
You could be running out of memory while unpacking. It would be good to check that you have some swap space available.

To check your swap status, use the command
sudo swapon -s
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by Andy Woolford » Thu Nov 01, 2012 3:01 pm
Thanks for that tip. The swap file details are as follows:
Code: Select all
root@incrediblepbx:~# swapon -s
Filename                                Type            Size    Used    Priority
/var/swap                               file            247804  1556    -1

Not sure what this tells me, except that some of the swapfile has been used. I've also used a utility called htop, which provides a graphical representation of everything that's running. The swapfile always seems to be low usage, although memory does seem high. At times CPU output touches 100%, for which maybe 40% is attributed to operations connected with dpkg. I've copied the console output below. Most of it is greek to me!
Code: Select all
login as: root
root@192.168.1.85's password:
Linux incrediblepbx 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright and /root/COPYING.

Debian GNU/Linux and Incredible PBX come with ABSOLUTELY NO WARRANTY
to the extent permitted by applicable law.
No mail.
Last login: Thu Nov  1 14:09:54 2012 from apache.home
ALWAYS RUN INCREDIBLE PBX BEHIND A SECURE, HARDWARE-BASED FIREWALL!
SECURITY MATTERS. UPDATE YOUR SYSTEM REGULARLY! RUN: /root/update-my-pi

To proceed at your own risk, press the Enter key.
No mail for root
wlan0: error fetching interface information: Device not found
                    Incredible PBX 3.5 for Raspberry Pi

                 Asterisk: UP      Apache: UP    MySQL: UP
                 EximSMTP: UP    IPtables: UP      SSH: UP
                 LAN Eth0: UP       WLan0: DN    SAMBA: DN

                 RAM:  3620   34.70°C/94.46°F  Disk:  26G

                 Asterisk 1.8.16.0        FreePBX 2.10.1.0

                 Private IP: 192.168.1.85

                  Public IP: xx.xxx.xx.xx
                                                        85%
                                 <  OK  >
.-.                          .-. _ .-.   .-.            .---. .---. .-..-.
: :                          : ::_;: :   : :            : .; :: .; :: `' :
: :,-.,-. .--. .--.  .--.  .-' :.-.: `-. : :   .--.     :  _.':   .' `  '
: :: ,. :'  ..': ..'' '_.'' .; :: :' .; :: :_ ' '_.'    : :   : .; :.'  `.
:_;:_;:_;`.__.':_;  `.__.'`.__.':_;`.__.'`.__;`.__.'    :_;   :___.':_;:_; v3.5
Incredible PBX for Raspberry Pi, Copyright (C) 2012 Ward Mundy & Associates LLC

root@incrediblepbx:~# dpkg --configure -a
Setting up webmin (1.600) ...

When executing the above instruction, the dpkg setup runs for maybe a minute before crashing in this state: (Output copied from htop running in a separate window)
Code: Select all
  CPU[||||||||||||||||||||||||||||||||||||||||||||||||                     64.1%]     Tasks: 42, 60 thr; 2 running
  Mem[||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||78/121MB]     Load average: 0.95 0.30 0.13
  Swp[||                                                                 4/241MB]     Uptime: 00:32:42

  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 3063 root       20   0 19276 16708  1960 S 34.0 13.5  0:13.45 /usr/bin/perl /usr/share/webmin/run-postinstalls.pl
 2880 root       20   0  5712  2044  1204 R  6.0  1.6  0:05.33 htop
 2585 asterisk   20   0 71416 19836  8516 S  0.0 16.0  0:19.03 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
 2629 asterisk   20   0 71416 19852  8524 S  0.0 16.0  0:09.85 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
 2942 root       20   0  1708   576   452 S  0.0  0.5  0:00.10 /bin/sh ./setup.sh
 2666 asterisk   20   0 71416 19836  8516 S  0.0 16.0  0:00.22 /usr/sbin/asterisk -f -U asterisk -G asterisk -vvvg -c
 2936 root       20   0  5644  2088   824 S  0.0  1.7  0:00.25 dpkg --configure -a
    1 root       20   0  2096   632   588 S  0.0  0.5  0:01.82 init [2]
  138 root       20   0  2740   788   704 S  0.0  0.6  0:00.35 udevd --daemon
  248 root       20   0  2736   548   420 S  0.0  0.4  0:00.03 udevd --daemon
  249 root       20   0  2736   532   420 S  0.0  0.4  0:00.02 udevd --daemon
 1236 root       20   0  1860   140   136 S  0.0  0.1  0:00.00 /sbin/dhcpcd-bin -h incrediblepbx -Y -N -R eth0
 1527 root       20   0 27924  1096   908 S  0.0  0.9  0:00.07 /usr/sbin/rsyslogd -c5
 1529 root       20   0 27924  1096   908 S  0.0  0.9  0:00.02 /usr/sbin/rsyslogd -c5
 1530 root       20   0 27924  1096   908 S  0.0  0.9  0:00.01 /usr/sbin/rsyslogd -c5
 1525 root       20   0 27924  1096   908 S  0.0  0.9  0:00.13 /usr/sbin/rsyslogd -c5
 1570 root       20   0 42148  3980  2240 S  0.0  3.2  0:00.46 /usr/sbin/apache2 -k start
 1625 root       20   0  4252   908   732 S  0.0  0.7  0:00.03 /usr/sbin/cron
 1633 messagebu  20   0  3132   536   324 S  0.0  0.4  0:00.00 /usr/bin/dbus-daemon --system
 1670 avahi      20   0  3332  1180   920 S  0.0  1.0  0:00.10 avahi-daemon: running [incrediblepbx.local]
 1672 asterisk   20   0 42172  2188   416 S  0.0  1.8  0:00.00 /usr/sbin/apache2 -k start
 1673 avahi      20   0  3332   504   288 S  0.0  0.4  0:00.00 avahi-daemon: chroot helper
 1674 asterisk   20   0 42172  2152   412 S  0.0  1.7  0:00.00 /usr/sbin/apache2 -k start
 1741 ntp        20   0  5464  1840  1416 S  0.0  1.5  0:00.46 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 102:104
 1784 root       20   0  1708   536   456 S  0.0  0.4  0:00.12 /bin/sh /usr/bin/mysqld_safe
 1969 root       20   0  7056   988   600 S  0.0  0.8  0:00.01 /usr/sbin/sshd
 2224 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.19 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2225 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.28 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2226 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.19 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2227 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.18 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2228 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.32 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2229 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.20 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2230 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.19 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2231 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.19 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2232 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.18 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2233 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:00.18 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
 2235 mysql      20   0  310M 34688  4644 S  0.0 27.9  0:02.26 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql
F1Help  F2Setup F3SearchF4FilterF5Tree  F6SortByF7Nice -F8Nice +F9Kill  F10Quit


Any further help very much appreciated.
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by bredman » Thu Nov 01, 2012 3:07 pm
Have you checked if you have sufficient space available on your SD card? Use the command
df /

Apologies for asking such a trivial question, but it is very unusual for dpkg to crash.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by Andy Woolford » Thu Nov 01, 2012 6:05 pm
Undoubtably yes... this is a 32GB Class 4 SD card. Anyway, here is the result of df /

Code: Select all
root@incrediblepbx:~# df /
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root       30619612 2354512  26740820   9% /


Of course, it is still an open question as to whether the card is fully compatible with or glitching in the Raspberry Pi. I'm at the end of my diagnostic skills.

Cheers,

Andy
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by Andy Woolford » Thu Nov 01, 2012 8:36 pm
coldguy wrote:The Raspberry Pi kernel source is available at https://github.com/raspberrypi/linux if you'd still like to dig into that. I'm not sure if there is a Debian source package available for it.


You'll have to forgive me asking very basic questions here, but I'm learning as I go so hopefully I will only need to ask the once! :?

Having navigated to https://github.com/raspberrypi/linux, I am confronted with a webpage full of directories and files. What and how do I download the Raspbian kernel from this page? I have read elsewhere that I should end up with the entire kernel source in an archive file of some description which I then need to extract and cd into. Apparently I then need to edit the kernel .config file to configure the crash analysis. Once I can get the kernel sources for Raspbian I plan on following the step by step instructions given here: http://www.dedoimedo.com/computers/linux-kernel-compilation.html
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by coldguy » Fri Nov 02, 2012 6:13 am
The simplest way would be to click on the "Download" tab on that page, and then click the "Download as .tar.gz" button.
Posts: 23
Joined: Mon Jul 02, 2012 9:22 pm
by Andy Woolford » Fri Nov 02, 2012 10:48 am
Aha... a "download button". :idea:

Thanks :oops:
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by RaTTuS » Fri Nov 02, 2012 11:03 am
OK - lets get physical
what PSU are you using how are you powering the RPi
what do you have plugged into the USB

can you measure the power between TP1 and TP2
http://www.catb.org/esr/faqs/smart-questions.html <- ask smart Questions
"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
User avatar
Posts: 5566
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by Andy Woolford » Fri Nov 02, 2012 2:17 pm
Thanks for this.

I'm using the 'standard' RS PSU rated at 5.0v 1200mA. Measuring the voltage on the TPs using a DMM shows spot on 5.0v during the test pattern, falling to 4.95v during the boot sequence. When running dpkg (leading up to a crash and when the CPU is running at about 70% - 100%) the lowest voltage measured is to 4.89v.

Of course, I can't pick up spikes using the DMM...

<edit>There is nothing connected to the USB other than a DELL keyboard, (but it makes no difference if this is unplugged). It is connected to the network via Ethernet cable and most of my admin is done via SSH. I have HDMI plugged into the telly to monitor the boot sequence and that's it.</edit>

For reference I have used a 4GB SanDisk Class 4 SD card loaded with a fresh install of Raspbian and installed webmin without any issues whatsoever. I think I will do the same for the 32GB card which is causing issues. It's got to be either the card, or some conflict with other processes running on the Ultimatepi distro. If it *is* the card, I'd like to find out why - because it passes the benchmark and badblocks tests.
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by Andy Woolford » Fri Nov 02, 2012 7:42 pm
Update: I can report that using the exact same SD card, flashed with a fresh 'Raspbian' image, apt-get and dpkg can install webmin without any issues at all.

This indicates the card is fine. There may be a problem then, with the kernel being used by "ultimatepi" or a conflict with one of the many other processes.
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by Andy Woolford » Tue Nov 06, 2012 11:44 am
Testing with a different image.
http://www.raspberry-asterisk.org/?p=68

The Ultimatepi image from nerd vittles just doesn't work for me without crashing, but the raspberry-asterisk image is based on Raspbian and the 32Gb card has worked faultlessly.

I had *assumed* that Ultimatepi was also raspbian, but given the result from uname -a I'm not so sure:

Code: Select all
uname -a
Linux incrediblepbx 3.2.27+ #250 PREEMPT Thu Oct 18 19:03:02 BST 2012 armv6l GNU/Linux


How do I tell if an image is "Raspbian" or "Wheezy" or... something else?
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by RaTTuS » Tue Nov 06, 2012 12:45 pm
I not sure how to help ,
but if you star toff with a working wheezy and build the things needed you may get a better result
http://www.catb.org/esr/faqs/smart-questions.html <- ask smart Questions
"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
User avatar
Posts: 5566
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
by Andy Woolford » Tue Nov 06, 2012 2:51 pm
It's working fine on Raspbian (so far)... so I will persist with this image. Don't want to overwrite the card again - unless I could save the image with all my configurations on it.

How does one go about "making" an image of an SD card, so I can restore it later? Perhaps that's another topic?
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by bredman » Tue Nov 06, 2012 3:03 pm
Andy Woolford wrote:How does one go about "making" an image of an SD card, so I can restore it later? Perhaps that's another topic?

If you use a tool like Win32DiskImager, use the "read" button to read from the card instead of the "write" button to write to the card.
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by Andy Woolford » Tue Nov 06, 2012 3:08 pm
Ah... simples :-)
Posts: 12
Joined: Fri Jun 22, 2012 1:26 am
by kaspencer » Wed Nov 07, 2012 11:30 am
Comment in relation to making a copy image of an SD Card with Win32DiskImager:

Yes it appears to work when you do that BUT I have found that my 64GByte SD Card when almost full produces the same size image (just over 4Gbyte) as my 32GByte, 16GByte and my 8Gbyte cards, all being full to about 85% capacity. This is too much of a coincidence for it to be related to compression!

Now I haven't yet tried recovering the saved image back to an SD Card, but it seems to me that Win32DiskImager may have a hidden software error somewhere which limits the size of the disc data which it can write in an image.

Regards

Kenneth Spencer
2x256Mb + 2x512Mb RPi, Eth'netLAN+Win2k3R2 svr, 40MbpsFTTC.
RaspBMC: 128G SD, K400 wl Kb+TPd, HD32tv&Rem.
RW'y webserver: 64G SD, Y-RK49 wl Kb+M, HannsG W24" screen
RW'y PDC & fileserver: as above + 2TB disc.
+RiscOSPi on 32G uSD.
Posts: 71
Joined: Wed Mar 07, 2012 11:37 pm
Location: UK, England, Wiltshire
by RaTTuS » Wed Nov 07, 2012 11:42 am
exactly how big is is image in bytes
Fat32 partitons have a 2GB limit in file sizes [IIRC]
NTFS does not suffer this
http://www.catb.org/esr/faqs/smart-questions.html <- ask smart Questions
"That's not right, the badgers have moved the goalposts."
1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX - Prosliver FTW
User avatar
Posts: 5566
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK