Puppy Linux Customizations for Remastering

The following list some tips or tricks used to customize Puppy Linux for remastering as Can Bike OS. These brief notes were last verified with Precise Puppy 5.5.

Ctrl-Alt-Backspace:Disable Hard Restarts
Ctrl-Alt-Fn:Disable Console Switching
Date & Time:Change Display Format
Date & Time:Set Default Local Time Zone to Canada/Eastern Standard Time
Desktop:Change Icon Text Fonts
Desktop:Remove “save” Icon from Remastered Puppy
Desktop:Set Coarse Icon Layout
Desktop:Stop Internal Hard Drive from Appearing (pup_event)
Distro Name:Change Displayed Text
Font:Installation
Font:Change Menu Font
Font:Change Window Font
initrd.gz:Disable Searching for Puppy Files
Menu:Edit Items
minixcal:Remove/Replace minixcal Launching From Taskbar
Mouse:Change Single Click to Double Click
Pmount:Remove “drive” Tab
Remaster:Script Location
Save Session:Disable Save on Shutdown
Splash Screen:Change Image
Web Browser:Customize SeaMonkey Default Setup
Welcome:Disable Welcome Screen and Barking Audio of First Boot


[Ctrl-Alt-Backspace] Disable Hard Restarts

Console Restarts or zapping (Ctrl-Alt-Backspace) can be disabled by declaring Option "DontZap" "true" in the Xorg configuration file.

  • Start remastering Puppy Linux
  • Edit /tmp/etc/X11 when presented the option.
  • Set Option "DontZap" "true" in all the template Xorg configuration files.


[Ctrl-Alt-Fn] Disable Console Switching

Console Switching (Ctrl-Alt-Fn) can be disable by declaring Option "DontVTSwitch" in the Xorg configuration file.

  • Start remastering Puppy Linux
  • Edit /tmp/etc/X11 when presented the option.
  • Uncomment Option "DontVTSwitch" in all the template Xorg configuration files.


[Date & Time] Change Display Format

Date and time format configuration is set in /root/.jwmrc-tray. See man strftime for format.

Change Display Format to “Day (mm/dd/yy) 12-hour am/pm”

  • Edit /root/.jwmrc-tray
  • Look for <Clock format=""> tag
  • Replace with <Clock format="%A (%D) %I:%M %P">


[Date & Time] Set Default Local Time Zone to Canada/Eastern Standard Time

/etc/localtime points to the time zone.

  • Start remastering Puppy Linux
  • Edit /tmp/etc when presented the option.
  • From a console perform the following:
cd /tmp/etc
rm localtime
ln -s /usr/share/zoneinfo/Canada/Eastern localtime


[Desktop] Change Icon Text Fonts

ROX-Filer -> Options -> Pinboard

The font color, shadow, size, and type can be adjusted.


[Desktop] Remove “save” Icon from Remastered Puppy

Desktop items are determined by the ROX pinboard configuration file at /root/Choices/ROX-Filer/PuppyPin

  • Start remastering Puppy Linux
  • Edit /tmp/root/Choices/ROX-Filer/PuppyPin when presented the option
  • Delete line containing /usr/sbin/save2flash


[Desktop] Set Coarse Icon Layout

ROX-Filer -> Options -> Pinboard -> Icon grid step

Options are Fine, Medium, or Coarse.


[Desktop] Stop Internal Hard Drive from Appearing (pup_event)

pup_event periodically scans for available devices and displays them on the desktop. The pup_event_frontend_d script is located in /sbin. The variable PROBEDISK is assigned to the script /sbin/probedisk that determines the available devices (hard drive, optical devices, USB storage devices, etc).

  • Create a new script file /sbin/pmount1 with contents:
#!/bin/sh
/sbin/probedisk2|grep -v drive
  • Edit script /sbin/pup_event_frontend_d
  • Change the two variable assignments PROBEDISK="probedisk" to PROBEDISK="pmount1"
  • Delete directory /root/.pup_event
  • Restart X Server or Reboot


[Distro Name] Change Displayed Text

Distro name is declared in /etc/DISTRO_SPECS as variable DISTRO_NAME.

  • Start remastering Puppy Linux
  • Edit file /tmp/etc/DISTRO_SPECS when presented the option.
  • Set new value for variable DISTRO_NAME


[Font] Installation

Copy the fonts to /usr/share/fonts

Run the following from a console:

fc-cache -fv


[Font] Change Window and/or Menu Font

JWM themes set the font for windows and menus.

  • Edit the configuration file /root/.jwm/jwmrc-theme
  • To change the window font look for the equivalent line and change
<WindowStyle>
<Font>DejaVu Sans-12</Font>
...
</WindowStyle> 
  • To change the menu font look for the equivalent line and change
<MenuStyle>
<Font>DejaVu Sans-12</Font>
...
</MenuStyle>


[initrd.gz] Disable Searching for Puppy Files

To limit the “Searching for Puppy Files” edit the init script located inside initrd.gz.

The following are instructions to limit the search to the Live-CD.

1. Uncompress initrd.gz

zcat initrd.gz | cpio -i -d

2. Edit the init script

  • Under LOAD MODULES TO ACCESS DRIVES delete or comment out
if [ "`lsmod | grep -E '^uhci|^ohci|^ehci'`" != "" ];then
 /sbin/wait4usb_classic & #110425
else
 /sbin/wait4usb & #110710 kernel has builtin hid and usb drivers, and without or with my usb-storage patch.
fi
  • Under FINDING PUPPY FILES delete or comment out
while [ ! -e /tmp/flag-usb-ready ];do #110710 wait for usb process to complete.
 usleep 250000 #microseconds
done

if [ -s /tmp/flag-usb-ready ];then #110710 has stuff in it if usb drives exist.

 ALLDRVS="`ls -1 /sys/block | grep -E '^scd|^sd|^mmc|^sr' | tr '\n' ' '`" #110204
 [ "$ALLDRVS" = " " ] && ALLDRVS=""
 [ -e /proc/ide ] && ALLDRVS="${ALLDRVS}`ls -1 /proc/ide | grep '^hd' | tr '\n' ' '`" #110204 ex: sda sdb sr0 hda
 ALLDRVS0="`echo -n "$ALLDRVS" | tr -s ' ' | tr ' ' '\n'`" #110205
 echo "$ALLDRVS0" > /tmp/ALLDRVS0 #110205

 PCPARTSALL="`probepart_init -k`"
 PCPARTS0="`echo "$PCPARTSALL" | grep '^/dev/' | cut -f 1-2 -d '|'  | grep -E 'f2fs|udf|iso9660|ext2|ext3|ext4|reiserfs|msdos|vfat|minix|ntfs' | sed -e 's%/dev/%%'`" #ex: sda1|vfat  130128 add udf. 130216 add f2fs.
 LESSPARTS0="$PCPARTS0"
 #120328 could have iso9660 f.s. booting off a usb flash/hard drive (see BootFlash). exclude /dev/sd and /dev/mmc ...
 OPTICALDRIVES0="`echo "$PCPARTS0" | grep -E 'iso9660|udf' | grep -v -E '^sd|^mmc' | cut -f 1 -d '|'`" #ex: sr0  130128 add udf.
 touch /tmp/OPTICALDRIVES0 #fix
 [ "$OPTICALDRIVES0" ] && echo "$OPTICALDRIVES0" > /tmp/OPTICALDRIVES0 #fix
 echo "ALLDRVS=$ALLDRVS " >> /tmp/puppy-file-search.log

 if [ "$VMLINUZ" = "" -o "$PUPSFS" = "" -o "$SAVEPART" = "" ];then
  search_func usb
 fi
fi
  • Under FINDING PUPPY FILES delete or comment out
if [ "$VMLINUZ" = "" ];then #101103 maybe network boot, no local vmlinuz
 #well, to get this far, PDEV1 has been supplied.
 #110116 jamesbond,shinobar: no, for netboot, PDEV1 is empty, add test for $PDEV1...
 [ "$DEV1FS" = "" -a "$PDEV1" != "" ] && DEV1FS="`echo "$LESSPARTS0" | grep "${PDEV1}|" | cut -f 2 -d '|'`"
 #BOOTDRVL="`echo -n "$PDEV1" | sed -e 's/[0-9]*$//' -e 's/p$//'`" #exs: sda sr   110126 mmcblk0p1 becomes mmcblk0
 #BOOTDRV="`echo -n "$PDEV1" | grep -o -F "$ALLDRVS0"`" #110204 ex: sda1 becomes sda.
 BOOTDRV="`echo -n "$PDEV1" | grep -o -f /tmp/ALLDRVS0`" #110205 ex: sda1 becomes sda.
 VMLINUZ='vmlinuz'
fi
  • Inside Function search_func(), edit the first case and replace ALLDRVS0 with OPTICALDRIVES0
 case $1 in
  ata)
   [ "$PMEDIA" = "usbflash" -o "$PMEDIA" = "usbhd" ] && return
   LESSPARTS0="`echo "$PCPARTS0" | grep -f /tmp/OPTICALDRIVES0`"
  ;;
  *)
   LESSPARTS0="`echo "$PCPARTS0" | grep -v -f /tmp/ATADRIVES0`"
  ;;
 esac

3. Recompress initrd.gz

find . | cpio -o -H newc | gzip -9 > initrd.gz

4. Edit /root/.xinitrc

With the above changes, auto DHCP no longer works during boot-up. Due to the lack of a network connection, the first run setup window will appear without the firewall and sync time option,

A simple fix is to edit .xinitrc and execute dhcpcd before delayedrun.

dhcpcd &

#v2.0.0
/usr/sbin/delayedrun &

5. Remastering

  • Start remastering Puppy Linux.
  • Edit folder puppylivecdbuild when presented the option before mastering ISO
  • Replace initrd.gz with new file.

*Note: Changes to /root/.xinitrc are automtically included when remastering Puppy Linux.


/etc/xdg/templates/_root_.jwmrc is the menu configuration file.

To apply changes execute the following from a console:

fixmenus
jwm -restart

Remaster Menu File

  • Start remastering Puppy Linux
  • Edit /tmp/etc/xdg/templates/_root_.jwmrc when presented the option.


[minixcal] Remove/Replace minixcal Launching From Taskbar

The taskbar launching of minixcal is assigned by the <Clock></Clock> tags in /root/.jwmrc-tray

Remove/Replace minixcal Launching

  • Edit /root/.jwmrc-tray
  • Look for <Clock>minixcal</Clock> tag
  • Delete minixcal or replace with alternate program


[Mouse] Change Single Click to Double Click

ROX-Filer -> Options -> Filer windows -> Single-click Navigation
ROX-Filer -> Options -> Pinboard -> Single-click to open

Uncheck the settings to disable single-clicks.


[Pmount] Remove “drive” Tab

The pmount script is located in /usr/sbin. The variable PROBEDISK is assigned to the script /sbin/probedisk that determines the available devices (hard drive, optical devices, USB storage devices, etc).

  • Create a new script file /sbin/pmount1 with contents:
#!/bin/sh
/sbin/probedisk2|grep -v drive
  • Edit script /usr/sbin/pmount
  • Change the one variable assignment PROBEDISK="probedisk" to PROBEDISK="pmount1"


[Remaster] Script Location

The Remaster Puppy live-CD script is /usr/sbin/remasterpup2


[Save Session] Disable Save on Shutdown

Edit rc.shutdown

  • Start remastering Puppy Linux
  • Edit /tmp/etc when presented the option.
  • Edit script /etc/rc.d/rc.shutdown
  • Comment out or delete the #if [ $PUPMODE -eq 5 ] block
#if [ $PUPMODE -eq 5 ];then #ifpupmode5
 #110919 code moved out to /usr/sbin/shutdownconfig.
 #note, shutdownconfig normally called via /usr/bin/wmreboot or wmpoweroff when want shutdown from X.
# unset PUPSAVE SAVEFS SAVEPART SAVEFILE NAMEONLY SAVEPATH MYPASSWORD SFEXT xPDEV xDEVFS
# if [ ! -f /tmp/shutdownconfig_results ];then
#  shutdownconfig
# fi
# if [ -s /tmp/shutdownconfig_results ];then
#. /tmp/shutdownconfig_results #supplies variables PUPMODE SAVEFS PUPSAVE SAVEPART SAVEFILE NAMEONLY SAVEPATH MYPASSWORD SFEXT
#  rm -f /tmp/shutdownconfig_results #precaution.
# fi
#fi #end ifpupmode5
  • Comment out the two intances of line multisavefunc
  • Comment out the two instances of line echo "$(gettext "Session not saved")" >/dev/console
  • Comment out the line sleep 2 following the last echo "$(gettext "Session not saved")" >/dev/console

Edit wmpoweroff

  • Edit script /usr/bin/wmpoweroff
  • Comment out the line shutdownconfig

Edit wmreboot

  • Edit script /usr/bin/wmreboot
  • Comment out the line shutdownconfig


[Splash Screen] Change Image

Create New Splash Screen

  • Use GIMP to create a 640×388 image
  • Flatten the image, or copy visible and paste as new image
  • Reduce color set to 16
    • Image -> Mode -> Indexed …
    • Set Maximum number of colors to 16
    • Convert
  • Export to logo16.ppm

From Console Convert ppm to lss16 to Create New “logo.16”

ppmtolss16 <logo16.ppm >logo.16

Replace logo.16 with new file

  • Start remastering Puppy Linux.
  • Edit folder puppylivecdbuild when presented the option before mastering ISO
  • Replace logo.16 with new file.


[Web Browser] Customize SeaMonkey Default Setup

Default configuration apply to new profiles made with SeaMonkey Profile Manager. Also applies to default profiles created when no .mozilla folder exists in user’s home directory.

  • Launch SeaMonkey. Make desired configurations to preferences, layouts, toolbar configurations, and panels. Install desired add-ons.

Preferences and Panels

  • Settings are stored in:
/root/.mozilla/[profile id].default/localstore.rdf
/root/.mozilla/[profile id].default/panels.rdf
/root/.mozilla/[profile id].default/prefs.js

where the profile id is composed of numbers and alphabets.
  • Copy the files to /usr/lib/seamonkey/defaults/profile/

Delete Bookmarks and Eliminate Smart Bookmarks

  • Edit /usr/lib/seamonkey/defaults/profile/prefs.js
  • Set browser.places.smartBookmarksVersion to -1
  • unzip /usr/lib/seamonkey/omni.ja to a [temporary directory]
  • Edit [temporary directory]/defaults/profile/bookmarks.html
  • zip contents of [temporary directory] to newomni.ja
  • Replace /usr/lib/seamonkey/omni.ja with newomni.ja
  • Delete [temporary directory]

Add-ons

  • Add-ons are stored as xpi files in:
/root/.mozilla/[profile id].default/extensions/

where the profile id is composed of numbers and alphabets.
  • Add-ons configuration are stored in /root/.mozilla/[profile id].default/extensions.ini
  • Copy the Add-ons xpi files to /usr/lib/seamonkey/extensions
  • Copy extensions.ini to /usr/lib/seamonkey/defaults/profile/


[Welcome] Disable Welcome Screen and Barking Audio of First Boot

File: /usr/sbin/delayedrun

  • To disable the barking, comment out line
aplay /usr/share/audio/2barks.au &
  • To disable the Welcome Pop-Up Screen, comment out line
welcome1stboot &