{"id":367,"date":"2025-01-25T09:24:17","date_gmt":"2025-01-25T09:24:17","guid":{"rendered":"https:\/\/rethinkit.blog\/?p=367"},"modified":"2025-02-09T05:32:45","modified_gmt":"2025-02-09T05:32:45","slug":"samsung-galaxy-book4-edge-ubuntu-24-04","status":"publish","type":"post","link":"https:\/\/rethinkit.blog\/?p=367","title":{"rendered":"Samsung Galaxy Book4 Edge &#8211; Ubuntu 24.04 Ep.1"},"content":{"rendered":"\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-5c0cc5b4-9739-4171-bddd-c9c582288d47\" href=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/wcheng-samsung-galaxy-book4-edge-ubuntu.zip\">wcheng-samsung-galaxy-book4-edge-ubuntu<\/a><a href=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/wcheng-samsung-galaxy-book4-edge-ubuntu.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-5c0cc5b4-9739-4171-bddd-c9c582288d47\">Download<\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-urbanist-font-family\">Summary:<\/h2>\n\n\n\n<ul class=\"wp-block-list has-urbanist-font-family\">\n<li>LiveUSB drive boots into Ubuntu installer with a few workarounds.<\/li>\n\n\n\n<li>USB2.0 is working while in the installer, but using eUSB2 repeater settings from bootloader stages.<\/li>\n\n\n\n<li>The UFS device is identified and visible in GParted<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-urbanist-font-family\">Next Actions:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"has-urbanist-font-family\">Find the eUSB2 repeater being used, i.e. if it is a QC SMB based repeater, or if it is another vendor, such as NXP<\/li>\n\n\n\n<li class=\"has-urbanist-font-family\">Working on identifying the I2C devices for the onboard keyboard and touchpad.\n<ul class=\"wp-block-list\">\n<li>Need to reverse engineer, and make assumptions based on what is output from i2c-tools<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li class=\"has-urbanist-font-family\">When the eUSB2 repeater is identified, can submit next kernel series submission.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-urbanist-font-family\">Technical Details\/Findings:<\/h2>\n\n\n\n<h3 class=\"wp-block-heading has-urbanist-font-family\">eUSB2 Repeater:<\/h3>\n\n\n\n<p>In order to properly install the Ubuntu image from a bootable USB drive, the casper script has to be able to identify a storage device that contains the images.  Without the eUSB2 repeater, USB device will not be identified by the Linux USB host controller.  Luckily, after adding changes to relax the dependency on the eUSB2 PHY driver and the eUSB2 repeater, the USB software can piggyback off previous settings, which works enough to enumerate devices.<\/p>\n\n\n\n<h3 class=\"wp-block-heading has-urbanist-font-family\">Casper:<\/h3>\n\n\n\n<p>How to update a bootable USB drive with custom kernel image, DTBs, and initrd:<\/p>\n\n\n\n<details class=\"wp-block-details has-urbanist-font-family is-layout-flow wp-block-details-is-layout-flow\"><summary>Updating kernel image<\/summary>\n<p>To update the existing kernel image in the casper environment execute the following steps (ignore the kernel build if you don&#8217;t aren&#8217;t planning on building your own kernel):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>#Build the kernel<\/strong>\nmake ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all -j32\n\n<strong>#Compress the kernel image<\/strong>\ngzip -c arch\/arm64\/boot\/Image &gt; vmlinuz<\/code><\/pre>\n\n\n\n<p>Now you can replace the vmlinuz file within your bootable USB drive:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"440\" src=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/vmlinuz_reference-1024x440.png\" alt=\"\" class=\"wp-image-369\" srcset=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/vmlinuz_reference-1024x440.png 1024w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/vmlinuz_reference-300x129.png 300w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/vmlinuz_reference-768x330.png 768w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/vmlinuz_reference-1536x660.png 1536w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/vmlinuz_reference.png 1968w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/details>\n\n\n\n<details class=\"wp-block-details has-urbanist-font-family is-layout-flow wp-block-details-is-layout-flow\"><summary>Updating DTBs<\/summary>\n<p>Similarly as with DTBs, these are generated as part of the kernel build.  After executing a build, your DTBs will be all under:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"262\" src=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_reference-1024x262.png\" alt=\"\" class=\"wp-image-371\" srcset=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_reference-1024x262.png 1024w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_reference-300x77.png 300w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_reference-768x197.png 768w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_reference.png 1043w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>For the Samsung Galaxy Book4 Edge, we are specifically interested in:<br>&#8220;x1e80100-samsung-galaxy-book4-edge.dtb&#8221;<\/p>\n\n\n\n<p>You can replace the one that is present in the following casper folder:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_casper_reference-1024x576.png\" alt=\"\" class=\"wp-image-372\" srcset=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_casper_reference-1024x576.png 1024w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_casper_reference-300x169.png 300w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_casper_reference-768x432.png 768w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_casper_reference-1536x864.png 1536w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/dtb_casper_reference.png 1963w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/details>\n\n\n\n<details class=\"wp-block-details has-urbanist-font-family is-layout-flow wp-block-details-is-layout-flow\"><summary>Updating initrd<\/summary>\n<p>As part of not being able to prepare an Ubuntu ISO package, I had to workaround some of the module loading steps that are assumed by the casper script, as in my set up everything is statically compiled into my kernel image.  In this situation, I had to update the initrd used, because that is where the casper script is located.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>#Unpackage base initrd file\n<\/strong>sudo unmkinitramfs -v initrd initrd_test\/\n\n<strong>#Make modifications to scripts.  Usually there are two\n#directories, early\/ and main\/.  The casper script is\n#within main\/scripts\/casper.<\/strong>\n\n<strong>#Pack up changes into new initrd file\n#Credit:\n#https:\/\/unix.stackexchange.com\/questions\/591209\/how-to-pack-an-extracted-initrd-x-cpio-archive<\/strong>\n<strong>#Pack early\/ first\n<\/strong>cd early\/\nfind . -print0 | cpio --null --create --format=newc &gt; ..\/..\/hi\/newinitrd\n\n<strong>#Followed by main\/\n<\/strong>cd main\/\nfind . | cpio --create --format=newc | xz --format=lzma &gt;&gt; ..\/..\/hi\/newinitrd\n<\/code><\/pre>\n\n\n\n<p>Now, you can rename newinitrd &#8211;&gt; initrd, and replace the one in the casper folder on the USB drive:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"311\" src=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/initrd_reference-1024x311.png\" alt=\"\" class=\"wp-image-373\" srcset=\"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/initrd_reference-1024x311.png 1024w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/initrd_reference-300x91.png 300w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/initrd_reference-768x234.png 768w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/initrd_reference-1536x467.png 1536w, https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/initrd_reference.png 1956w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/details>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Next Actions: Technical Details\/Findings: eUSB2 Repeater: In order to properly install the Ubuntu image from a bootable USB drive, the casper script has to be able to identify a storage device that contains the images. Without the eUSB2 repeater, USB device will not be identified by the Linux USB host controller. Luckily, after adding [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":382,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,8],"tags":[],"class_list":["post-367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projects","category-snapdragon-x-elite"],"jetpack_featured_media_url":"https:\/\/rethinkit.blog\/wp-content\/uploads\/2025\/01\/IMG_20250105_205226636_HDR.jpg","_links":{"self":[{"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/posts\/367","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=367"}],"version-history":[{"count":9,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/posts\/367\/revisions"}],"predecessor-version":[{"id":386,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/posts\/367\/revisions\/386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=\/wp\/v2\/media\/382"}],"wp:attachment":[{"href":"https:\/\/rethinkit.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rethinkit.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}