[HOWTO] Lilo + animated bootsplash

Post tutorials, HOWTO's and other useful resources here.
Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

[HOWTO] Lilo + animated bootsplash

Post#1 by Kriss » 17 Nov 2011, 16:56

Caution! Use at your own risk!

I remebered having an animated lilo bootsplash (xray-blue) several years ago and decided that I want to check if it's still possible.
After some time I found that there's a site with it but the problem was that it was some specially patched lilo version, so I had to find it first.
Then I had to change liloinst.sh like that (so it won't overwrite my custom lilo.conf with message):

Code: Select all

#!/bin/bash
# This script will make almost ANY partition bootable, regardless the filesystem
# used on it. bootsyslinux.sh/bootinst.bat is only for FAT filesystems, while this one should
# work everywhere. Moreover it setups a 'changes' directory to be used for
# persistent changes.

portdir=`pwd`/../../porteus
bootdir=`pwd`/..

set -e
TARGET=""
MBR=""

# Check md5sums before we start
if [ ! -d $portdir ]; then
   echo "Please enter the path to your porteus directory:"
   echo "For example: /mnt/sda5/porteus"
   read portdir
fi
cd $portdir
sh chkbase.sh
cd $bootdir

# Find out which partition or disk are we using
MYMNT=$(cd -P $(dirname $0) ; pwd)
while [ "$MYMNT" != "" -a "$MYMNT" != "." -a "$MYMNT" != "/" ]; do
   TARGET=$(egrep "[^[:space:]]+[[:space:]]+$MYMNT[[:space:]]+" /proc/mounts | cut -d " " -f 1)
   if [ "$TARGET" != "" ]; then break; fi
   MYMNT=$(dirname "$MYMNT")
done

if [ "$TARGET" = "" ]; then
   echo "Can't find device to install to."
   echo "Make sure you run this script from a mounted device."
   exit 1
fi

if [ "$(cat /proc/mounts | grep "^$TARGET" | grep noexec)" ]; then
   echo "The disk $TARGET is mounted with noexec parameter, trying to remount..."
   mount -o remount,exec "$TARGET"
fi

clear
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo "              Backup Mother Boot Record                      "
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
echo
echo "Would you like to backup the MBR of $TARGET now?"
echo "[36m(backing up is recommended)""[0m"
echo "Press  [y/n]"
read bup

if [ "$bup" = "y" ]; then
	dd if=$TARGET of=$MYMNT/mbr.bak bs=512 count=1
	echo
	echo "Backup of mbr is now at $MYMNT/mbr.bak"
	echo "Instructions to restore an MBR in the case of overwriting"
	echo "can be found in boot/docs/restore-mbr.txt"
	echo
	echo "Press enter to continue"
	read abook
fi

MBR=$(echo "$TARGET" | sed -r "s/[0-9]+\$//g")
NUM=$(echo "$TARGET" | sed s^$MBR^^)
cd "$MYMNT"

# only partition is allowed, not the whole disk
if [ "$MBR" = "$TARGET" ]; then
   echo "Error: You must install your system to a partition, not the whole disk"
   exit 1
fi

clear
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
echo "             Welcome to Porteus boot installer              "
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
echo
echo "This installer will setup disk $TARGET to boot only Porteus."
if [ "$MBR" != "$TARGET" ]; then
   echo
   echo "[31mWarning!""[0m"
   echo "Master boot record MBR of $MBR will be overwritten."
   echo
   echo "[36mIf you use $MBR to boot any existing operating system, it will not"
   echo "work anymore.[0m Only Porteus will boot from this device. Be careful!"
   echo "If you made a backup of your MBR it is at $MYMNT/mbr.bak"
   echo "Read the file boot/docs/restore-mbr.txt"
   echo
   echo "[31mNotice!""[0m"
   echo "When you are installing Porteus on writable media like usb stick/hard drive"
   echo "with FAT or NTFS filesystems, you need to use a save.dat container"
   echo "to save persistent changes. This is not necessary if you are saving your"
   echo "changes to a linux partition. You can create a save.dat container file"
   echo "using the Porteus save.dat Manager tool or Porteus Settings Assistant,"
   echo "both of which are available from the KDE or LXDE menu, under the 'System'"
   echo "heading. Booting will continue in 'Always Fresh' mode, until a save.dat"
   echo "file is created and referenced in your /boot/porteus.cfg file."
   echo "[36mYou have been notified!""[0m"
fi
echo
echo "Press any key to continue, or Ctrl+C to abort..."
read junk
clear

echo "Flushing filesystem buffers, this may take a while..."
sync

if [ ! -f $MYMNT/boot/lilo.conf ]
then
cat << ENDOFTEXT >$MYMNT/boot/lilo.conf
boot=$MBR
prompt
#timeout=100
large-memory
lba32
compact
change-rules
reset
install=menu
menu-scheme = Wb:Yr:Wb:Wb
menu-title = "Porteus Boot-Manager"
default = "KDE"

# kde
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label= "KDE"
vga=791
append = "autoexec=xconf;telinit~4 changes=/porteus"

# lxde
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label= "LXDE"
vga=791
append = "lxde autoexec=xconf;telinit~4 changes=/porteus"

# fresh
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label= "Always_Fresh"
append = "nomagic autoexec=xconf;telinit~4"

# cp2ram
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label= "Copy_To_RAM"
vga=791
append = "copy2ram autoexec=xconf;telinit~4"

# startx
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label= "VESA_mode"
append = "autoexec=telinit~4 changes=/porteus"

# text
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label="Text_mode"
append = ""

# pxe
image=$MYMNT/boot/vmlinuz
initrd=$MYMNT/boot/initrd.xz
label= "PXE_server"
append = "autoexec=pxe-boot;xconf;telinit~4"

# plop
image=$MYMNT/boot/syslinux/plpbt
label= "PLoP"

# memtest
image=$MYMNT/boot/tools/mt86p
label = "Memtest"

# Windows?
#other = /dev/sda1
#label = "First_partition"
ENDOFTEXT
fi

echo "Updating MBR to setup boot record..."
./boot/syslinux/lilo -v -C $MYMNT/boot/lilo.conf -S $MYMNT/boot/lilo.boot -m $MYMNT/boot/lilo.map
echo "Disk $MBR should be bootable now. Installation finished."

echo
echo "Read the information above and then press any key to exit..."
read junk 
After that I ungzipped necessary images and placed them in directory /boot/splash
Booted to Porteus 1.1rc1 32 bits (abovementioned lilo was compiled with dynamically linked libraries so it won't work on 64 bit system).
Backuped old lilo from /boot syslinux/lilo and placed new binary there
Ran patched liloinst.sh first time to generate default lilo.conf file, commented out line

Code: Select all

install=menu
and added:

Code: Select all

message=/mnt/sda2/boot/splash/xray-blue.boot 
and changed lilo.conf according to my tastes
Ran liloinst.sh a second time.
And voila!

Well, after that I've rebooted, changed lilo.conf to get rid of /mnt/sda2 so everything pointed to /boot/ instead but that required tweaked liloinst.sh

And that's the end to this necrophylic/masochistic adventure. :D

I wasn't able to get patched sources anywhere to try to compile static lilo binaries. If anybody knows something, please post it!
Last edited by Kriss on 17 Nov 2011, 18:30, edited 1 time in total.
Suggestions/corrections/additions are always welcome.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: [HOWTO] Lilo + animated bootsplash

Post#2 by fanthom » 17 Nov 2011, 18:30

interesting... - walking penguins looks cool :)

wish to have a patch for latest lilo version...
Please add [Solved] to your thread title if the solution was found.

Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

Re: [HOWTO] Lilo + animated bootsplash

Post#3 by Kriss » 17 Nov 2011, 18:37

I've tried to look for such patches, but the closest one I found was this one, and It didn't worked (I got no graphics after applying it to official lilo-22.7.3.tar.gz). I'll try this one next (there are 3 graphic patches and a special readme about graphic)...
Looks like these initiatives died long ago. As I understand, in recent lilos' one can put static picture and customise graphic menu, but that's all.

BTW What do you think about updating liloinst.sh (adding check for existing lilo.conf)? And there's probably problems if I want to use /boot/lilo.conf and not /mnt/something/boot/lilo.conf
Suggestions/corrections/additions are always welcome.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: [HOWTO] Lilo + animated bootsplash

Post#4 by fanthom » 17 Nov 2011, 20:14

What do you think about updating liloinst.sh (adding check for existing lilo.conf)?
i have added a function to liloinst.sh which checks if lilo.conf already exists (/mnt/sdXY/boot/lilo.conf) from previous run. if yes then is being used.
i believe that editing lilo.conf will be easier than editing liloinst.sh if user want to change cheats, fb size, menu itself, etc...
And there's probably problems if I want to use /boot/lilo.conf and not /mnt/something/boot/lilo.conf
/boot folder may be read-only (booting from CD/DVD) or even not mounted at all when copy2ram is used so /mnt/something/boot/lilo.conf is the right one for updates.

@all
be aware that after each change in/ mnt/sdXY/boot/lilo.conf you will have to repeat installation procedure through lin_start_here.sh as lilo boot code must be updated accordingly (unlike syslinux/extlinux, lilo does not do it "on the fly").

Cheers
Please add [Solved] to your thread title if the solution was found.

Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

Re: [HOWTO] Lilo + animated bootsplash

Post#5 by Kriss » 17 Nov 2011, 20:25

fanthom wrote:i have added a function to liloinst.sh which checks if lilo.conf already exists (/mnt/sdXY/boot/lilo.conf) from previous run. if yes then is being used.
i believe that editing lilo.conf will be easier than editing liloinst.sh if user want to change cheats, fb size, menu itself, etc...
Thanks!
fanthom wrote:/boot folder may be read-only (booting from CD/DVD) or even not mounted at all when copy2ram is used so /mnt/something/boot/lilo.conf is the right one for updates.
Ok. I'm just a bit afraid of problems that can occur if using paths like /mnt/sda/boot/vmlinuz on portable devices since it can be sdb next time or on another computer as far as I know.

Oh, and last of Off-Topic questions: is it possible that instead of launching 64 bit Porteus I'll launcsh 32bit one if I have it somewhere else? This happened between Porteus64 on USB and on HDD (before I added sgnfile=...), but luckily not between Porteus64 and Porteus32...
If yes, then what about changing their sgnfiles to be different depending on architecture?
Suggestions/corrections/additions are always welcome.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: [HOWTO] Lilo + animated bootsplash

Post#6 by brokenman » 17 Nov 2011, 23:51

Love it!
If yes, then what about changing their sgnfiles to be different depending on architecture?
The from_ cheatcodes should handle this.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Kriss
Samurai
Samurai
Posts: 135
Joined: 06 Jul 2011, 07:07
Location: Russia

Re: [HOWTO] Lilo + animated bootsplash

Post#7 by Kriss » 18 Nov 2011, 07:43

Thanks!

Ok, I see...
Suggestions/corrections/additions are always welcome.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: [HOWTO] Lilo + animated bootsplash

Post#8 by fanthom » 18 Nov 2011, 07:47

brokenman is right, you can use 'from_dir=' and 'from_dev=UUID:' in case of having multiple porteus editions located on different partitions.

Anyway - i think 'from_' cheats may be not easy to understand for novice users (who may not even know what UUID is) so let's go with Kriss suggestion: porteus-v1.1-i486.sgn for 32bits and porteus-v1.1-x86_64.sgn for 64.

@brokenman
i'll send you all the updates fro rc2 in about 10 hrs.

Cheers
Please add [Solved] to your thread title if the solution was found.

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: [HOWTO] Lilo + animated bootsplash

Post#9 by brokenman » 18 Nov 2011, 15:11

A much more user friendly solution. Slaxers are also familiar with the sgn cheat.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply