{"id":11600,"date":"2019-07-07T17:01:02","date_gmt":"2019-07-07T15:01:02","guid":{"rendered":"https:\/\/pi3g.com\/?p=11600"},"modified":"2019-07-07T17:02:40","modified_gmt":"2019-07-07T15:02:40","slug":"booting-alpine-linux-on-the-raspberry-pi-compute-module","status":"publish","type":"post","link":"https:\/\/pi3g.com\/de\/booting-alpine-linux-on-the-raspberry-pi-compute-module\/","title":{"rendered":"Booten von Alpine Linux auf dem Raspberry Pi Compute Module"},"content":{"rendered":"<p>In our project for a client we are using the Raspberry Pi Compute Module, along with a custom compute module carrier board (called the <strong>PCCB <\/strong>\u2013 Pi Control Carrier Board) which provides RS485, CAN, RS232, LAN, USB and a step-down for input voltages of 6 \u2013 24 V. (If you are interested in customized hardware and <a href=\"https:\/\/pi3g.com\/kontakt\/\" target=\"_blank\">Raspberry Pi embedded development, please get in touch<\/a>. The initial conversation with us will be free for you, and might provide valuable insights and ideas.)<\/p>\n<p>As operating system we decided to use <a href=\"https:\/\/alpinelinux.org\/\" target=\"_blank\">Alpine Linux<\/a>. Due to it\u2019s read-only, RAM resident nature, it is a perfect fit for an embedded, long-lasting solution which wants to go easy on the Flash memory.<\/p>\n<p>The PCCB offers the possibility to boot from SD card (with the compute module lite), and to boot from the built-in eMMC Flash on the \u201cnormal\u201d compute modules. <\/p>\n<p>While booting from SD card works without problems, when trying to boot from eMMC Flash, we initially ran into issues. <\/p>\n<p>As you might know, Alpine Linux (per default) resides entirely on the FAT partition of the SD card.<\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/07\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"514\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/07\/image_thumb-2.png\" border=\"0\"><\/a><\/p>\n<h1>The issue: screen stays black, ACT LED blinks 7 times<\/h1>\n<p>With the approach to simply copy the files used on the SD card to the eMMC (using the Raspberry Pi boot tool rpiboot on Windows, to mount the compute modules&nbsp; eMMC) the compute module did not boot.<\/p>\n<p>It displays a black screen, and the ACT LED blinks seven times, with a pause, then it again blinks seven times. <\/p>\n<p>Consulting <a href=\"https:\/\/elinux.org\/R-Pi_Troubleshooting#Green_LED_blinks_in_a_specific_pattern\" target=\"_blank\">this page on elinux.org<\/a>,&nbsp; we can see that kernel.img was not found. The Raspberry Pi boot loader is not able to locate the kernel, and therefore unable to boot it.<\/p>\n<p>The screen stays black because splash screens are normally disabled in the <strong>config.txt<\/strong> shipped with Alpine Linux (<em>disable_splash=1<\/em>), otherwise you would get a rainbow screen. <\/p>\n<h1>The solution: move the kernel and initramfs to the main folder<\/h1>\n<p>Apparently there are differences in the ability of the Raspberry Pi boot loader chain to access files in subfolders for the eMMC flash and the SD card.<\/p>\n<p>The solution therefore is to move the kernel to the toplevel \/ \u201croot\u201d folder on the eMMC Flash FAT partition. (On Alpine Linux, the kernel is normally in the <strong>boot <\/strong>subdirectory):<\/p>\n<p>Edit <strong>config.txt<\/strong> to say:<\/p>\n<blockquote>\n<p>disable_splash=1<br \/>\nboot_delay=0<br \/>\ngpu_mem=64<br \/>\n[pi2]<br \/>\nkernel=vmlinuz-rpi2<br \/>\ninitramfs initramfs-rpi2-pi3g<br \/>\n[pi3]<br \/>\nkernel=vmlinuz-rpi2<br \/>\ninitramfs initramfs-rpi2-pi3g<br \/>\n[pi3+]<br \/>\nkernel=vmlinuz-rpi2<br \/>\ninitramfs initramfs-rpi2-pi3g<br \/>\n[all]<br \/>\ninclude usercfg.txt<\/p>\n<\/blockquote>\n<p>Move the kernel and the initramfs to the top folder on the eMMC Flash:<\/p>\n<p><\/p>\n<p><a href=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/07\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"571\" height=\"545\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/pi3g.com\/wp-content\/uploads\/2019\/07\/image_thumb-3.png\" border=\"0\"><\/a><\/p>\n<p>Note: we have created a custom version of the initramfs, to add keys for our custom package(s) which are located in the subfolder pi3g. <\/p>\n<p>There is no need to move the loop filesystem (modloop-rpi2), the System.map-rpi2 or config-rpi2, indeed you would have to change some additional configuration to be able to do that. <\/p>\n<p>After applying these changes, Alpine Linux will boot on the compute module.<\/p>\n<p>We are happy to assist you in building embedded solutions on top of the Raspberry Pi \u2013 hardware and software. <a href=\"https:\/\/pi3g.com\/kontakt\/\" target=\"_blank\">Please get in touch with us<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In unserem Projekt f\u00fcr einen Kunden verwenden wir das Raspberry Pi Compute Module zusammen mit einem kundenspezifischen Compute Module Carrier Board (genannt PCCB - Pi Control Carrier Board), das RS485, CAN, RS232, LAN, USB und einen Step-Down f\u00fcr Eingangsspannungen von 6 - 24 V bereitstellt (Wenn Sie an kundenspezifischer Hardware interessiert sind...<\/p>","protected":false},"author":830,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[401,400],"tags":[417,658,653,654,655,656,369,657,659],"class_list":["post-11600","post","type-post","status-publish","format-standard","hentry","category-alpine-linux","category-raspberry-pi-embedded-development","tag-alpine","tag-boot-problem","tag-compute-module","tag-compute-module-lite","tag-kernel","tag-led-blinks-7-times","tag-raspberry","tag-seven-times","tag-solution"],"_links":{"self":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/11600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/users\/830"}],"replies":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/comments?post=11600"}],"version-history":[{"count":2,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/11600\/revisions"}],"predecessor-version":[{"id":11602,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/11600\/revisions\/11602"}],"wp:attachment":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/media?parent=11600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/categories?post=11600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/tags?post=11600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}