20 July
2017

I recently had to build a Linux image for an Intel Galileo for a project I was working on. This is based on Yocto and the board support package (BSP) from Intel which includes code for the Galileo board and the quark microprocessor. I had a few problems especially since I wanted to include my own modifications to the Linux kernel.

I was using an Ubuntu 16,04 distribution that included gcc v5. Version 5 of gcc was too new for several modules in the BSP 1.24.0 image that is currently available. I had do install gcc version 4.8.5. There were also problems with locale support which required a patch. Here are the key fixes.


1)
Patch the locale/gen_wctype.c routine using patch code from Oregon State University
The code is also at the bottom this post in case that page goes away.


2)
Install an old gcc (apt-get install gcc-4.8) and then use

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8

to install it. Later, select the one you wait using
update-alternatives --config gcc

3) Add support for new modules by adding a layer, and editing conf/bblayers.conf to include the new payer in the build.

4) Configure the kernel:
You might think you could do
bitbake linux-yocto-quark -c menuconfig
but that does not work with the Intel IOT dev kit. Instead, you need to cd to the kernel directory, and do a make menuconfig. This can be done on the hist since all we are doing is creating a config file, not actually generating any code for the Galileo target. Then you need to make sure the config gets use by bitmake, which I managed to do use one or another brutal hack. I recommend:

make oldconfig
cp .config defaultconfig

Then go do your bitbake.

The bitbake cheat sheet and bitbake command list might also be useful.


Patch:


--- a/extra/locale/gen_wctype.c
+++ b/extra/locale/gen_wctype.c
@@ -227,11 +227,12 @@
++verbose;
continue;
}
- if (!setlocale(LC_CTYPE, *argv)) {
+ /* setlocale might be just a stub */
+ /* if (!setlocale(LC_CTYPE, *argv)) {
verbose_msg("setlocale(LC_CTYPE,%s) failed! Skipping this locale...\n", *argv);
continue;
}
-
+ */
if (!(totitle = wctrans("totitle"))) {
verbose_msg("no totitle transformation.\n");
}
@@ -306,43 +307,43 @@
#endif
#if 0
if (c --- a/extra/locale/gen_wctype.c
+++ b/extra/locale/gen_wctype.c
@@ -227,11 +227,12 @@
++verbose;
continue;
}
- if (!setlocale(LC_CTYPE, *argv)) {
+ /* setlocale might be just a stub */
+ /* if (!setlocale(LC_CTYPE, *argv)) {
verbose_msg("setlocale(LC_CTYPE,%s) failed! Skipping this locale...\n", *argv);
continue;
}
-
+ */
if (!(totitle = wctrans("totitle"))) {
verbose_msg("no totitle transformation.\n");
}
@@ -306,43 +307,43 @@
#endif
#if 0
if (c

By Gregory Dudek at | Leave a comment |    
Comments
There are no comments.
Post your own response

Each comment is manually screened for the presence of appropriate and substantive content, due to a constant onslaught of comment-spam. This means there may be a delay before your comment appears.


(Some kind of name is required, will be visible)

Required, whatever you enter will be visible to other users.


(Optional, used for "mailto" link)

Your email address is not required, but if you insert it it will be displayed so people can contact you.

Answer this question correctly to demonstrate that you are not a dumb spambot.



The title for your comment.



Your comment goes here. All relevant comments are welcome, except for those that simply promote an irrelevant product or else are used to fraudulently inflate the link count to an irrelevant web page. They appear after moderation. Don't forget to also fill in the captcha below or your text will be rejected automatically!

You must answer this question to prove you are human
which has the least friendly public image: 1:collie, 2:beagle, 3:doberman, 4:dachsund, 5:dalmatian?

Answer this question correctly to demonstrate that you are not a dumb spambot.