LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-06-2016, 12:07 AM   #1
slacklug
LQ Newbie
 
Registered: Mar 2016
Location: Argentina
Distribution: Slackware
Posts: 7

Rep: Reputation: Disabled
Lightbulb Graphical bootsplash


For graphical bootsplash is necessary ...


create this file

/etc/rc.d/rc.splash-master

Code:
#!/bin/bash
#
# rc.SPLASH-MASTER
# 
# Unifica los antiguos scripts de bootsplash en un unico archivo. 
# El presente script es el resultado de buscar optimizar y corregir
# los scripts *-WRAP de Slackware-Guides-Grafical Boot
# URL = http://wiki.linuxquestions.org/wiki/...Graphical_Boot
#
# Marcos R Orellana aka Avrah - 20/03/2016
# marcos.r.orellana@gmail.com
#

# Segun el nombre con el cual se inicie el script llama al script indicado.
case $0 in
	*rc.S-splash)
		script=/etc/rc.d/rc.S								# Iniciar segun corresponda. Primer script de arranque.
		;;
	*rc.M-splash)
		script=/etc/rc.d/rc.M								# Iniciar segun corresponda. Segundo script de arranque.
		;;
	*rc.K-splash)
		script=/etc/rc.d/rc.K
		echo $0
		;;
	*rc.0-splash)
	 	script=/etc/rc.d/rc.0								# Iniciar segun corresponda. Script de apagado.
	 	;;
 	*rc.6-splash)
	 	script=/etc/rc.d/rc.6								# Iniciar segun corresponda. Script de reinicio.
	 	;;
esac

setterm -reset -msg off -cursor off -bold on							# hide msg and set bold font
fbRes=$(fbset | grep -Po '".*"' | grep -Po '[^"].*[^"]') 					# get resolution from FrameBuffer	
wallpaper="/boot/initrd-tree/bin/busybox fbsplash -s /boot/slackwarelinux-$fbRes.ppm &"		# set wallpaper
$wallpaper											# load wallpaper.

exec $script |										# read info from init script
	while read -r DATA; do									# Lee los datos de entrada
		#$wallpaper									# force to reload wallpaper
		mensaje="$DATA"								# save data read.
	    	ancho_mensaje=${#mensaje}				# set wide msg.
	    	centro_mensaje=$(($ancho_mensaje/2))	# center text
	    	ancho_terminal=$(tput cols)				# set wide screen
	    	alto_terminal=$(tput lines)				# set height screen
	    	ini_linea_texto=$((($alto_terminal/4)*3))					# set cursor pos on 3/4 of screen.
	    	centrar_texto="$ini_linea_texto $(( $(($ancho_terminal/2))-$centro_mensaje))"	# center text.
	    	tput cup $ini_linea_texto 0 && tput ed	    				# delete screen and reset from cursor
		tput cup $ini_linea_texto 5 && echo -en "Ejecutando: "${0%-*}	# Optional, write name of script
		tput cup $centrar_texto && echo -en $mensaje					# show msg
		tput cup $ini_linea_texto $(($ancho_terminal-10)) && echo "[ ok ]"		# optional.
		tput cup $(($ini_linea_texto+1)) 0 && tput ed					# Set cursor pos end line
	done 											
setterm -reset -cursor on							# reset screen and show cursor.

exit 0
and this file with name genbootsplash (for example):

Code:
#!/bin/bash

echo "Calculando resolucion del FrameBuffer ..."
fbRes=$(fbset | grep -Po '".*"' | grep -Po '[^"].*[^"]') # calculate resolution

echo "Configurando imagen ..."
pathImg="/boot/"
imgName="slackwarelinux"
formatImg=".png"
imgBase=$pathImg$imgName

echo "Convert image PNG in PPM  ..."
genImgPPM=$(cd $pathImg; convert -resize $fbRes $imgBase$formatImg $imgBase-$fbRes$formatImg; mogrify -format ppm  $imgBase-$fbRes$formatImg)

echo "Done..."

exit
and modify /etc/inittab:
Code:
#
# System initialization (runs when system boots).
si:S:sysinit:/etc/rc.d/rc.S-splash

# Script to run when going single user (runlevel 1).
su:1S:wait:/etc/rc.d/rc.K-splash

# Script to run when going multi user.
rc:2345:wait:/etc/rc.d/rc.M-splash

# What to do at the "Three Finger Salute".
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Runlevel 0 halts the system.
l0:0:wait:/etc/rc.d/rc.0-splash

# Runlevel 6 reboots the system.
l6:6:wait:/etc/rc.d/rc.6-splash
add wallpaper in png format in /boot and rename slackwarelinux.png.

run mkinitrd and genbootsplash as root.
add your new initrd image and " quiet splash vga=791 loglevel=0 " in your lilo.conf or grub.cfg


in /etc/rd.d/ create link

Code:
ln -s rc.splash-master rc.0-splash 
ln -s rc.splash-master rc.6-splash 
ln -s rc.splash-master rc.M-splash 
ln -s rc.splash-master rc.S-splash 
ln -s rc.6 rc.0
change permission this file

avoid error message getty, it is not necessary.
Quote:
chmod -x /etc/rc.d/rc.sysvinit
quick & dirty

Download and install package.

Video demo: HERE

Spanish howto here.

Last edited by slacklug; 04-06-2016 at 09:14 AM. Reason: edit by suggest
 
Old 04-06-2016, 12:16 AM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Can you please post a file set in English also?
 
1 members found this post helpful.
Old 04-06-2016, 02:33 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Furthermore, a download link pointing to mega.nz ??? I am sure you can find a more trustworthy file host.
Also, you can not expect people to just blindly disable the rc.sysvinit process by running "chmod -x /etc/rc.d/rc.sysvinit" without any explanation why this would be necessary.
 
4 members found this post helpful.
Old 04-06-2016, 06:33 AM   #4
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Also, if you use [code][/code] tags instead of [quote][/quote] tags, it will retain any indentation (or character spaces) in front of each line (since I'm assuming you had it formatted better initially).

Definitely an interesting concept. I'll be interested to read an English version of the script.
 
Old 04-06-2016, 06:43 AM   #5
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by bassmadrigal View Post
Also, if you use [code][/code] tags instead of tags, it will retain any indentation (or character spaces) in front of each line (since I'm assuming you had it formatted better initially).

Definitely an interesting concept. I'll be interested to read an English version of the script.
The concept of doing something that visually changes the Slackware boot, is nice. I like it when I see people tinkering with their Slackware.
However, look at the video. The screen shows every line of the boot process one by one and appends a meaningless "ok" at the end.
The result is that you will not be reading these flashing lines at all. The lack of proper context makes it no longer informational (except in a slow virtual machine perhaps).
I would say, either display the full boot text on a graphical backdrop, or hide the text altogether and display a progress bar instead.
 
2 members found this post helpful.
Old 04-06-2016, 07:44 AM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Alien Bob View Post
However, look at the video. The screen shows every line of the boot process one by one and appends a meaningless "ok" at the end.
Oh, that's a bummer. I am at work, so I didn't watch the video.
 
Old 04-06-2016, 09:28 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
Another quibble,
Code:
fbRes=$(fbset | grep -Po '".*"' | grep -Po '[^"].*[^"]') # calculate resolution
The 'grep -Po '".*"' is pointless, and the code fails on my machine with an nVidia graphics GPU as it returns
Quote:
1280x1024-77
which affects
Code:
genImgPPM=$(cd $pathImg; convert -resize $fbRes $imgBase$formatImg $imgBase-$fbRes$formatImg; mogrify -format ppm  $imgBase-$fbRes$formatImg)
 
Old 04-06-2016, 09:44 AM   #8
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
A progress bar would be better visually as AlienBob suggested. You can always have both the stdout and progress bar.
 
Old 04-06-2016, 11:48 AM   #9
slacklug
LQ Newbie
 
Registered: Mar 2016
Location: Argentina
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
Also, you can not expect people to just blindly disable the rc.sysvinit process by running "chmod -x /etc/rc.d/rc.sysvinit" without any explanation why this would be necessary.
If run rc.sysvinit show this error "stty standard input inappropriate ioctl for device", not is necessary deactivate script
 
Old 04-06-2016, 11:51 AM   #10
slacklug
LQ Newbie
 
Registered: Mar 2016
Location: Argentina
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by allend View Post
Another quibble,
Code:
fbRes=$(fbset | grep -Po '".*"' | grep -Po '[^"].*[^"]') # calculate resolution
The 'grep -Po '".*"' is pointless, and the code fails on my machine with an nVidia graphics GPU as it returns

which affects
Code:
genImgPPM=$(cd $pathImg; convert -resize $fbRes $imgBase$formatImg $imgBase-$fbRes$formatImg; mogrify -format ppm  $imgBase-$fbRes$formatImg)
I dont have nvidia gpu, only use with intel and vesa drivers, you can set manually fbRes var or convert your favorite image in ppm format with gimp.
 
Old 04-06-2016, 11:56 AM   #11
slacklug
LQ Newbie
 
Registered: Mar 2016
Location: Argentina
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Alien Bob View Post
I would say, either display the full boot text on a graphical backdrop, or hide the text altogether and display a progress bar instead.
If set kernel parameters with quiet loglevel=0 console=/dev/tty12 (for example) in bootloader config obtain complete silence boot.
Only mod /boot/initrd-tree/bin/busybox fbsplash -i configfile and delete innecesary code.
 
Old 04-06-2016, 11:57 AM   #12
slacklug
LQ Newbie
 
Registered: Mar 2016
Location: Argentina
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
excuse my bad English :|
 
Old 04-06-2016, 09:21 PM   #13
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
One thing you could do is try to scale the image if possible. That way it will work with any driver, KMS or not.
 
Old 04-07-2016, 08:12 PM   #14
saxa
Senior Member
 
Registered: Aug 2004
Location: Nova Gorica, Salvador
Distribution: Slackware
Posts: 1,212

Rep: Reputation: 295Reputation: 295Reputation: 295
As I side opinion, I liked what I saw in the video, except for the messages, I also agree they are useless, but have them on another tty as they are in slackware right now would be much better. Of course a progress bar is needed, can be made of anything like # or + or * or whatever too

Now that we have PA why not try to add a bootsplash by default on a modern distro like we are right now

Good work !
 
  


Reply

Tags
boot, bootsplash, graphical, slackware



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically start graphical (SDL) program as root on non-graphical Debian the_merovingian Debian 1 03-03-2009 03:20 PM
Lost Graphical Bootsplash, SuSE 10.3 mac57 SUSE / openSUSE 1 04-26-2008 08:24 PM
graphical/non-graphical mode linux_2007_ Linux - Newbie 5 03-06-2007 09:45 AM
graphical lilo....doensn't go graphical -0- Slackware 3 02-01-2005 08:47 PM
Bootsplash ski3r Debian 4 10-18-2004 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration