{"id":99,"date":"2006-06-06T12:42:59","date_gmt":"2006-06-06T17:42:59","guid":{"rendered":"http:\/\/www.graphics-muse.org\/wp\/?p=99"},"modified":"2006-06-08T23:07:39","modified_gmt":"2006-06-09T04:07:39","slug":"using-bootsplash-with-linux-kernel-26x","status":"publish","type":"post","link":"https:\/\/www.graphics-muse.org\/wp\/?p=99","title":{"rendered":"Using bootsplash with Linux kernel 2.6.x"},"content":{"rendered":"<p>I&#39;m working on a project to build my own distribution based on <a href=\"http:\/\/www.linuxfromscratch.org\/\" title=\"Linux From Scratch\">Linux From Scratch<\/a> . I&#39;ve been trying to get <a href=\"http:\/\/www.bootsplash.org\/\" title=\"Bootsplash web site\">Bootsplash<\/a> to work with a LiveCD and a netboot version of the distribution.&nbsp; Unfortunately, using bootsplash with Linux kernel 2.6&#39;s <em>initramfs<\/em> is not well documented.&nbsp; Thus, I&#39;m making notes about how I got it working here.<\/p>\n<p>I&#39;ve got a build system working that brings up the system via a netboot just fine, including use of a bootsplash image. That version creates an initrd image by simply using the <font color=\"#cc3300\"><strong><em>splash<\/em><\/strong> <\/font>command output to a file that is used as the initrd (because no real ramdisk image is needed for the netboot). Essentially, it works like this:<\/p>\n<blockquote><p><strong><font color=\"#cc3300\"><em>splash -s -f &gt; initrd.splash<\/em><\/font><\/strong><\/p><\/blockquote>\n<p>and the PXELINUX config file then looks like this:  <em><\/em><\/p>\n<blockquote>\n<p><font color=\"#cc3300\"><strong><em>LABEL bootsplash   <\/em><\/strong><\/font><\/p>\n<p><font color=\"#cc3300\"><strong><em>&nbsp;&nbsp;&nbsp; KERNEL vmlinux   <\/em><\/strong><\/font><\/p>\n<p><font color=\"#cc3300\"><strong><em>&nbsp;&nbsp;&nbsp; APPEND root=\/dev\/nfs rw nfsroot=192.168.0.100:\/mnt\/mythbox ip=dhcp vga=791 initrd=initrd.splash splash=silent<\/em><\/strong><\/font><\/p>\n<\/blockquote>\n<p>So this was a no brainer.&nbsp; But what I really wanted was a LiveCD that would do the same thing.&nbsp; The LiveCD needs a real ramdisk image at boot time.&nbsp; With Linux 2.4 the way to create this image was to create a big, empty file, format it with ext2, mount it and fill it with your rootfs required for booting.&nbsp; Then you simply appended the output from the splash command to that.&nbsp; But with Linux 2.6 the <em>initrd<\/em> is now an <em>initramfs,<\/em> which is actually just a compressed cpio file.&nbsp; Appending the image didn&#39;t seem to work. &nbsp;<\/p>\n<p>I dug around for quite some time trying to find an answer to this.&nbsp; Buried <a href=\"http:\/\/sourceforge.net\/mailarchive\/forum.php?forum_id=36622&amp;max_rows=25&amp;style=nested&amp;viewmonth=200502\" title=\"Bootsplash forum\">deep in the archives of the Bootsplash forum<\/a>  was the answer.&nbsp; The steps are:<\/p>\n<ol>\n<li>Create your compressed cpio image for your initial ramdisk.&nbsp; I call mine <em>mythbox.gz<\/em>, which is based on <a href=\"http:\/\/busybox.net\/\" title=\"Busybox web site\">Busybox.<\/a><\/li>\n<li>Create a splash data file using a command like this:&nbsp; <font color=\"#cc3300\"><em>splash -s -f &lt;path to splash config file&gt; &gt; splashfile<\/em><\/font>&nbsp;<\/li>\n<li>Append the splash data file to the compressed cpio initial ramdisk image:&nbsp; <font color=\"#cc3300\"><em>echo splashfile | cpio -o -H newc | gzip &gt;&gt; mythbox.gz<\/em><\/font><\/li>\n<li>Make sure your <em>isolinux.cfg<\/em> file enables the bootsplash code.&nbsp; The file should look something like this:<\/li>\n<\/ol>\n<blockquote><p><font color=\"#cc3300\"><strong>label linux<br \/> &nbsp; kernel vmlinux<br \/> &nbsp; append initrd=mythbox.gz vga=791 splash=silent ramdisk_size=128000 init=\/sbin\/init root=\/dev\/ram0<\/strong><\/font><\/p><\/blockquote>\n<p>The initramfs image is now actually <em>a multiarchive compressed cpio archive<\/em>, which the kernel handles just fine.&nbsp; Additionally, if you don&#39;t specify the <font color=\"#cc3300\"><em>splash=<\/em><\/font> option (setting it to either <font color=\"#cc3300\"><em>silent<\/em><\/font> or <font color=\"#cc3300\"><em>verbose)<\/em><\/font> then the bootsplash code is not run and you won&#39;t get your bootsplash image.&nbsp; The <em><font color=\"#cc3300\">vga=791<\/font><\/em> option just forces the console display to use higher resolution, making the text look smaller.&nbsp;<\/p>\n<p>So now I have my LFS build system producing bootable versions for netboot and a LiveCD.&nbsp; The netboot option will be used for debugging, since it&#39;s easier to test the distribution without having to burn a CD each time.&nbsp; The CD version will be the production version, as it&#39;s sole purpose will be to manage a consumer device.&nbsp;<\/p>\n<hr width=\"100%\" size=\"1\" noshade=\"noshade\" \/><font><strong>Update 1&nbsp;<\/strong><\/font> <\/p>\n<p>Hang on a tick &#8211; this didn&#39;t work after cleaning up the build.&nbsp; A little investigation found that I needed to copy the output file from the splash command to the Busybox rootfs as <em>bootsplash.<\/em>&nbsp; The question now is:&nbsp; do you have to both of these (appended to initramfs and copied into rootfs) or just the latter?&nbsp; More investigation is needed&#8230;.<\/p>\n<hr width=\"100%\" size=\"1\" noshade=\"noshade\" \/>\n<p><font><strong>Update 2<\/strong><\/font>&nbsp;<\/p>\n<p>Okay, so it seems this is completely wrong.&nbsp; What is required is to copy the splash image file to the rootfs of your initramfs.&nbsp; You don&#39;t need to append the image to the compressed initramfs at all.&nbsp; So the correct process is actually:<\/p>\n<p>Build busybox and install it into a directory.&nbsp; We&#39;ll call it <em>\/mnt\/mythbox\/busybox<\/em>.&nbsp;<\/p>\n<ol>\n<li>Create a splash data file using a command like this:&nbsp; <strong><font color=\"#cc3300\"><em>splash -s -f &lt;path to splash config file&gt; &gt; splashfile<\/em><\/font><\/strong><\/li>\n<li>Copy splashfile to the top level of your busybox directory: <font color=\"#cc3300\"><em><strong>cp splashfile \/mnt\/mythbox\/busybox\/bootsplash<\/strong><\/em><\/font>&nbsp; Note that the filename in the busybox directory must be <strong><em>bootsplash.<\/em><\/strong><\/li>\n<li>Now build your compressed cpio image that will be your 2.6 initramfs.&nbsp; You don&#39;t need to append the splash file to the compressed initramfs. <\/li>\n<\/ol>\n<p>Now it works.&nbsp; This makes sense, too, if you read the bootsplash patch in the init() function.&nbsp; It tries to open the file &quot;\/bootsplash&quot;.&nbsp; I can see how people thought you still needed to append the file because that&#39;s what you did with 2.4.&nbsp; But I&#39;m not sure why the information about placing the file in the root of the rootfs isn&#39;t posted somewhere else.<\/p>\n<p>Anyway, this seems to work now.&nbsp; I&#39;ve verified it with several builds. &nbsp;&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#39;m working on a project to build my own distribution based on Linux From Scratch . I&#39;ve been trying to get Bootsplash to work with a LiveCD and a netboot version of the distribution.&nbsp; Unfortunately, using bootsplash with Linux kernel 2.6&#39;s initramfs is not well documented.&nbsp; Thus, I&#39;m making notes about how I got it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","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":[5,6],"tags":[619],"class_list":{"0":"post-99","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-linux","7":"category-software-development","8":"tag-linux","9":"czr-hentry"},"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pe9t8-1B","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\/99","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=99"}],"version-history":[{"count":0,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphics-muse.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}