General TC > General TC Talk
Splash logo creation and automated script.
(1/1)
Sashank999:
Hello.
--- Code: ---* 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.
--- End code ---
(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://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: ---console=null
--- End code ---
boot code to the kernel (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:
* Create a directory and copy initrd into it.
* Extract initrd to expand the filesystem in it.
* "cd" into the extracted filesystem.
* Copy the logo file (PNG or JPEG), preferably named as "logo".
* Copy fbv and its dependency libraries.
* "chroot" and run "ldconfig" so that the copied dependency libraries are linked to "fbv" properly.
* Modify "/etc/init.d/tc-config" file to include commands to start and quit "fbv".
* Run "cpio" to compress the filesystem into another initrd again.
* (Optional, but important) Make a backup of your initrd and bootloader configuration.
* Add bootcode "console=null" to kernel parameters in your GRUB, Syslinux or bootloader configuration.
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:
* Create a new directory for remastering.
* Copy the initrd file into the remastering directory.
* Copy the logo into the remastering directory.
* Copy the modified tc-config into the remastering directory.
* Run the script with the arguments as specified below.
* Copy the generated initrd named "newtinycore" into your current initrd location.
* Modify your bootloader configuration - add bootcode "console=null" to kernel bootcodes and modify initrd to "newtinycore".
There is no usage message in the script. The usage arguments, in order, are:
* The init ram disk file (initrd), which is corepure64.gz for TCL v15 x86-64.
* The logo to use, it will be renamed to "logo" in the new initrd.
* The modified tc-config file to use.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.
The changes I made to my tc-config are:
--- Code: ---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}"
>
--- End code ---
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://wiki.tinycorelinux.net/doku.php?id=wiki:remastering
https://forum.tinycorelinux.net/index.php?topic=18122.0
https://wiki.tinycorelinux.net/doku.php?id=wiki:boot_splash
Rich:
Hi Sashank999
Just wondering, why didn't you just modify /etc/init.d/rcS ?
Something like this maybe:
--- Code: ---#!/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}"
--- End code ---
One of the reasons for rcS was to allow a user to add commands outside of tc-config:
--- Quote from: andyj on March 26, 2015, 10:40:22 AM --- ... 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. ...
--- End quote ---
Sashank999:
--- Quote from: 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: ---#!/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}"
--- End code ---
One of the reasons for rcS was to allow a user to add commands outside of tc-config:
--- Quote from: andyj on March 26, 2015, 10:40:22 AM --- ... 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. ...
--- End quote ---
--- End quote ---
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.
Rich:
Hi Sashank999
No need to modify your instructions. It should be clear to
anyone reading this thread that either way will work.
neonix:
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
Navigation
[0] Message Index
Go to full version