Summary:
- LiveUSB drive boots into Ubuntu installer with a few workarounds.
- USB2.0 is working while in the installer, but using eUSB2 repeater settings from bootloader stages.
- The UFS device is identified and visible in GParted
Next Actions:
- 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
- Working on identifying the I2C devices for the onboard keyboard and touchpad.
- Need to reverse engineer, and make assumptions based on what is output from i2c-tools
- When the eUSB2 repeater is identified, can submit next kernel series submission.
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 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.
Casper:
How to update a bootable USB drive with custom kernel image, DTBs, and initrd:
Updating kernel image
To update the existing kernel image in the casper environment execute the following steps (ignore the kernel build if you don’t aren’t planning on building your own kernel):
#Build the kernel
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- all -j32
#Compress the kernel image
gzip -c arch/arm64/boot/Image > vmlinuz
Now you can replace the vmlinuz file within your bootable USB drive:

Updating DTBs
Similarly as with DTBs, these are generated as part of the kernel build. After executing a build, your DTBs will be all under:

For the Samsung Galaxy Book4 Edge, we are specifically interested in:
“x1e80100-samsung-galaxy-book4-edge.dtb”
You can replace the one that is present in the following casper folder:

Updating initrd
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.
#Unpackage base initrd file
sudo unmkinitramfs -v initrd initrd_test/
#Make modifications to scripts. Usually there are two
#directories, early/ and main/. The casper script is
#within main/scripts/casper.
#Pack up changes into new initrd file
#Credit:
#https://unix.stackexchange.com/questions/591209/how-to-pack-an-extracted-initrd-x-cpio-archive
#Pack early/ first
cd early/
find . -print0 | cpio --null --create --format=newc > ../../hi/newinitrd
#Followed by main/
cd main/
find . | cpio --create --format=newc | xz --format=lzma >> ../../hi/newinitrd
Now, you can rename newinitrd –> initrd, and replace the one in the casper folder on the USB drive:

Leave a Reply to wcheng Cancel reply