←  [EN] Third-Party Development

Forums

»

Home brewed PPanel

VU+NL's Photo VU+NL 2 Mar 2011

If you are interested, please try my home brewed PPanel: a small package of systemtools. In fact it's only a collection of telnet-commands.
Any suggestions are welcome.
If anybody could add autostart for SWAP-file: please do so.

Attached Files

Quote

Taykun345's Photo Taykun345 3 Mar 2011

thanks, please add this:

init 4
rm /media/hdd/epg.dat
init 3

It deletes EPG on HDD.
Quote

VU+NL's Photo VU+NL 3 Mar 2011

OK, it works now with some sleep in between ("init 4; sleep 5; rm /media/hdd/epg.dat; sleep 5; init 3").

Nobody knows the command for SWAP-AutoStart?

Attached Files

Quote

delagroov's Photo delagroov 3 Mar 2011

Perhaps delete all crashlogs would be a nice option too.


rm -rf /media/hdd/enigma2_crash*
Quote

VU+NL's Photo VU+NL 3 Mar 2011

Done.

Attached Files

Quote

blzr's Photo blzr 4 Mar 2011

Nobody knows the command for SWAP-AutoStart?

here's my try - SWAPpanel (of course it can be inserted into 'SystemTools' if you'd like...),
I've simplified (?) things a little, available options:
- create swapfile on hdd / usb
- activate swapfile on hdd/usb (adds fstab entries and 'hackforusbswap' file ;) )
- deactivate all swaps (all swaps added to fstab)
- show active swaps

<directory name="SWAP Panel">
	 <comment name="Several functions related to SWAP-files"/>
	<separator/>
	   <execute name="Create a SWAP-file on your internal HDD" 
			  target="dd if=/dev/zero of=/media/hdd/swapfile bs=1048576 count=128; mkswap /media/hdd/swapfile; echo --- Done! Now activate SWAP!"
			  helptext="Creates a 128MB SWAP-file on your HDD." 
			  confirmation="Create the SWAP-file on your HDD?"/>
	   <execute name="Create a SWAP-file on mounted USB-medium"
			  target="dd if=/dev/zero of=/media/usb/swapfile bs=1048576 count=128; mkswap /media/usb/swapfile; echo --- Done! Now activate SWAP!"
			  helptext="Creates a 128MB SWAP-file on your USB-Medium"
			  confirmation="Create the SWAP-file on your USB device?"/>
	<separator/>
	    <execute name="Activate SWAP-file on HDD" 
			  target="echo If there is no text below the line, the activation went well.; echo --------------------------------------------------------; swapon /media/hdd/swapfile; sed -i '/hdd\/swapfile/d' /etc/fstab; echo -e '/media/hdd/swapfile swap swap defaults 0 0' >> /etc/fstab"
			  helptext="Activates SWAP on HDD, provided 'swapfile' exists." 
			  confirmation="Are you sure you want to activate the SWAP-file on your HDD?"/>
	   <execute name="Activate SWAP-file on mounted USB-Medium"
			  target="echo If there is no text below the line, the activation went well.; echo -------------------------------------------------------; swapon /media/usb/swapfile; sed -i '/usb\/swapfile/d' /etc/fstab; echo -e '/media/usb/swapfile swap swap defaults 0 0' >> /etc/fstab; echo 'mount -a ; swapon -a' >> /etc/rc3.d/S90hackforusbswap; chmod 755 /etc/rc3.d/S90hackforusbswap"
			  helptext="Activates SWAP on USB, provided 'swapfile' exists." 
			  confirmation="Are you sure you want to activate the SWAP-file on your USB-medium?"/>
	<separator/>
	    <execute name="De-activate SWAP-files" 
			  target="echo If there is no text below the line, the de-activation went well.; echo ----------------------------------------------------; swapoff -a; sed -i '\/swapfile/d' /etc/fstab; rm -f /etc/rc3.d/S90hackforusbswap"
			  helptext="De-activates all SWAP-files."
			  confirmation="Are you sure you want to de-activate all SWAP-files?" />
	    <separator/>
	    <execute name="Show active swaps"
			  target="cat /proc/swaps"
			  helptext="Shows active swaps."/>
</directory>

tested it a bit and for me it worked, of course any feedback is welcome ;)

//btw. does someone know if option quit="restart" should work on enigma2 ppanel? for me it doesn't work...
and with combination of 'quit' and 'condition' it'd be possible to show/hide some options in this panel...

Attached Files

Quote

VU+NL's Photo VU+NL 4 Mar 2011

Thanks: integrated your stuff in the latest version.

Attached Files

Quote

nisse69's Photo nisse69 4 Mar 2011

Hi!

Were do i put this fil, dir ? Posted Image

rgrds
Quote

VU+NL's Photo VU+NL 4 Mar 2011

In /etc/ppanels

Latest version attached.

Attached Files

Quote

littlesat's Photo littlesat 4 Mar 2011

Zo.... krijgt ppanel nieuw leven????
Quote

VU+NL's Photo VU+NL 4 Mar 2011

Zo.... krijgt ppanel nieuw leven????

Ja, bij toeval. Ik was op zoek naar iets en kwam erachter dat PPanel eigenlijk wel een (voor een leek) simpel te gebruiken en flexibel gereedschap is.
Quote

hemertje's Photo hemertje 4 Mar 2011

english guys!
Quote

blzr's Photo blzr 5 Mar 2011

Latest version attached.

well, looks nicer and nicer, gr8 job :D
two remarks regarding swap section:
1) 'activate cf swapfile' - if you wanna fstab entry for cf-swap to be added automatically during activation, you've to add to 'target' appropriate command (see hdd/usb swap activation, accordingly)
//actually I don't know if cf swap needs kind of 'hackforcfswap' (like usb) to overcome too slow device mount, only a dm8k user could tell...
2) 'de-activate hdd-swapfile / usb-swapfile' options - they de-activate swap, but fstab entries (created during activation) remain, contrary to my 'de-activate ALL swap' command which remove all fstab swap entries... as a result after reboot de-activated hdd/usb swap is activated automatically, is it intentional? if not, consider an adding of 'fstab cleaning' commands
Quote

VU+NL's Photo VU+NL 5 Mar 2011

Thanks for that.
Please have a look if this is what you meant. If not: please feel free to make changes.

Attached Files

Quote

blzr's Photo blzr 5 Mar 2011

well, not exactly ;)
I'm rather against 'unnecessary multiplication of entities' :P
I would suggest such way:
- remove 'temporary' swaps options - 'permanent' swap can be used temporarily as well, for user it makes no difference...
- since every 'activate swap' option would add proper fstab entry, I would insert 'delete fstab entry' for each 'de-activate' option
//btw. I can't imagine why someone would really need 2(3?) swapfiles 'active' at once? then option to de-activate specific (hdd/usb/cf) swaps would be useful, otherwise to have only one option 'de-activate all swaps' is sufficient, imho...
but of course I can't speak for others since I don't use swap at all :P

attached you'll find my 'swap options slimmed' version
//if you prefer to stick to yours version, correct typos in 'active cf swap' - name of S90something file differs for create and chmod...

keep up the good work :)

Attached Files

Quote

VU+NL's Photo VU+NL 5 Mar 2011

I am happy with your "slimming" and corrections, thanks.

I don't use SWAP either: I only added those functions as there are quite often questions in this and other forums on how to establish them under PLi.

If you have any other improvements or additions I would be honoured.
Quote

Bernado's Photo Bernado 5 Mar 2011

great collection, thnx to VU+NL and blzr

...actually I don't know if cf swap needs kind of 'hackforcfswap' (like usb) to overcome too slow device mount, only a dm8k user could tell...


CF and SD/MMC cards don´t need inittweaks afaik - tested with sd card.

below is a version with 'hackforcfswap' removed and support for /media/mmc1 added - feel free to edit

Attached Files

Quote

blzr's Photo blzr 5 Mar 2011

@Bernado
thanks for info and updated ppanel :)
I corrected 2 typos (ed instead of sed), also removed redundant 'leftovers' from previous version...

latest ppanel attached (@VU+NL, I pushed version to 0.49, is this correct number?)

Attached Files

Quote

VU+NL's Photo VU+NL 5 Mar 2011

Yep, fine, thanks.
Quote

VU+NL's Photo VU+NL 10 Mar 2011

Added SMART-info tools.

Attached Files

Quote