aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile10
-rwxr-xr-xscripts/make-boot-splash68
-rwxr-xr-xscripts/switch-themes4
3 files changed, 19 insertions, 63 deletions
diff --git a/scripts/Makefile b/scripts/Makefile
index 4c697d2..9c86f0f 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -1,18 +1,22 @@
PL=detect-resolution
SH=make-boot-splash rewritejpeg switch-themes
+SBIN=splash.sh
SYS=bootsplash.sysconfig
sharedir=/usr/share
etcsysdir=/etc/sysconfig
+all: check
+
check:
- @for i in $(SH);do /bin/bash -n $$i || exit 1;echo $$i syntax OK;done
+ @for i in $(SH) $(SBIN);do /bin/bash -n $$i || exit 1;echo $$i syntax OK;done
@for i in $(PL);do perl -c $$i ||exit 1;done
install:
- @mkdir -p $(prefix)$(sharedir)/bootsplash/scripts/ $(prefix)$(etcsysdir)
+ @mkdir -p $(prefix)$(sharedir)/bootsplash/scripts/ $(prefix)$(etcsysdir) $(prefix)/sbin/
@for i in $(SH) $(PL);do install -m755 $$i $(prefix)$(sharedir)/bootsplash/scripts/;done
+ @for i in $(SBIN);do install -m755 $$i $(prefix)/sbin/;done
install -m644 bootsplash.sysconfig $(prefix)$(etcsysdir)/bootsplash
clean:
- rm -f *~ \#*\# \ No newline at end of file
+ rm -f *~ \#*\#
diff --git a/scripts/make-boot-splash b/scripts/make-boot-splash
index d46a338..df0de03 100755
--- a/scripts/make-boot-splash
+++ b/scripts/make-boot-splash
@@ -36,73 +36,21 @@ elif [[ $vgamode == 1600* ]];then
resolution=1600x1200
fi
-if [[ -f $splash_dir/themes/$THEME/images/bootsplash-$resolution.jpg && -f $splash_cfg/themes/$THEME/cfg/bootsplash-$resolution.cfg ]];then
- image=$splash_dir/themes/$THEME/images/bootsplash-$resolution.jpg
- config=$splash_cfg/themes/$THEME/cfg/bootsplash-$resolution.cfg
+if [[ -f $splash_cfg/themes/$THEME/config/bootsplash-$resolution.cfg ]];then
+ config=$splash_cfg/themes/$THEME/config/bootsplash-$resolution.cfg
fi
if [[ -f $splash_dir/themes/$THEME/lilo/message ]];then
cp -f $splash_dir/themes/$THEME/lilo/message /boot/message-graphic
fi
-if [[ -n $image ]];then
- if [[ -z $config ]];then
- echo "Can't find a config files for resolution $resolution";
- exit 1;
- fi
-else #no image
- echo "Can't find images for resolution $resolution";
- exit 1
+if [[ -z $config ]];then
+ echo "Can't find a config files for resolution $resolution";
+ exit 1;
fi
-# From SuSe mk_initrd script
-function out_byte()
-{
- let x=$1
- echo -en "`printf \\\\%o $x`"
-}
-
-function write_int()
-{
- let tmp1=$[$1 & 255]
- let tmp2=$[$1>>8]
- let tmp2=$[$tmp2&255]
- let tmp3=$[$1>>16]
- let tmp3=$[$tmp3&255]
- let tmp4=$[$1>>24]
- let tmp4=$[$tmp4&255]
- out_byte $tmp1
- out_byte $tmp2
- out_byte $tmp3
- out_byte $tmp4
-}
-function write_short()
-{
- let tmp1=$[$1>>8]
- let tmp2=$[$1&0xff]
- out_byte $tmp2
- out_byte $tmp1
-}
-
-function write_header()
-{
- # write signature
- echo -n "BOOTSPL1"
- # write text x coordinate
- write_short $1
- # write text y coordinate
- write_short $2
- # write text width
- write_short $3
- # write text height
- write_short $4
- # write file length
- write_int $5
-}
-
-source $config
-size=`wc -c<$image`
-write_header $tx $ty $tw $th $size >> $initrd_file
-cat $image >> $initrd_file
+if [[ -x /sbin/splash ]]; then
+ /sbin/splash -s -f $config >> $initrd_file
+fi
$splash_dir/scripts/switch-themes -u
diff --git a/scripts/switch-themes b/scripts/switch-themes
index dea6997..3492e09 100755
--- a/scripts/switch-themes
+++ b/scripts/switch-themes
@@ -100,6 +100,10 @@ function switch_theme () {
echo "THEME=$toswitch" >> $sysconfig
fi
rm -f $tmpfile
+ if [[ -d /etc/bootsplash/$toswitch ]]; then
+ rm -f /etc/bootsplash/current
+ ln -s /etc/bootsplash/$toswitch current
+ fi
fi
}