Dasharo / dcu

Dasharo Configuration Utility
Apache License 2.0
2 stars 0 forks source link

Improve DCU documentation #19

Open pietrushnic opened 9 months ago

pietrushnic commented 9 months ago

Thanks for adding custom boot logos using DCU (Dasharo Configuration Utility). This was a feature I requested in the early Dasharo Pub meetings last year where you guys asked for suggestions what we want to see in Dasharo if there were a paid version to support sustainablity of the project.

Regarding DCU... could you add some technical info what the converter is supporting. I'm looking at the source code @ https://github.com/Dasharo/dcu/blob/main/src/logo_command.sh and see a bunch of error messages already included which makes me wonder how I can minimize the chance of the image conversion failing or in other words how I can increase the chance that the source image I will provide will be succeessfully converted and included into the coreboot image.

For example the file size both of the original and converted image seem to be a limiting factor. Also the accepted source image file format seems to be PNG, JPEG, SVG or PC bitmap which is awesome but unknown to the user unless we can read about it somewhere.

Originally posted by @Firminator in https://github.com/Dasharo/dasharo-issues/issues/650#issuecomment-1890788806

pietrushnic commented 9 months ago

@BeataZdunczyk @macpijan I would appreciate the creation of a DCU milestone for the next release and adding this issue to the milestone.

mkopec commented 9 months ago

There is 1MB of space for the converted logo, but LZMA compression is applied to the logo so in practice it depends on the image's complexity. A large, complex image like a 1080p photo may not fit, but a smaller photo or a large simple image will probably fit.

We actually had some more info in the docs, but removed it when we migrated to DCU: https://github.com/Dasharo/docs/commit/9ab374589a32a17657c9f0c30c37da6637eea462#diff-0bb66ef7de2d0df01dbd761f33291ea733e6149be364e3829b0eb435e2d7a25b

Maybe we could add the requirements section back.

Firminator commented 9 months ago

Dasharo/docs@9ab3745#diff-0bb66ef7de2d0df01dbd761f33291ea733e6149be364e3829b0eb435e2d7a25b Awesome. This has the information a user might be looking for. Resolution limited to 577×432, 24bit RGB. This info now also raises a question as it says 'uncompressed', but JPG is compressed, so is JPG supported or just BMP?

mkopec commented 9 months ago

@Firminator Uncompressed in this context means the BMP file added to the ROM is in uncompressed BMP format.

This should not be a concern to the user when using DCU as it does the conversion from any JPG, SVG, PNG or BMP file to the correct BMP format automatically: https://github.com/Dasharo/dcu/blob/6817e69d8eab55bc72725a3be4a8627b8d71c31b/src/logo_command.sh#L27

Firminator commented 9 months ago

Sounds good. Thanks for the clarification.

macpijan commented 4 months ago

@BeataZdunczyk can we schedule that, if still relevant?

Firminator commented 1 week ago

Finally got around adding a logo. Converted the coreboot hare into AsciiArt. Worked using DTS v2.0.0 Ran into problems but ultimately was successful. Logo wouldn't show at first... figured I had to dowbscale my image and abide by the max 544x432 resolution we talked about 1 year ago or so; also I encountered a black screen/brick randomly after changing some settings... recovered with the MSI FlashButton-method :thumbsup: to @miczyg1 for reverese-engineering it and implementing it!

Upper left menu and progress bar show up which was a concern of mine. IMG_4680

Firminator commented 1 week ago

Here are the detailed instructions in case you want to spruce up the current documentation @ https://github.com/dasharo/docs/edit/master/docs/guides/logo-customization.md (which is basically a DCU one-liner).

Note: I realize the instructions look convoluted but I had to jump through these hoops since I have no wired internet for several weeks and using a hotspot presents it own challenges for pre-OS tasks like iPXE booting. Hence the usage of flash drives for DTS booting. Also I couldn't figure out where to put the modified boot logo ROM on the DTS drive hence the second flash drive.

/* 
 * 1. Install dependencies
 */
sudo apt install imagemagick
sudo apt install util-linux
sudo wget -O /usr/local/bin/cbfstool https://dl.3mdeb.com/open-source-firmware/utilities/cbfstool
sudo chmod +x /usr/local/bin/cbfstool

/*
 * 2. Replace logo with your own
 * logo max resolution is 577×432
 * copy your logo and the Dasharo .ROM in the same folder, then run the command from that folder
 */
./dcu logo msi_ms7d25_v1.1.3_ddr4.rom -l asciihare_544.png

/* 
 * 3. Rename the .ROM to something meaningful and move it to a FAT32-formatted USB Flash Drive
 */

/* 
 * 4. download DTS v2.0.0 from the Github Releases page, grab second USB Flash Drive make it bootable with DTS
 */
https://github.com/Dasharo/meta-dts/releases/download/v2.0.0/dts-base-image-v2.0.0.wic.gz
gzip -cdk dts-base-image-v2.0.0.wic.gz | \
sudo dd of=/dev/sdX bs=16M status=progress conv=fdatasync

/* 
 * 5. Boot DTS v2.0 from USB Flash Drive
 */
F11 then select your DTS flashdrive

/* 
 * 6. Check and mount the UFD that holds the .ROM with your logo
 * In my case it showed up as /dev/sdd with a partition sdd1
 */
lsblk
fdisk -l
mkdir /media/ufd
mount /dev/sdd1 /media/ufd
mount | grep sdd1

/* 
 * 7. move into the directory that holds your logo ROM and flashrom it
 */
cd /media/ufd
ls
sudo flashrom -p internal --ifd -i bios -w msi_ms7d25_v1.1.3_ddr4_asciihare_544.rom
exit
P(oweroff) or R(estart)

/* 
 * 8. It does a second restart, so give it time. Your logo should show now during boot.
 */
pietrushnic commented 1 day ago

@Firminator, thank you for that contribution. @macpijan @BeataZdunczyk, do you have any ideas where we could add that information so other users will not encounter the same problem or at least have better documentation?