http://www.murga-linux.com/puppy/viewto ... 553#156553
No major upgrades, but it should run a little smoother and supports logging of the hidden boot messages.
Pebble 0.8 - BETA!
Pebble is a very basic boot splash system. It can be disabled with the boot option pfix=nosplash, but there isn't a hot-key to disable it while it's actually booting. It does not have internal support for progress bars, but they can be implemented by using staged animation (Make stage_1 an image of a 0% bar, stage_2 and image of a 20% bar, etc., then just incriment the stage at key points. Not ideal, but it works.) One more thing not supported is split screen.
All these non-supported things are on my long-term to-do list, but will not happen in the near future.
Installing Pebble:
Installing Pebble involves modifying your initrd.gz file. Because of this, I can't just provide a dotpup. What I can do is provide pre-set initrd.gz files for a couple versions of Puppy, and hopefully enough documentation and examples for you to modify things yourself for other versions (I did try to make it as simple as possible when writing Pebble, and version 0.8 is the simplest yet).
For this guide, I will assume you're running Puppy 3.01. I'll also provide a package for 3.00, and these instructions will work for that too (just change 3.01 to 3.00). For other versions of Puppy, read this anyways to get an idea, then read the section afterwards for technical details.
Okay, first things first. Download pebble_p301-0.8.tar.gz from the bottom of this post. Extract it somewhere (clicking it should bring up a gui, but I prefer just opening a terminal and running tar -xf pebble_p301-0.8.tar.gz). It should spit out two things: a new initrd.gz file, and a petget titled "pebble_postinit-0.8.pet". We'll start with the easy part: Click pebble_postinit-0.8.pet to install it. That will install several things you'll need, including slight tweaks to some system scripts.
WARNING: This will modify /etc/rc.d/rc.country, rc.country-PUP217, rc.local0, and rc.sysinit. If you have any custom changes to those files, back them up and manually apply those changes to the new versions (or the reverse, whichever you prefer). Tkdiff is very handy for this purpose
Okay, next you need to install the new initrd.gz and alter your boot commands. This part is going to be different for each person, though I'll try to cover as many situations as I can. I'll devote a section for each situation, but first I need to explain something common to all: the frame buffer. Specifically, how to set it. It uses the boot option vga=### where ### is either a number or normal. normal is what it defaults to when you don't use this option. Otherwise, it will be the mode that corresponds with the number. Different modes have different color depths and resoultions. For this guide, I will use 785, which is 640x480x64k. You're free to use whatever you want, but keep in mind that Pebble does not scale images yet, so make sure you set it appropriately for the theme you use (using too big a resolution won't hurt, the boot image will just be centered in the middle, surrounded by black). The default theme included with Pebble uses 640x480. The monkey theme is 800x600 (vesa=788). Also something to note: whatever you set will also apply to Puppy's CLI. It won't affect Xwindows, but when you drop out to the commandline, you'll have whatever resolution you use here.
Code: Select all
no framebuffer: vga = normal
1024x768x64k: vga=791
1024x768x32k: vga=790
1024x768x256: vga=773
800x600x64k: vga=788
800x600x32k: vga=787
800x600x256: vga=771
640x480x64k: vga=785
640x480x32k: vga=784
640x480x256: vga=769
Now that that's out of the way, on with the installation.
LiveCD
If you use Puppy as a LiveCD, you will need to edit the Puppy iso to add the new initrd.gz file. Isomaster is a program that can do this, which is included with Puppy. Just use it to delete the old one, then plop in the new on I provided.
You also need to modify the isolinux.cfg file that is within the iso. Probably, you'll have to do that by extracting it from the iso, editing it, then putting it back in. Find the line that looks like this:
Code: Select all
append initrd=initrd.gz pmedia=cd
Code: Select all
append initrd=initrd.gz pmedia=cd vga=785
Okay, that should do it. At this point you should have a new iso file. If all went well, you should be able to just burn that to a disk and boot. If not, let me know exactly what you did, and post a copy of your isolinux.cfg (please put it within the
Code: Select all
[/code ] tags, it's easier to read that way).
[u]Multisession[/u]
My sincere apologies, but I don't know how to do it with this yet. I think you might be able to follow the directions above for LiveCD to create a new disk with the boot splash (burnt open for multisession), then remove your normal disk from the drive, insert the new disk, and just let Puppy save to that like it was the original. I suspect that will work, but I'm not certain. One of these days I'll have to test it, unless somebody can confirm that this works.
[u]Frugal/Full HD[/u]
I'm going to assume you use Grub. If you use Lilo, add the vga=785 option to the append line of lilo.conf, and make sure you run lilo after you finish everything.
Okay, first you need to add the new initrd.gz file. Where you put it depends on how you're system is set up. In my case, I have initrd.gz at /mnt/home/boot/puppy301/initrd.gz. You should know where it is on your computer, otherwise use [b]find / -name initrd.gz[/b] to find all initrd.gz files on your system, and determine which one to replace. Once you have it located, just delete or rename it, then drop in the new version.
Second step: Dig up your menu.lst file, which for me is at /mnt/home/boot/grub/menu.lst. Find the line that looks like this: [code]kernel /boot/puppy301/vmlinuz PMEDIA=satahd
Code: Select all
kernel /boot/puppy301/vmlinuz PMEDIA=satahd vga=785
Now it should be finished. If all goes well, a reboot will start you up with a nice refreshing splash instead of text. If not, let me know exactly what you did, and post a copy of your menu.lst (please put it within the
Code: Select all
[/code ] tags, it's easier to read that way).
[u]USB[/u]
Okay, first you need to add the new initrd.gz file. Mount your USB drive. The old initrd.gz file should be right there. Just back it up somewhere and drop in the new one.
Next, edit the syslinux.cfg file. Find the line that looks like this: [code]default vmlinuz initrd=initrd.gz pmedia=usbflash
Code: Select all
default vmlinuz initrd=initrd.gz pmedia=usbflash vga=785
Now it should be finished. If all goes well, a reboot will start you up with a nice refreshing splash instead of text. If not, let me know exactly what you did, and post a copy of your menu.lst (please put it within the
Code: Select all
[/code ] tags, it's easier to read that way).
Now it should be finished. If all goes well, a reboot will start you up with a nice refreshing splash instead of text. If not, let me know exactly what you did, and post a copy of your syslinux.cfg (please put it within the [code ] [/code ] tags, it's easier to read that way).
[b][u]Technical Details[/u][/b]
You can skip this if you don't care how it works. If you're interested in themeing, you'll want to read this. Also usefull if you want to add Pebble to a version of Puppy I haven't provided a package for.
Okay, here's the brief overview of how Pebble works. There are two key programs: /bin/pebble-daemon and /bin/pebble. pebble-daemon is the program that does the actual work of displaying the images. It is not controled directly though, as that would be tedious. Instead, /bin/pebble is the main interface point, but since the name "pebble" isn't very descriptive, it is symlinked to /bin/bootsplash, which is how I call it in all the files I've provided. So to start the daemon, you'd call [b]bootsplash start[/b], and to stop it, you'd do [b]bootsplash stop[/b]. I'll go ahead and list all the options you should be using at this point (there are more if you read the scripts and sources, but they're leftovers from various other schemes, which I've neglected to delete in case I need them again):
[quote][b]bootsplash start[/b]
This starts the daemon. It should only be used at the very beginning, to start things up.
[b]bootsplash pause[/b]
This pauses the daemon and restores the normal screen output. You need to use this command before places in the boot process where things need to be shown to the user, such as the keyboard wizard, choosing a save file, etc.
[b]bootsplash resume[/b]
This resumes the daemon where it left off, after a pause. Do NOT use this after a switch_root! (that uses revive)
[b]bootsplash switch_root[/b]
This is necissary before Puppy does the switch_root. It hibernates the daemon (saves the current state and frame, then shuts down without adjusting the display), and moves any important files (like the pipe) into the new filesystem. Note: This needs to be run before /proc and co. are unmounted (several lines above the switch_root, no biggie)
[b]bootsplash revive[/b]
This is what you use in /etc/rc.d/rc.sysinit to start the daemon back up after the switch_root. It will load the previously saved frame and stage and continue where it left off.
[b]bootsplash next[/b]
This one increments the stage. (This is overflow safe, so if you have more next's than you have stages, it will just ignore the superfluous calls).
[b]bootsplash previous[/b]
This decrements the stage, and is underflow safe the same as next.
[b]bootsplash stop[/b]
This shuts down the daemon and restores the normal output.[/quote]
In case your wondering about the stages, it's basically support for multiple animations. See the section on theme format for more info.
These commands will mostly be in the /init file of the initrc.gz file. There are also some in /etc/rc.d/rc.country, rc.country-PUP217, rc.local0, and rc.sysinit, at least in Puppy 3.01. In other versions you'll need them in other spots. Usually you'll want the [b]stop[/b] in rc.local0 though.
Just adding all these commands isn't enough though. Puppy needs to have the frame-buffer enabled for this to work. That's easy enough, just boot with the vga=785 option. However, you'd find that doing that alone would render all CLI text invisible. This is because you need to load the fbcon module for the console to output to the framebuffer. Puppy doesn't have that module by default, so I compiled it myself, and added a line in /init to modprobe it (which was nice compared to in older Puppies that didn't have modprobe in initrd.gz, so you had to use zcat piped to insmod on fbcon and all it's dependant modules, which was kind of ugly).
And that sums up most all the changes I had to make. I had to include the kernel modules, my binaries, and some dependancies for pebble within the initrd.gz file. (Future versions will be statically compiled, and with smaller libraries like uclib). The extra files you install with the PETget are just the modified rc.* files and the binaries. The theme itself gets copied (if it doesn't exist already) by [b]bootsplash switch_root[/b].
If you want still more info, you can compare the packages I provided with the standards. Also, I uploaded an extra package that contains diffs of all the modified files, along with the source and all the extra modules and libraries. I apologize in advance about the source being kind of messy and undocumented. I worked off of the nifty FBV image viewer app to avoid having to immediately write my own image processing rutines (I do plan to do that eventually). Unfortunately, the author of FBV didn't seem to be fond of commenting his code. Also, I haven't gotten around to cleaning up the src directory, so you'll find that the ./configure script is broken. It isn't needed anyways, just use make. Any documentation or license info in there is also the original stuff. Mostly the only things I've altered are main.c and the make file. The original source should be availible online, just check his old documentation for a link. If not, I should have it on my drive somewhere. (I fully intend to clean everything up soon, but I didn't want to delay uploading this beta just for superficial stuff like that. I'm already over a month late and feel guilty for making poorani wait this long...)
[b][u]Theme Format[/u][/b]
First off, the supported image formats: .bmp, .jpg, and .png.
Okay, now to explain how this works. So far, it isn't very complex. When Pebble starts, it reads /etc/pebble/theme to get the name of the theme to use. Then it reads /etc/pebble/<theme_name>/theme.conf to get the configuration. So if you have [b]theme[/b] set to [b]paw_fade[/b] it will load /etc/pebble/paw_fade/theme.conf.
The theme.conf files look like this:
[code]ram_glutton false
stage
fps 20
images stage_1
loop true
loop_start 13
end_stage
stage
fps 30
images stage_2
loop false
end_stage
Before I continue, I should explain what a stage is. They are basically a method to have multiple animations, so that you can update things throughout the boot process. Each stage is one animation, and they're stored in the order defined. When you run bootsplash next it will move on to the next animation in the sequence, and bootsplash previous goes to the previous animation. In this way, you could implement a loading bar. You'd set the first stage's image to be an empty bar, the second stage's as a 10% bar, the third's as a 20%, etc. Then incriment it every so often within the boot scripts.
It's not as robust as I'd like yet, as it can only be incremented and decremented. You can't just tell it to use stage 4. I'll improve it some day, but it's not high on my priority list.
Okay, so now that that's clear (hopefully), I'll explain the file on a line-by-line basis:
Code: Select all
ram_glutton false
Code: Select all
stage
Code: Select all
fps 20
Code: Select all
images stage_1
Code: Select all
loop true
Code: Select all
loop_start 13
And please take note: This goes by number, NOT filename. It doesn't care if an image is named 13.jpg, m.jpg, or Zeratul.jpg, so long as it comes 14'th when they're put in alphabetical order. No, that isn't a typo. I'm indexing from 0, so the first frame is 0, the second is 1, etc. This is why I suggested naming your images starting with 0000.jpg. If you don't like it, hey, this is open source. Just go add a +1 in the appropriate place, recompile, and add the new binary to /bin in initrd.gz and the normal filesystem.
Code: Select all
end_stage
Then it just goes into another stage section. As you can see, you don't do anything special like numbering the stages. Just define them in order. Also, you can have multiple stages pointing at the same location for images. That might come in handy if you want the first and last sections the same, but need something different in the middle. Or if you want to alter the looping or framerate mid-way through.
And, that's a theme file.
Adding a new theme
If you want to add a new theme, you'll need to edit the initrd.gz file and add it to the relevant place (etc/pebble/). Don't forget to set etc/pebble/theme to contain the name of the theme. During the boot process, any new themes will automatically be copied from initrd.gz into the save_file, as long as they don't already exist (currently, it will not overwrite any existing file other than /etc/pebble/theme, though I plan to improve it so it can tell which files are newer).
To edit initrd.gz, open a terminal in the same location as it (make sure it's a linux partition), and run this:
Code: Select all
mkdir initrd-tree
cd initrd-tree
zcat ../initrd.gz | cpio -i -d
Code: Select all
find . | cpio -o -H newc | gzip -9 > ../initrd.gz
Note: There may be an error/difference with Puppy's cpio program, resulting in an absurdly large initrd.gz due to dereferencing symlinks. There are a couple solutions. The simplist is to use the dev package I provided below. It includes a script you can just click to build the new initrd.gz file. Make any changes in the new-initrd-stuff directory, and click the makecpioinitrd script. Or, you could just overwrite Puppy's cpio with the one included in the dev package, then follow the first set of instructions I posted. If you happen to have the unleashed-core installed for Puppy 3.xx, you could also steal the cpio program from the boot/ directory of it, as that's the same one I used.
Packages
These are the pre-packaged packages mentioned in the installing section:
http://www.browserloadofcoolness.com/so ... 0.8.tar.gz
http://www.browserloadofcoolness.com/so ... 0.8.tar.gz
This is the extra package, which includes everything in both of the above packages, along with diffs and the source.
http://www.browserloadofcoolness.com/so ... 0.8.tar.gz
In the 300/ and 301/ directories, you'll find these directories:
initrd-tree_ORIG
new-init-stuff
along with this script:
makecpioinitrd
Clicking that script will create a directory "initrd-tree" and populate it with the combined contents of initrd-tree_ORIG and new-init-stuff, then build a new initrd.gz file. You can use that as an easy way to modify things.