Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Dec 2014, 03:34
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Getting closer... or ...editing the initrd.gz
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [45 Posts]   Goto page: 1, 2, 3 Next
Author Message
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Sun 23 Nov 2014, 09:06    Post subject:  Getting closer... or ...editing the initrd.gz
Subject description: Adding smart functions to make the user able to configure the Puppy by a external .cfg File
 

Updated Information here!

RSH wrote:
I'm now going a very different way. Instead of remastering the OS again and again, I do edit the init Script in initrd.gz, inserting Functions to get automatically Information from a config File at boot partition and executing a Script doing Jobs based on that Information from the config File.

Coming from this Post, this Post and also this Post

I'm trying to provide smart functions to make the user able to configure the Puppy by a external .cfg File. Setting up a new Wallpaper, Startup Sound, load SFS Modules at boot (also to a top layer), install .pet packages automatically and execute Applications automatically after X appears on the screen plus many more...

Booting up a completely different setup Puppy Linux without to use a save file or to do a remaster first.



Currently these Options are available:

# Sleep Time - wait until script zzz_z_auto_execute will be executed
MYSLEEPTIME=2

# Window Manager - set a new window manager, load from SFS, load to a top layer
MYWINDOWMANAGER=jwm
MYWMSFSLOADOPT=1
MYWMSFSTOPLAYEROPT=1
MYWINDOWMANAGERSFS=LP3_WM-Flux-Ice-0.1.sfs

# Num Lock - disable/enable numlock of the numerical block
MYNUMLOCKOPT=1

# Interface - boot directly into new interface: da, de, es, fi, fr, it, nl, pt & tr
MYINTERFACE=de

# Timezone - currently unused
MYTIMEZONE=

# Keyboard Layout - set keyboard layout also needed when using $MYINTERFACE
MYKBDLAYOUT=de
RESTARTAFTERX=1

# Mount all HD and USB Flash Drives - mount all or only listed drives automatically
MOUNTALLMYDRIVES=1
MOUNTMYDRIVES=""

# Welcome First Boot - enable/disable welcome first boot GUI
MYWELCOMEFIRSTBOOT=0

# Personal Settings PopUp - enable/disable the Personal Settings PopUp
MYPERSONALSETTINGSPOPUP=0

# Desktop Icons - enable/disable the Desktop Icons
MYDESKTOPICONS=1

# Drive Icons - enable/disable the Drive Icons (only if $MYDESKTOPICONS is used)
MYDRIVEICONS=1

# Wallpapers - set a new wallpaper for a use
MYWALLPAPERDIRECTORY=Dateien/Wallpaper/RSH
MYWALLPAPER=Michaela.png

# Startup Sound - set a new startup sound (no longer barking)
MYSTARTUPSOUND=studio1337-bootsound.wav

# Install Packages - install .pet packages automatically from directory
MYPKGINSTALLDIROPT=1
MYPKGINSTALLDIR=InstallMe

# Global Directory to load SFS Files from - currently only for my private LazY Puppy
MYGLOBALSFSDIR=

# Auto-Load of SFS Modules at /etc/profile.local - load SFS Modules listed at boot up, load to top layer also
MYBOOTSFSLOADLISTOPT=0
MYBOOTSFSTOPLAYEROPT=0
MYBOOTSFSLOADLIST=""

# Auto-Load of SFS Modules at /root/Startup - load SFS Modules listed after X appears on the screen (only to normal layer)
MYSFSLOADLISTOPT=1
MYSFSLOADLIST=""

# Auto-Start of Applications - execute listed applications automatically and from list in simple text file
MYAUTOSTARTAPPS=""
MYAUTOSTARTAPPSLISTFILE=precise_5.7.1-autostart.lst

# Startup Script - execute a user's startup script
RUNMYSTARTUPSCRIPT=0
RUNMYSTARTUPSCRIPTBOOTCONTENT=0
MYSTARTUPSCRIPT=StartUp


Please, test and do make suggestions or offer parts of your own work - if there is any.



Downloads:

Download initrd.gz for Precise 5.7.1, Slacko 5.9.3 and Tahr 6.0 CE.
It's a .tar.gz file and it contains the initrd.gz files for the named Puppy Systems plus a config file example for each of them (includes my settings for testings used).
Download Super Lucid 4 initrd.gz plus a config file example.



Name-Specification:

$DISTRO_FILE_PREFIX_$DISTRO_VERSION.cfg

It can handle additions (free to define) to the File Name.

Example: $DISTRO_FILE_PREFIX_$DISTRO_VERSION-monday.cfg

So in this here case: precise_5.7.1.cfg or even precise_5.7.1-monday.cfg



Usage:

Boot Parameter setup for a use: pconfig

- pconfig=no (or No or NO or n or N) ---> don't load a config file
- pconfig=monday --> loads the precise_5.7.1-monday.cfg

- no pconfig submitted loads the default config, which is: precise_5.7.1.cfg

As for Options, $MYWALLPAPER and $MYSTARTUPSOUND:

- possible Locations for $MYWALLPAPER:
- - /usr/share/backgrounds, Boot Partition, Boot Directory, Sub Directory of Boot Partition or Boot Directory

- possible Locations for $MYSTARTUPSOUND:
- - /usr/share/audio, Boot Partition, Boot Directory

Usually if there are equal named Files in Boot Partition as well as in Boot Directory, the Boot Directory is the preferred Choice. More Information, Description and Comments in the Config File which shows clearly what has been solved so far.



Additional Directories and Files inside of the initrd.gz:

desk_icons_hide.desktop
desk_icons_show.desktop
zzz_z_auto_execute
zzz_z_auto_execute.desktop

/usr/sbin/mount_a_drive
/usr/sbin/sfs_load_top_layer



Images/Screenshots:

Precise 5.7.1 booted into DE with Enlightenment e17 Window Manager
Precise 5.7.1 booted into DE with L.A.S.S.I.E.'s Window Manager (JWM)
Super Lucid 4 booted into DE with L.A.S.S.I.E.'s Window Manager (JWM)

---

Note 1: Slacko 5.9.3 can't boot into DE interface or even DE keyboard layout if booting from vfat partition. Also can't connect to the web since they forgot to include the files for gprs modems.

Note 2: Could not test Tahr in complete since my machine seems to be too old for this OS. Graphics and Mouse issues here.
New-Config-Options-Update-Precise571-0.1.tar.gz
Description 
gz

 Download 
Filename  New-Config-Options-Update-Precise571-0.1.tar.gz 
Filesize  44.78 KB 
Downloaded  6 Time(s) 

Last edited by LazY Puppy on Fri 12 Dec 2014, 22:23; edited 8 times in total
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 672
Location: London

PostPosted: Sun 23 Nov 2014, 09:25    Post subject:  

Schone dast du wieder da bist! Ja, so ist das Lieben!

This looks very promising. I have to think about how to put this to best use and how to incorporate this into my system.

How are no icons acheived? Is a standard puppy desktop assumed (puppypin backedup?)? I like the idea of setting startup sound and wallpaper. I have to think about it and try it out.

Good stuff though!

stemsee
Back to top
View user's profile Send private message MSN Messenger 
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Sun 23 Nov 2014, 09:42    Post subject:  

stemsee wrote:
Schone dast du wieder da bist! Ja, so ist das Lieben!

Thanks. Very Happy

stemsee wrote:
This looks very promising. I have to think about how to put this to best use and how to incorporate this into my system.

How are no icons acheived? Is a standard puppy desktop assumed (puppypin backedup?)? I like the idea of setting startup sound and wallpaper. I have to think about it and try it out.

Good stuff though!

stemsee

Yes it is very much promising and works very well over here. By now booted about 50 times in different config setups. Though, the $MYDESKTOPICONS Option currently doesn't work.

I got some code where I do switch the Icons on desktop related to categories. This code has function to remove icons from desktop, but did not work here. So I commented out the lines in the auto-execute script but forgot to remove the option from the config files. Sorry for that.

However, anything else seems to work pretty good.

To put this into your init script is not that hard to do.

Just search the this here Slacko init script for RSH (case sensitive) and watch the additional files in initrd.gz.

RSH
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 672
Location: London

PostPosted: Sun 23 Nov 2014, 10:07    Post subject:  

Yes, I also want to have the option to load a second savefile automatically on say /initrd/pup_a or add pup_rw0 in the init.

I have a reliable mechanism for no-icons and return to icons. I think with this mechanism it will be easy to add or remove categories using one flag per category.
Back to top
View user's profile Send private message MSN Messenger 
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Sun 23 Nov 2014, 11:30    Post subject:  

Quote:
I have a reliable mechanism for no-icons and return to icons.

Please, offer some of this.
Back to top
View user's profile Send private message 
mavrothal


Joined: 24 Aug 2009
Posts: 1895

PostPosted: Sun 23 Nov 2014, 12:39    Post subject: Re: Getting closer... or ...editing the initrd.gz
Subject description: Adding smart functions to make the user able to configure the Puppy by a external .cfg File
 

LazY Puppy wrote:
RSH wrote:
I'm now going a very different way. Instead of remastering the OS again and again, I do edit the init Script in initrd.gz, inserting Functions to get automatically Information from a config File at boot partition and executing a Script doing Jobs based on that Information from the config File.

Coming from this Post, this Post and also this Post


Interesting but what is the "use case".
Remastering is usually for much more than changing timezone and wallpaper, so it can not really replace remastering but rather (some) personal settings. To that extend would be nice if you can add wifi configuration and maybe, firewall, SAMBA etc as they usually take more time Wink

I was also wondering why modify the init so heavily. You could just have it call a script in initrd/bin. Such a minimal change may even make it to woof-CE Shocked for future customizations and if not would be much easier to maintain a patch against an evolving init Wink

Alternatively you could call the config file from rc.sysinit or even rc.local. Even if you do not want to have a savefile you could still have a config file in /mnt/home with the variables and read them either directly from rc.something or by a script called from rc.something. Though this would require a remastering.

Coming to the user-editable unprotected config file, maybe is a good idea to have some checks that inserted variables are sane, because a typo (say in a path) may get your system unusable. Maybe a GUI "setings-config" where entries would be selected from tested-to-be-available options. This would probably require you to boot the original install the relevant pet and create your config file for future use, but should be more safe.
Alternatively you could extract all these from a configured running puppy. ie instead of remastering or a savefile, extract needed variables and configurations in a flat file or even a yzdrv.
Though with puppy running (mostly) from removables having hard-coded paths can be a problem (no matter what the checks) when changing machine.

_________________
Kids all over the world go around with an XO laptop. They deserve one puppy (or many) too Very Happy
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Sun 23 Nov 2014, 13:24    Post subject:  

Quote:
Interesting but what is the "use case".
Remastering is usually for much more than changing timezone and wallpaper, so it can not really replace remastering but rather (some) personal settings. To that extend would be nice if you can add wifi configuration and maybe, firewall, SAMBA etc as they usually take more time

It is NOT invented/intented/supposed to replace remastering completely or in general. The case of a use for is to boot a fresh, clean Puppy Linux as a preconfigured Puppy Linux as close to my personal needs as possible.

I want to develop Programs using all my tools developed until today without to do a remaster first, without to install .pet packages and also without to use a save file.

I don't use save files in general and want to save some time on remastering - or even save it completely, as far as possible (but not to replace remastering).

Quote:
I was also wondering why modify the init so heavily. You could just have it call a script in initrd/bin. Such a minimal change may even make it to woof-CE for future customizations and if not would be much easier to maintain a patch against an evolving init

I'm just a beginner in Linux and Puppy Linux. I don't know much about how the stuff in initrd.gz is handled and getting into / finally. So to modify the init script is what I know and what I already can do. I'm just playing around...

"Why modify the init so heavily" ?

Laughing You did never seen the init script from my private versions of LazY Puppy - that's heavily modified. In this here case, I have minimized the modifications to appr. 5% of all by increasing its functionality up to 500%!

Want it in woof-CE?

Grab the Ideas and suggestions, use it or even re-code it and put it in. I'm not interested in doing woof or doing woof-CE - just got not enough time for such projects.


Quote:
Alternatively you could call the config file from rc.sysinit or even rc.local. Even if you do not want to have a savefile you could still have a config file in /mnt/home with the variables and read them either directly from rc.something or by a script called from rc.something. Though this would require a remastering.

As stated: I want to save time on remastering. Currently I have to remaster/update 4 (to 6) different remastered Puppy Linux Systems to keep all of them up to date.

When testing/using a new Puppy like the Slacko 593, I just want to work with it and to use it, as I'm doing it in my multiple LazY Puppy Systems. Exclusively and immediately.

Makes it easier to develop and to test afterwards in a fresh and clean bootet equal Puppy Version without to have both, a remastered version and a original version installed on USB HDD or Flash Drive.


Quote:
Coming to the user-editable unprotected config file, maybe is a good idea to have some checks that inserted variables are sane, because a typo (say in a path) may get your system unusable.

Just boot it with pconfig=no and no config file will be used. Fix it (make it sane) then.

By the way. Checks are already in: e.g. submitted/defined Wallpapers that doesn't exist won't be used.

Quote:
Though with puppy running (mostly) from removables having hard-coded paths can be a problem (no matter what the checks) when changing machine.

Currently there aren't any hardcoded paths in use - if I didn't overseen anything.
.
Config File wrote:
# Use File Names without Path Names, just put those Files
# either to boot partition or into boot directory.
# Boot Directory is the preferred choice if equal named
# files are found at both locations. Any else usage is marked!


Thanks for your suggestions and opinions,

RSH
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1203
Location: England

PostPosted: Sun 23 Nov 2014, 13:47    Post subject:  

Hi LazY Puppy,

Re: show/hide icons
There is the excellent and versatile "swapicons" or roxoff with restart x as well as the new code from stemsee.

Re: remastering? you wrote
Quote:
I like remastering still very much. Yes, it's uncomfortable to use different versions by equal names. My Remaster Suite is working in unattended Mode and renames the SFS automatically when ever I'm activating the GUI Option. Since I'm using smallest .gz compression possible generally it takes about 15 Seconds to create a 350 MB .gz compressed SFS. Also it boots much faster when .gz compressed.


My regards
SwapIcons.sfs.gz
Description  rename - deleting "dotgz"
gz

 Download 
Filename  SwapIcons.sfs.gz 
Filesize  4 KB 
Downloaded  19 Time(s) 
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Sun 23 Nov 2014, 14:34    Post subject:  

Jasper wrote:
Hi LazY Puppy,

Re: show/hide icons
There is the excellent and versatile "swapicons" or roxoff with restart x as well as the new code from stemsee.

Thanks for the Info.

Jasper wrote:
Re: remastering? you wrote
Quote:
I like remastering still very much. Yes, it's uncomfortable to use different versions by equal names. My Remaster Suite is working in unattended Mode and renames the SFS automatically when ever I'm activating the GUI Option. Since I'm using smallest .gz compression possible generally it takes about 15 Seconds to create a 350 MB .gz compressed SFS. Also it boots much faster when .gz compressed.


My regards

Yes, but that's not a contradiction in terms of what am I trying to achieve!

RSH
Back to top
View user's profile Send private message 
Jasper


Joined: 25 Apr 2010
Posts: 1203
Location: England

PostPosted: Sun 23 Nov 2014, 15:00    Post subject:  

Hi again,

One forum member reported doing a substantial sfs remaster using Ted Dog's ram2sfs with xz compression in 86 seconds.

Here, an xz remaster using Ted Dog's ram2sfs takes about 37 minutes, but a gz remaster takes less than 5 minutes.

Yet, your 15 seconds is not satisfactory?
Quote:
I don't use save files in general and want to save some time on remastering....

My regards
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 672
Location: London

PostPosted: Sun 23 Nov 2014, 15:46    Post subject:  

Here is my very simple no icons script. First click creates ppin (flag)
Second click switches flag to nipp and extracts wallper line from puppypin and backs-up present puppypin,creates and inserts wallpaper line only into puppypin0. Then moves puppypin0 to puppypin and sets to rox pinboard on desired display :0.0
Third click switches flag to ppin
and (just in case the user changes the iconless puppypin0 wallpaper) extracts that line and inserts to pupypin-bak and etc.

Code:
#!/bin/sh
# copyright (c) 2014 Marcos Contant
if [ -e ~/Choices/ROX-Filer/nipp ]; then
   mv ~/Choices/ROX-Filer/nipp ~/Choices/ROX-Filer/ppin
   bd=`grep -e '  <backdrop style' ~/Choices/ROX-Filer/PuppyPin0`
   sed -i 3i\ "$bd" ~/Choices/ROX-Filer/PuppyPin-bak
   sed -i 4d ~/Choices/ROX-Filer/PuppyPin-bak
   rm ~/Choices/ROX-Filer/PuppyPin
   cp ~/Choices/ROX-Filer/PuppyPin-bak ~/Choices/ROX-Filer/PuppyPin
   DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
   #xmessage "desktop iconified"
elif [ -e ~/Choices/ROX-Filer/ppin ]; then
   mv ~/Choices/ROX-Filer/ppin ~/Choices/ROX-Filer/nipp
   bd=`grep -e '<backdrop style' ~/Choices/ROX-Filer/PuppyPin`
   echo '<?xml version="1.0"?>' > ~/Choices/ROX-Filer/PuppyPin0
   echo "<pinboard>" >> ~/Choices/ROX-Filer/PuppyPin0
   echo "<backdrop style="Stretched">/usr/share/backgrounds/reflecion.png</backdrop>" >> ~/Choices/ROX-Filer/PuppyPin0
   echo \ >> ~/Choices/ROX-Filer/PuppyPin0
   echo "</pinboard>" >> ~/Choices/ROX-Filer/PuppyPin0
   sed -i 3i\ "$bd" ~/Choices/ROX-Filer/PuppyPin0
   sed -i 4d ~/Choices/ROX-Filer/PuppyPin0
   mv ~/Choices/ROX-Filer/PuppyPin ~/Choices/ROX-Filer/PuppyPin-bak
   cp ~/Choices/ROX-Filer/PuppyPin0 ~/Choices/ROX-Filer/PuppyPin
   DISPLAY=:0.0 rox --pinboard ~/Choices/ROX-Filer/PuppyPin
   #xmessage "desktop de-iconified"
elif [[ ! -e ~/Choices/ROX-Filer/nipp && ! -e ~/Choices/ROX-Filer/ppin ]]; then
touch ~/Choices/ROX-Filer/ppin
fi

Back to top
View user's profile Send private message MSN Messenger 
LazY Puppy


Joined: 21 Nov 2014
Posts: 141
Location: Germany

PostPosted: Sun 23 Nov 2014, 19:17    Post subject:  

Jasper wrote:
Hi again,

One forum member reported doing a substantial sfs remaster using Ted Dog's ram2sfs with xz compression in 86 seconds.

Here, an xz remaster using Ted Dog's ram2sfs takes about 37 minutes, but a gz remaster takes less than 5 minutes.

Yet, your 15 seconds is not satisfactory?
Quote:
I don't use save files in general and want to save some time on remastering....

My regards

Of course, it's absolutely satisfactory.

But:
Taken from this Post.
RSH wrote:
I'm constantly remastering my LazY Puppy (yes, still the one based on the Lucid 5.2.8-4) - almost on each and every Day since I've started to working on it. A few Days ago I was pi.. off of remastering since I did forgot to include the same File (a hidden on, .NAME) three times in a row at remastering. So I picked up an older work that has been laying around for Months. The Plan was to read out a config File (which is already existing and fully working - except this one special purpose) and to get Information from this config File to let a StartUp Script do its Job related to the current OS booting ($DISTRO_FILE_PREFIX).

So including copying the files three times to their destination location and re-booting the OS, it has had taken about five to seven Minutes to get the damn file into the OS. Adding a line into the Startup Script would have taken just two seconds and only just a single reboot - or even temporarily executing this single Line from within a terminal. Wink

stemsee wrote:
Here is my very simple no icons script.

Thanks for offering this. I will check this out, but I think I can solve this smarter using the code I do already use for the VarioMenu - no restarting of X needed by the way. Or even I'm going to examine the "swapicons".
Jasper wrote:
There is the excellent and versatile "swapicons" or roxoff with restart x


Thanks for all your postings, suggestions and opinions.

RSH
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 672
Location: London

PostPosted: Mon 24 Nov 2014, 04:35    Post subject:  

Quote:
="LazY Puppy" - no restarting of X needed by the way. Or even I'm going to examine the "swapicons".


My simple code/solution (maybe not cool enough and easily dismissed out-of-hand) DOES NOT restart-X. I hope you at least try it.
Back to top
View user's profile Send private message MSN Messenger 
Jasper


Joined: 25 Apr 2010
Posts: 1203
Location: England

PostPosted: Mon 24 Nov 2014, 05:23    Post subject:  

Hi stemsee,

For me, your code exhibits three problems:
* the show/hide drive icons aspect fails for some drives sometimes
* the original background is not restored
* if using xonclock it disappears from the screen.
I expect you can easily fix these hitches.
--------------
For a plain black screen I occasionally use roxoff
Code:
rox -p=

but then, in my ignorance, I only know how to restore using "restart x".
--------------
Swapicons is fast, accurate, and flexible (I am now reminded the latest v 1.2 is even more flexible than the sfs I provided).

English is, understandably, not an RSH forte. So, though rarely a problem, we do not always understand each other perfectly.

My regards
Back to top
View user's profile Send private message 
stemsee

Joined: 27 Jun 2013
Posts: 672
Location: London

PostPosted: Mon 24 Nov 2014, 12:14    Post subject:  

@jasper

Ok...I think that our objectives are somewhat different. My objective was to have an iconless desktop easily, and be able to switch back easily. Drive icons are icons, and anyway managed by 'Desktop Drive Icons Manager'. When you say 'original background' do you mean default? Is xonclock an icon?

Maybe you are concerned with icon 'management' which was until now not in my considerations. However I have devised a method to manage icons that can remain or be removed as the user wishes. And an option to restore exactly the original puppypin.

Also 'rox -p=' is great to know. When using mutlipins by stemsee one need only type the current screen resolution '1366' or whatever to get the iconified desktop back without restarting X. Or simply click on the show/hide-icons button in the tray next to menu.

But this is hijacking RSH's thread.
Back to top
View user's profile Send private message MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 3 [45 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1424s ][ Queries: 12 (0.0046s) ][ GZIP on ]