{"id":773,"date":"2010-11-02T13:24:01","date_gmt":"2010-11-02T20:24:01","guid":{"rendered":"http:\/\/www.graphics-muse.org\/wp\/?p=773"},"modified":"2010-11-02T13:29:07","modified_gmt":"2010-11-02T20:29:07","slug":"beaglebox-small-steps-better-xcc-u-bootkernel-boot-but-rootfs-still-hangs","status":"publish","type":"post","link":"https:\/\/www.graphics-muse.org\/wp\/?p=773","title":{"rendered":"BeagleBox:  small steps &#8211; better xcc, u-boot\/kernel boot but rootfs still hangs"},"content":{"rendered":"<p>I couldn&#8217;t figure out why my initrd or rootfs wouldn&#8217;t work and had exhausted all obvious solutions.\u00a0 Jumping to <a href=\"http:\/\/en.wikipedia.org\/wiki\/Occam%27s_razor\">Occam&#8217;s Razor<\/a>, I decided the problem may be with the <a href=\"http:\/\/www.elinux.org\/ARMCompilers\">cross compiler toolchain<\/a>.\u00a0 So I grabbed <a href=\"http:\/\/free-electrons.com\/blog\/beagle-labs\/\">Free Electron&#8217;s<\/a> (FE) <a href=\"http:\/\/free-electrons.com\/doc\/training\/beagle\/labs.pdf\">embedded Linux training lab<\/a> (which focuses on the BeagleBoard) and decided to start over with the cross compiler.\u00a0 I made a minor change to the FE steps in that I&#8217;m using <a href=\"http:\/\/ymorin.is-a-geek.org\/projects\/crosstool\">Crosstools-NG 1.8.2<\/a> which is the latest bug fix release for the 1.8.x series.<\/p>\n<p>The xcc target, which builds the cross compiler toolchain for BeagleBox, now builds completely.\u00a0 It builds a uClibc based toolchain, however.\u00a0 I&#8217;ve heard there may be problems with using this with X.org, but I&#8217;ll have to deal with that &#8211; if necessary &#8211; when I get to it. My old build used Crosstools-NG 1.7.1 and built for glibc.\u00a0 This makes the toolchain a much different beast this time around.<\/p>\n<p>Using the new cross compiler toolchain, I rebuilt <a href=\"http:\/\/www.denx.de\/wiki\/U-Boot\">u-boot<\/a> based on FE&#8217;s instructions.\u00a0 The only difference between those and my original was that my original was pulling from a different git repository.\u00a0 I don&#8217;t think that matters as much as having a working toolchain, however.\u00a0 At least not to simply get the bootloader running.<\/p>\n<p>So the updated u-boot built with the new cross compiler toolchain builds fine and boots correctly now so I know I&#8217;ve got a working combination of cross compiler toolchain and bootloader. I haven&#8217;t tried to rebuild x-loader yet because I see no reason to since it loads my u-boot from the SD card just fine.\u00a0 The BeagleBox kernel, also built with the updated compiler toolchain, boots to the point of trying to mount the rootfs. If I try the initrd it fails but I don&#8217;t know why yet. If the kernel boots directly to the 2nd partition on the SD card (an ext2 rootfs created with <a href=\"http:\/\/buildroot.uclibc.org\/\">Buildroot<\/a>) I get this:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\">Waiting for root device \/dev\/mmcblk0p2&#8230;<br \/>\nmmc0: new SD card at address 88f7<br \/>\nmmcblk0: mmc0:88f7 SU01G 942 MiB<br \/>\nmmcblk0: p1 p2<br \/>\nVFS: Mounted root (ext2 filesystem) on device 179:2.<br \/>\nFreeing init memory: 132K<\/span><\/p>\n<p>Then nothing. Looks like it&#8217;s booting but there is no console output. At least not to the serial console. The bootargs look like this:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\">Kernel command line: console=ttyS2,115200n8 console=tty0 root=\/dev\/mmcblk0p2 rw rootfstype=ext2 rootwait<\/span><\/p>\n<p>I think that&#8217;s correct, but more research into the FE labs is probably needed. And I really want to know why the initrd doesn&#8217;t boot. This is what I get with the initrd:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\">Power Management for TI OMAP3.<br \/>\nVFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 1<br \/>\nregulator_init_complete: incomplete constraints, leaving VDVI on<br \/>\nregulator_init_complete: incomplete constraints, leaving VDAC on<br \/>\ndrivers\/rtc\/hctosys.c: unable to open rtc device (rtc0)<br \/>\nList of all partitions:<br \/>\nNo filesystem could mount root, tried:  ext3 ext2 vfat msdos<br \/>\nKernel panic &#8211; not syncing: VFS: Unable to mount root fs on unknown-block(1,0)<\/span><\/p>\n<p>The bootargs for this one are:<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #003366;\">Kernel command line: console=ttyS2,115200n8 console=tty0 root=\/dev\/ram0 rw initrd=0x81600000<\/span><\/p>\n<p>The initrd is a gzipped compressed ext2 filesystem that is loaded into that memory location by u-boot. So I don&#8217;t know what the problem is. At one point I did get a message that a gzipped file system was found but then I got nothing. And I can&#8217;t seem to get back to that. Ugh.<\/p>\n<p>This problem is detailed, for anyone that wants to follow it, on the <a href=\"https:\/\/www.graphics-muse.org\/bugs\/index.php?do=details&amp;task_id=49&amp;project=2\">BeagleBox issue tracker<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I couldn&#8217;t figure out why my initrd or rootfs wouldn&#8217;t work and had exhausted all obvious solutions.\u00a0 Jumping to Occam&#8217;s Razor, I decided the problem may be with the cross compiler toolchain.\u00a0 So I grabbed Free Electron&#8217;s (FE) embedded Linux training lab (which focuses on the BeagleBoard) and decided to start over with the cross [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[390,8,5,6],"tags":[376,381,454,382,459,450,458,115,460,252,442],"class_list":{"0":"post-773","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-beaglebox-hardware","7":"category-hardware","8":"category-linux","9":"category-software-development","10":"tag-beagleboard","11":"tag-beaglebox","12":"tag-bootloader","13":"tag-buildroot","14":"tag-cross-compiler","15":"tag-ext2-filesystem","16":"tag-free-electron","17":"tag-kernel","18":"tag-occam-s-razor","19":"tag-omap","20":"tag-sd-card","21":"czr-hentry"},"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pe9t8-ct","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=773"}],"version-history":[{"count":5,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions"}],"predecessor-version":[{"id":778,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/773\/revisions\/778"}],"wp:attachment":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}