Tiny Core Linux

General TC => General TC Talk => Topic started by: Sashank999 on December 11, 2024, 07:52:15 AM

Title: Splash logo creation and automated script.
Post by: Sashank999 on December 11, 2024, 07:52:15 AM
Hello.

Code: [Select]
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or your getting fired because your laptop or PC did not boot.
* Please do some research if you have any concerns about commands included in
* this post before running them. YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your configuration or device, I am entirely
* not responsible.
(The above disclaimer is adapted from the posts I saw in XDA Forums).
Except the following 3 paragraphs, other instructions are intended to be read in full and no part should to be skipped.

In order to remaster your Tiny Core installation to show a boot logo like a distro such as Ubuntu, you need to have a image displayed on a device called as framebuffer (https://en.wikipedia.org/wiki/Linux_framebuffer (https://en.wikipedia.org/wiki/Linux_framebuffer), https://www.kernel.org/doc/html/latest/fb/framebuffer.html (https://www.kernel.org/doc/html/latest/fb/framebuffer.html)).

In order to display an image in a simple and non-invasive manner during booting, you can use the kernel framebuffer. A program called "fbv" can be used without the need of writing an image viewer ourselves. fbv already has the capability to display either a PNG or a JPEG image.

AFAIK, the linux kernel takes over the framebuffer as a text mode output for kernel booting logs. If you still run fbv, this will just paint the background of the logs and then the logs will overwrite the image. These logs should be disabled by specifying
Code: [Select]
console=null boot code to the kernel (https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt (https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt)).

Now, in order to run fbv during boot time, it must be available to be executed. To load an executable before complete booting (before filesystem is mounted where TCZs are present), we need to modify the initial ram disk a.k.a. initrd.

Most of the Tiny Core builtin executables such as apps, scripts such as tce-load, etc. are already present in initrd. It is a cpio archive (like a zip file) compressed with gzip (another zip file). Hence, we first need to extract the files from it, add our logo and fbv executable (and its required libraries) and compress it again.

TL;DR The process is:

I have attached a script called "splash-remaster.sh" to this post which contains the sample commands that you can run to make the modifications. Alternatively, you can also run the script itself, which should(as it is tested on my system only with initrd of Tiny Core x86-64 v15) give you a modified initrd without issues.

Script usage instructions:

There is no usage message in the script. The usage arguments, in order, are:
You need to manually edit the tc-config file yourself. As a sample, I have also attached a sample tc-config file. DO NOT USE it as it is, as your Tiny Core version may be different. The original file is located at "/etc/init.d/tc-config".
I also attached the logo I used. It is extracted from this forum, available at https://forum.tinycorelinux.net/Themes/tinycore/images/smflogo.png (https://forum.tinycorelinux.net/Themes/tinycore/images/smflogo.png).

The changes I made to my tc-config are:
Code: [Select]
31a32,39
>
> # Customs.
> fbv -c -u /logo &
> FBV_PID=$!
> PAUSE=1
> echo "${GREEN}FBV PID is ${YELLOW}${FBV_PID}.${NORMAL}"
>
>
643a652,656
>
>
> # Customs 2.
> kill "${FBV_PID}"
>
I have a habit of marking my changes with a "# Customs" comment so that I can remove them if necessary. Other than that, these are the changes you would need to make.
The "PAUSE=1" line is also optional. You can remove it if unnecessary.

I cannot boot into Tiny Core. What should I do ?
As I have said in the instructions earlier, you should have a backup of your initrd and boot configuration always.
Most probable reason that your initrd is not working is if the "tc-config" file does not have correct permissions. It should have executable permissions set.

Some sources I referred:
https://forum.tinycorelinux.net/index.php/topic,24622.0.html (https://forum.tinycorelinux.net/index.php/topic,24622.0.html)
https://wiki.tinycorelinux.net/doku.php?id=wiki:remastering (https://wiki.tinycorelinux.net/doku.php?id=wiki:remastering)
https://forum.tinycorelinux.net/index.php?topic=18122.0 (https://forum.tinycorelinux.net/index.php?topic=18122.0)
https://wiki.tinycorelinux.net/doku.php?id=wiki:boot_splash (https://wiki.tinycorelinux.net/doku.php?id=wiki:boot_splash)
Title: Re: Splash logo creation and automated script.
Post by: Rich on December 11, 2024, 09:39:11 AM
Hi Sashank999
Just wondering, why didn't you just modify  /etc/init.d/rcS ?
Something like this maybe:
Code: [Select]
#!/bin/sh
# RC Script for Tiny Core Linux
# (c) Robert Shingledecker 2004-2012

 ----- Snip -----

clear

# Customs.
fbv -c -u /logo &
FBV_PID=$!

/etc/init.d/tc-config

# Customs 2.
kill "${FBV_PID}"

One of the reasons for rcS was to allow a user to add commands outside of tc-config:
... one of the changes I suggested was to separate tc-config into rcS and tc-config, so that someone could put the splash code in rcS instead of tc-config under the assumption that by not changing tc-config that the splash code would be resistant to version upgrades. ...
Title: Re: Splash logo creation and automated script.
Post by: Sashank999 on December 13, 2024, 03:53:38 AM
Hi Sashank999
Just wondering, why didn't you just modify  /etc/init.d/rcS ?
Something like this maybe:
Code: [Select]
#!/bin/sh
# RC Script for Tiny Core Linux
# (c) Robert Shingledecker 2004-2012

 ----- Snip -----

clear

# Customs.
fbv -c -u /logo &
FBV_PID=$!

/etc/init.d/tc-config

# Customs 2.
kill "${FBV_PID}"

One of the reasons for rcS was to allow a user to add commands outside of tc-config:
... one of the changes I suggested was to separate tc-config into rcS and tc-config, so that someone could put the splash code in rcS instead of tc-config under the assumption that by not changing tc-config that the splash code would be resistant to version upgrades. ...
Hello Rich.
Sorry for the delay in reply. Thank you for the information. I did not know that there was such a file. I probably should modify the instructions but now the modification option is gone.
Title: Re: Splash logo creation and automated script.
Post by: Rich on December 13, 2024, 09:12:31 AM
Hi Sashank999
No need to modify your instructions. It should be clear to
anyone reading this thread that either way will work.
Title: Re: Splash logo creation and automated script.
Post by: neonix on December 26, 2024, 09:45:20 AM
I am too lazy to do this myself. Could someone publish x86-32 and x86-64 core.gz?

https://www.unixmen.com/wp-content/uploads/2015/09/1385698302_funny_linux_wallpapers.jpg