Hello.
* 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://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
console=null
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:
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.htmlhttps://wiki.tinycorelinux.net/doku.php?id=wiki:remasteringhttps://forum.tinycorelinux.net/index.php?topic=18122.0https://wiki.tinycorelinux.net/doku.php?id=wiki:boot_splash