{"id":2604,"date":"2019-09-09T17:20:09","date_gmt":"2019-09-10T00:20:09","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=2604"},"modified":"2019-09-09T17:20:09","modified_gmt":"2019-09-10T00:20:09","slug":"arm-original-hikey-updated-and-fixed-with-gotchas","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=2604","title":{"rendered":"ARM &#8211; Original Hikey Updated and Fixed &#8211; with Gotchas.."},"content":{"rendered":"<p>After successfully updating and re-configuring the Odroid C2 to use Fedora <strong>uefi\/grub2<\/strong> to boot, I decided to try to do the same to the even-older Hikey SOC.<\/p>\n<p>This already booted using <em>fastboot<\/em> with an older version of grub, with manual configuration, but I wanted to use the standard (Fedora) boot process.<\/p>\n<p>I had read that there was a &#8216;known-problem&#8217; with fastboot on the Hikey, and it could only access the eMMC during the initial stages of the pre-kernel-load boot process, and tests proved this to be the case. Booting into grub worked OK, but referencing the SDCard produced a<br \/>\n<code><span style=\"font-family: Courier New, Courier, monospace;\"><strong>..\/..\/grub-core\/kern\/disk_common.c:46:attempt to read or write outside of disk `hd1'<\/strong><\/span><\/code><br \/>\nerror message, and from the grub boot prompt the top-level directories on the SDCard <span style=\"font-family: Courier New, Courier, monospace;\"><strong>(hd1,1)<\/strong><\/span> listed OK, but their contents could not be accessed.<br \/>\nFortunately the 3GB eMMC has sufficient accessible space for the <strong><span style=\"font-family: Courier New, Courier, monospace;\">\/EFI<\/span><\/strong> and <strong><span style=\"font-family: Courier New, Courier, monospace;\">\/boot<\/span><\/strong> directories, and so I moved the entire boot directory contents from the SDcard to the larger partition (EXT4) on the eMMC. and the (Fedora) EFI contents to the smaller (FAT16) eMMC partition..<\/p>\n<p>The system is basically a &#8216;naked&#8217; phone with the ability to boot Linux, so the built-in eMMC has a typical Android phone partition layout:<br \/>\n<code><strong><span style=\"font-family: Courier New, Courier, monospace;\">Model: MMC MMC04G (sd\/mmc)<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Disk \/dev\/mmcblk0: 3926MB<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Sector size (logical\/physical): 512B\/512B<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Partition Table: gpt<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Disk Flags:<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">Number Start End Size File system Name Flags<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">1 1049kB 2097kB 1049kB vrl msftdata<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">2 2097kB 3146kB 1049kB vrl_backup msftdata<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">3 3146kB 4194kB 1049kB mcuimage msftdata<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">4 4194kB 12.6MB 8389kB fastboot bios_grub<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">5 12.6MB 14.7MB 2097kB nvme msftdata<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">6 14.7MB 81.8MB 67.1MB fat16 boot boot, esp<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">7 81.8MB 350MB 268MB reserved msftdata<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">8 350MB 619MB 268MB cache<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">9 619MB 3825MB 3207MB ext4 system msftdata<\/span><\/strong><\/code><br \/>\n&#8211; which appear in Linux as:<br \/>\n<code><strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 32 Sep 3 06:40 \/dev\/mmcblk0boot0<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 64 Sep 3 06:40 \/dev\/mmcblk0boot1<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 1 Sep 9 17:29 \/dev\/mmcblk0p1<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 2 Sep 9 17:29 \/dev\/mmcblk0p2<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 3 Sep 9 17:29 \/dev\/mmcblk0p3<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 4 Sep 9 17:29 \/dev\/mmcblk0p4<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 5 Sep 9 17:29 \/dev\/mmcblk0p5<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 6 Sep 9 17:29 \/dev\/mmcblk0p6<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 7 Sep 9 17:29 \/dev\/mmcblk0p7<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 8 Sep 9 17:29 \/dev\/mmcblk0p8<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">brw-rw---- 1 root disk 179, 9 Sep 9 17:29 \/dev\/mmcblk0p9<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">crw------- 1 root root 244, 0 Sep 3 06:40 \/dev\/mmcblk0rpmb<\/span><\/strong><\/code><\/p>\n<p>With these changes, the system booted into <strong>grub<\/strong>, and displayed the usual Fedora menu.<br \/>\nI then tested compiling a standard kernel on the system, but found that the result hung on booting. For some reason, the <strong>initramfs<\/strong> image was not being created as part of the kernel install, and so I had to create it manually each time, from the <span style=\"font-family: Courier New, Courier, monospace;\"><strong>\/boot<\/strong><\/span> directory:<br \/>\n<code><span style=\"font-family: Courier New, Courier, monospace;\"><strong># dracut -v initramfs-&lt;kernel version&gt;.img &lt;kernel version&gt;<\/strong><\/span><\/code><br \/>\nThis has to be done <span style=\"text-decoration: underline;\">before<\/span> running <strong>grub-customizer<\/strong>, or the corresponding <strong>initrd&#8230;&#8230;..<\/strong> parameter will not be added to the grub boot instructions, and the boot will hang.<br \/>\nRemember &#8211; if you want it &#8211; to install <strong>busybox<\/strong> in advance, so this will be included with the initramfs.. creation.<br \/>\nThe fstab entry looks like this:<br \/>\n<code><span style=\"font-family: Courier New, Courier, monospace;\"><strong># cat \/etc\/fstab<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>UUID=&lt;SDCard, Partition 1 UUID&gt; \/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ext4 defaults 1 1<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>UUID=&lt;eMMC, Partition 6 UUID&gt;\u00a0\u00a0 \/boot\/efi vfat umask=0077,shortname=winnt 0 2<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>UUID=&lt;eMMC, Partition 9 UUID&gt;\u00a0\u00a0 \/boot\u00a0\u00a0\u00a0\u00a0 ext4 defaults 1 2<\/strong><\/span><br \/>\n<span style=\"font-family: Courier New, Courier, monospace;\"><strong>\/SWAP\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 none\u00a0\u00a0\u00a0\u00a0\u00a0 swap defaults 0 0<\/strong><\/span><\/code><\/p>\n<p>A major issue with this system, is that it overheats chronically &#8211; and always has.<br \/>\nI run kernel compiles single-threaded, but still get occasional compiler &#8216;crashes&#8217;, with<br \/>\n<code><strong><span style=\"font-family: Courier New, Courier, monospace;\">[ 174.353880] hisi_thermal f7030700.tsensor: sensor &lt;2&gt; THERMAL ALARM stopped: 61675 &lt; 65000<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">[ 5617.609038] hisi_thermal f7030700.tsensor: sensor &lt;2&gt; THERMAL ALARM: 66385 &gt; 65000<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">[ 5649.617335] hisi_thermal f7030700.tsensor: sensor &lt;2&gt; THERMAL ALARM stopped: 61675 &lt; 65000<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">[ 5652.562227] hisi_thermal f7030700.tsensor: sensor &lt;2&gt; THERMAL ALARM: 66385 &gt; 65000<\/span><\/strong><br \/>\n<strong><span style=\"font-family: Courier New, Courier, monospace;\">[ 5696.207883] hisi_thermal f7030700.tsensor: sensor &lt;2&gt; THERMAL ALARM stopped: 61675 &lt; 65000<\/span><\/strong><\/code><\/p>\n<p>So &#8211; time to invest in a larger heatsink, and fan!<\/p>\n<p><em>Robert Gadsdon. September 9th, 2019.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After successfully updating and re-configuring the Odroid C2 to use Fedora uefi\/grub2 to boot, I decided to try to do the same to the even-older Hikey SOC. This already booted using fastboot with an older version of grub, with manual configuration, but I wanted to use the standard (Fedora) boot process. I had read that there was <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=2604\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1132,91,10,1238,11,1146,14,15,19,1160],"tags":[2096,1135,1133,101,126,154,177,1164,1147,1383,1162,419],"class_list":["post-2604","post","type-post","status-publish","format-standard","hentry","category-aarch64","category-arm","category-fedora","category-fix","category-hacks","category-hikey","category-kernel","category-linux-2","category-opinion","category-uefi","tag-2096","tag-aarch64","tag-arm64","tag-boot","tag-configuration","tag-fedora-2","tag-gotchas","tag-grub","tag-hikey","tag-soc","tag-uefi","tag-workarounds"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2604"}],"version-history":[{"count":3,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2604\/revisions"}],"predecessor-version":[{"id":2607,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2604\/revisions\/2607"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}