12 Replies Latest reply on Apr 27, 2014 2:05 PM by StuartAnderson

    New Debian image for Galileo Board


      I have created the galileo-debian project on sourceforge.net for the purpose of providing a place to collaborate on maintaining a Debian image for the Galileo Board. The project contains a SD card image ready to be downloaded and used, plus an apt-able package repository providing a place where we can more easily share updates and needed fixes for the Galileo board, and a git repository containing the Galileo unique packages, plus any packages that end up needing little bit of tweaking to run properly on the Galileo.




      I have taken the released kernel source (3.8.7) for this board, and put it in a Debian package so that it is properly integrated into the image. Also present is a galileo-system package that provides some of the board specific configuration needed.


      The SD card image is just a regular GPT based disk image that works with EFI. In addition to the Galileo kernel, it also has a Debian 3.2 kernel installed so it can be booted on a real EFI system, or on a convenient VM like Virtualbox or QEMU.


      I hope people find this project useful and enjoy being able to easily apt-get install whatever Debian packages they want to use.

        • 1. Re: New Debian image for Galileo Board

          This is an excellent idea. Debian is my favorite.


          I had to rename galileo-img.gz-1.0 to galileo-img.gz-1.0.gz then gunzip the renamed file and the result had 1024M size.

          I then used dd if=galileo-img.gz-1.0 of=/dev/mmcblkX bs=1M conv=fsync and booted on the galileo.

          I could ping the galileo. I tried ssh and telnet and couldn't get in.

          I put the sdcard in my computer and checked syslog and found the galileo booted the 3.2.0 instead of the 3.8.7 kernel.


          This was a good first attempt. Did you intend this to be used with the serial console using the (not an audio) plug or how else do I log in over the network?


          Edit: Actually I see where the syslog I viewed was already there in the downloaded image so evidently I never did get this image to boot. Please ignore my comments about the syslog except I still couldn't find ssh or the inet.d for telnet. Maybe you have a newer way to get in if I could get your card to boot. I also tried setting the boot attribute with gdisk and still couldn't boot. I am stumped.

          • 2. Re: New Debian image for Galileo Board

            The image is set up to use the serial port that comes out of the audio plug.


            You should have seen the grub menu with the 3.8.7 boot options (followed by the 3.2 boot options). If so, then it should default to the 3.8.7 kernel and the console output will appear in the same place.


            Sshd and telnetd are not installed since it is a minimal image. I may go ahead and install sshd as a default once the current issue is cleared up so it works reliably. I was assuming users could get in via the serial console, and add whatever you want.

            • 3. Re: New Debian image for Galileo Board

              Could you make the grub boot to the 3.8.7 kernel automatically after a timeout when there in no choice made? I maybe should have tried that before recycling the sdcard for my own project. I have more sdcards on the way so I can try yours again soon.


              When previously trying your image I was able to mount the debian partition and then chroot so I was able to apt-get the ssh and telnet packages as well as mc and dselect as my favorites. I just couldn't get to boot in the Galileo probably because of grub waiting. The EFI is new to me also so I have a lot to learn about the way your image works.


              This should be great once I can get past the serial console requirement.

              • 4. Re: New Debian image for Galileo Board

                The grub on the SD card does boot into the 3.8.7 kernel and the Debian root FS. The problem is probably that you are booting the grub that goes with the Yocto image instead. You have to tell EFI to boot from the SD card ahead of booting from the SPI flash device. You'll really need a serial console to be able to do this. Once everything is configured properly then you should be fine without having a console attached.

                • 5. Re: New Debian image for Galileo Board



                  First of all thanks for this image.


                  I just want to ask if you can give the steps to boot the image into the galileo board because after I put the image using rawrite32 into the SD card I don´t know what to do next to install the image, I see that you have a link in the link you gave above ([How to Boot the image]) but I only get an error.


                  Can you help me with this?. It will be very helpfull



                  • 6. Re: New Debian image for Galileo Board



                    I would like to start by thanking Stuart for the debian image, but I also did not manage to get it to work.


                    These were my steps:

                    1) downloaded the image from source forge

                    2) added .gz extension to the file

                    3) unpacked the file with gunzip, and it expanded into 1073741824 bytes ( MD5 (galileo.img.gz-1.0) = 7ba6c064a809e88789d960c7d007aee3 )

                    4) Then I used dd to write it on to a 1GB card (101580800 bytes): dd if=galileo.img.gz-1.0 of=/dev/disk1 bs=1024k

                    5) after a while, I had a partition on the card with around 100MB, but with only a few files (I think <10MB was actually used). No 2nd partition was created. (I'm not sure if it failed because the card was a bit smaller than the image)

                    6) booted galileo with the uSD card and a serial console.

                    7) I could see some errors on the console.. and the grub menu with 5 options. (which are the same I see without any card inserted)


                    Anyway, Stuart, could you please give us some more information on how to get your image running.

                    thank you.


                    PS: I also tried the image with Virtualbox, which did not recognize the file as a virtual disk. (both packed and unpacked)

                    • 7. Re: New Debian image for Galileo Board

                      Sorry for the delay in responding. It's been a busy week.


                      I have filled in the "How to Boot" page in the wiki at sf.net.


                      In summary, the system boots into a grub that is hardwired to boot from the SPI flash. You have to exit that grub, and get back to the EFI firmware. From there, you can boot the grub from the SD card, which will then give you the menu entries to boot Debian from the SD card.

                      • 8. Re: New Debian image for Galileo Board

                        I tried your new instructions at "galileo-debian / Wiki / How to Boot the image" and it also does not work.

                        as soon as it starts booting (before grub) , I get several errors on the serial console:


                        [17] -- Data Timeout Error

                        SendCommand: Error happens

                        [12] -- Command Timeout Erro

                        SendCommand: Error happens

                        CardStatus: ADDRESS_OUT_OF_RANGE

                        CardStatus: ILLEGAL_COMMAND

                        [12] -- Command Timeout Erro

                        SendCommand: Error happens

                        CardStatus: ADDRESS_OUT_OF_RANGE

                        CardStatus: ILLEGAL_COMMAND

                        MMCSDBlockReadBlocks: Fail to send READ_MULTIPLE_BLOCK


                        [12] -- Command Timeout Erro

                        SendCommand: Error happens





                             Press [Enter] to directly boot.

                             Press [F7]    to show boot menu options.


                        after exiting grub, in EFI menu:

                        option 2 gives several errors and then shows the menu again


                        CardStatus: ILLEGAL_COMMAND

                        [12] -- Command Timeout Erro

                        SendCommand: Error happens

                        CardStatus: ILLEGAL_COMMAND

                        [12] -- Command Timeout Erro

                        SendCommand: Error happens


                        option 3 goes into EFI Shell version 2.31 [1.0].

                        option 4 redisplays efi menu...


                        Can you please confirm if steps 1-6 in my post were correct ?

                        thank you.

                        PS: is it possible for you to release a slightly smaller image?

                        (Some 1GB cards have less than 1073741824 bytes, for example one "1GB" card I have has 1015808000 bytes, and another one has 996787072 bytes)

                        • 9. Re: New Debian image for Galileo Board

                          Steps 1-3 are correct.

                          In step 4, you have of=/dev/disk1. Usually, the name of the device would be /dev/sdX (Where X is a drive letter) or /dev/mmcblkN (Where N is probably 0) depending on your system.


                          Once you have written the image to your SD card, you might need to remove and re-insert the SD card to see the partitions properly (or run hdparm -z /dev/sdX to do the same thing). Just doing the dd onto the media does not cause the kernel to re-read it to see that the partitions have changed (been replaced actually).


                          You should see 2 partition, one is the EFI boot partition (vfat) and the 2nd one is the root filesystem (ext3).

                          • 10. Re: New Debian image for Galileo Board

                            After looking at the errors again, they might be caused by the cards being smaller than the GPT partition header says it should be.


                            I'll try to make the next image a little bit smaller.

                            • 11. Re: New Debian image for Galileo Board



                              I successfully load the image into the galileo board, but I need to know how to tell grub to load first from SD card. I need to start debian on startup without telling them to do it. How can I do that?


                              An the oder problem I have is about expanding the filesystem to use the SD card. I´d followed you tutorial but I can´t get it to work.


                              I get to the step where I have to use the "resize2fe" command (I assume is resize2fs not resize2fe) but because is a ext3 filesystem it say the following:


                              root@galileo:~# resize2fs /dev/mmcblk0p2

                              resize2fs 1.42.5 (29-Jul-2012)

                              Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required

                              old_desc_blocks = 4, new_desc_blocks = 27

                              resize2fs: Filesystem does not support online resizing


                              Can you help me with this two problems??



                              • 12. Re: New Debian image for Galileo Board

                                You should be able to hit 'F2' to interrupt the EFI boot sequence and then choose to boot from the SD card. I'm having some trouble doing that, so I end up waiting until the grub menu comes up, then hitting 'c' to get to the grub command  like, then 'quit' to exit back to EFI, where I am finally given the boot options menu.


                                For the resize problem, I'm working on a v1.1 image that should have the necessary fix for resizing.