Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UU: some gentoo maintenance scripts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Sun Sep 30, 2012 9:02 am    Post subject: UU: some gentoo maintenance scripts Reply with quote

Hi everybody, I'm new here.
Some time ago I decided to test my python programming skills on gentoo, so I made a small collection of scripts to make the maintenance, update and cleaning of my gentoo system a little more effortless.
I'd like to know what do you think about it. The scripts and manuals are ready but I haven't made an ebuild yet :D

You can find the archive here: http://penazarea.altervista.org/wp-content/uploads/2012/09/UU_06_r1.tar.gz
Just unpack in /usr/bin/UU and create a couple of aliases to UU.py and UU_def.py, if you like you can copy the manuals in /usr/share/man/man1.

I hope you like it. Thanks in advance.

Penaz.
Back to top
View user's profile Send private message
mark_doe
n00b
n00b


Joined: 04 Oct 2011
Posts: 9

PostPosted: Sun Sep 30, 2012 10:54 am    Post subject: Reply with quote

it's not working at all here.

I dont have a boot partition - so kernel script throws error.

I recommend you put your stuff into /usr/local/ and docs into /usr/local/man/ instead of polluting my system with /usr/bin/UU location.

/usr/bin/UU/uu.py
<---- Error in Line 1: from: command not found
Back to top
View user's profile Send private message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Sun Sep 30, 2012 11:09 am    Post subject: Reply with quote

mark_doe wrote:
it's not working at all here.

I dont have a boot partition - so kernel script throws error.

Oh, I'm really sorry about that... I'll fix the problem as soon as possible. :oops:

mark_doe wrote:
I recommend you put your stuff into /usr/local/ and docs into /usr/local/man/ instead of polluting my system with /usr/bin/UU location.

Thank you very much for the suggestion.

mark_doe wrote:
/usr/bin/UU/uu.py
<---- Error in Line 1: from: command not found

Is your python interpreter working properly?
Line 1 in uu.py is:
from subprocess import Popen, call
which I think is pretty normal for python scripts.
I'll add
#!/usr/bin/env python
at the beginning of the scripts in the next release of UU.
Back to top
View user's profile Send private message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Mon Oct 01, 2012 9:07 am    Post subject: Reply with quote

New release now available!
You can download UU 0.6-r2 from here: http://penazarea.altervista.org/wp-content/uploads/2012/10/UU_06_r2.tar

As suggested by mark_doe, the new release must be installed in /usr/local/bin/UU, create the aliases to uu.py and uu_def.py and touch /var/log/UU.log.
I suggest to run uu_def before running uu, so you can configure it and avoid errors.

Also:
Code:
#!/usr/bin/env python

was added at the beginning of the scripts.

I hope it works as well as in my laptop. :D
Back to top
View user's profile Send private message
NotQuiteSane
Guru
Guru


Joined: 30 Jan 2005
Posts: 471
Location: Klamath Falls, Jefferson, USA, North America, Midgarth

PostPosted: Wed Oct 03, 2012 9:22 pm    Post subject: Reply with quote

How about telling us what these scripts do before we download them?

NQS
_________________
These opinions are mine, mine I say! Piss off and get your own.

As I see it -- An irregular blog, Improved with new location

To delete French language packs from system use 'sudo rm -fr /'
Back to top
View user's profile Send private message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Thu Oct 04, 2012 8:25 am    Post subject: Reply with quote

NotQuiteSane wrote:
How about telling us what these scripts do before we download them?

Yes, of course.
If you call uu.py without any arguments it will bring up a curses interface.
If you want to update your system you can use "uu update" which simply calls in order:
"layman -s ALL" (if enabled)
"eix-sync"
"emerge -uDN world"
"revdep-rebuild"
The exit code of each call is registered, so if something goes wrong uu will send a message via "Wall -n"
If you want to do some cleaning you can use "uu clean" which calls in order:
"emerge --depclean"
"eclean-pkg"
"eclean-dist"
"revdep-rebuild"
"emaint -f all"
"eclean-kernel" (if enabled)
If you want to automate minor kernel updates, you can use "uu kernel" which uses a bash script to work; here it is:
Code:
cd /usr/src/linux && mount /boot && make && make modules_install && make install && module-rebuild rebuild && emerge x11-drivers/xf86-input-synaptics && emerge x11-driv    ers/xf86-input-evdev && umount /boot && wall -n Kernel is up to date! Have a nice day!

You can use uu_def to bring up a ncurses interface for script configuration, it simply writes 1 or 0 in the uu_settings file for each option.
Other arguments (uu fcomp, uu comp, uu fetch, uu sync, etc...) are reduced versions of "uu update".
If you want you can enable logging, you'll find the log in "/var/log/UU.log".

Forgive me for my English. :D

I hope everything is clear.

I wish you all a nice day.
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 237
Location: Russia && Saint-Petersburg

PostPosted: Fri Oct 05, 2012 4:02 pm    Post subject: Reply with quote

hmm...
Code:
alias world-update='einstall -avuDN --keep-going=y world && smart-live-rebuild -- -avD; revdep-rebuild -i; pfl;prelink -amfR;dkms-gentoo --db '
einstall - emerge wrapper
Quote:
eclean-kernel
no way!
/me use this
Back to top
View user's profile Send private message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Fri Oct 05, 2012 7:45 pm    Post subject: Re: UU: some gentoo maintenance scripts Reply with quote

Penaz wrote:

I decided to test my python programming skills on gentoo
[...]
I'd like to know what do you think about it.

I know it's nothing special, but it's just to challenge myself.
What's wrong with eclean-kernel?
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 237
Location: Russia && Saint-Petersburg

PostPosted: Sat Oct 06, 2012 6:36 am    Post subject: Re: UU: some gentoo maintenance scripts Reply with quote

Penaz wrote:
What's wrong with eclean-kernel?
kernel file must have name "vmlinuz" ---> no way!
Back to top
View user's profile Send private message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Sat Oct 06, 2012 7:26 am    Post subject: Reply with quote

Quote:
kernel file must have name "vmlinuz"

Seems a bit limitating...
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 237
Location: Russia && Saint-Petersburg

PostPosted: Sat Oct 06, 2012 7:38 am    Post subject: Reply with quote

Penaz wrote:
Quote:
kernel file must have name "vmlinuz"

Seems a bit limitating...
WUT o_O?
Back to top
View user's profile Send private message
megabaks
Apprentice
Apprentice


Joined: 22 Jan 2012
Posts: 237
Location: Russia && Saint-Petersburg

PostPosted: Sat Oct 06, 2012 7:43 am    Post subject: Reply with quote

+ eclean-kernel luls:
Code:
[ root@desktop ] megabaks # eclean-kernel -l
3.3.2-gentoo.old:
- vmlinuz: /boot/vmlinuz-3.3.2-gentoo.old
- systemmap: /boot/System.map-3.3.2-gentoo.old
- config: /boot/config-3.3.2-gentoo.old
2.6.38.8:
- vmlinuz: /boot/vmlinuz-2.6.38.8
- systemmap: /boot/System.map-2.6.38.8
- config: /boot/config-2.6.38.8
3.4.4:
- vmlinuz: /boot/vmlinuz-3.4.4
- systemmap: /boot/System.map-3.4.4
- config: /boot/config-3.4.4
3.0.17-gentoo-r2:
- vmlinuz: /boot/vmlinuz-3.0.17-gentoo-r2
- systemmap: /boot/System.map-3.0.17-gentoo-r2
- config: /boot/config-3.0.17-gentoo-r2
3.4.4-gentoo:
- vmlinuz: /boot/vmlinuz-3.4.4-gentoo
- systemmap: /boot/System.map-3.4.4-gentoo
- config: /boot/config-3.4.4-gentoo
3.5.1-pf:
- vmlinuz: /boot/vmlinuz-3.5.1-pf
- systemmap: /boot/System.map-3.5.1-pf
- config: /boot/config-3.5.1-pf
3.5.3-pf:
- modules: /lib/modules/3.5.3-pf
- build: /usr/src/linux-3.5.3-pf
3.3.2-gentoo:
- vmlinuz: /boot/vmlinuz-3.3.2-gentoo
- systemmap: /boot/System.map-3.3.2-gentoo
- config: /boot/config-3.3.2-gentoo
[ root@desktop ] megabaks # eclean-kernel -A
Preserving currently running kernel (3.5.3-pf)
No outdated kernels found.
[ root@desktop ] megabaks #
:3
and now kernel-cleaner
Code:
[ root@desktop ] megabaks # kernel-cleaner -l
Kernels....                                                                                                                                              [ ok ]
Initrams...                                                                                                                                              [ ok ]
Configs....                                                                                                                                              [ ok ]
Maps.......                                                                                                                                              [ ok ]
Kernels:
/boot/3.5.3-pf                     3.5.3-pf
/boot/vmlinuz-3.0.17-gentoo-r2     3.0.17-gentoo-r2
/boot/vmlinuz-2.6.38.8             2.6.38.8
/boot/vmlinuz-3.3.2-gentoo         3.3.2-gentoo
/boot/vmlinuz-3.3.2-gentoo.old     3.3.2-gentoo
/boot/vmlinuz-3.4.4                3.4.4
/boot/vmlinuz-3.4.4-gentoo         3.4.4-gentoo
/boot/vmlinuz-3.5.1-pf             3.5.1-pf
Configs:
/boot/config-2.6.38.8              2.6.38.8
/boot/config-3.0.17-gentoo-r2      3.0.6-gentoo
/boot/config-3.3.2-gentoo          3.3.2-gentoo
/boot/config-3.3.2-gentoo.old      3.3.2-gentoo
/boot/config-3.4.4                 3.4.4
/boot/config-3.4.4-gentoo          3.4.4-gentoo
/boot/config-3.5.1-pf              3.5.1-pf
Maps:
/boot/System.map-2.6.38.8
/boot/System.map-3.0.17-gentoo-r2
/boot/System.map-3.3.2-gentoo
/boot/System.map-3.3.2-gentoo.old
/boot/System.map-3.4.4
/boot/System.map-3.4.4-gentoo
/boot/System.map-3.5.1-pf
Modules:
/lib/modules/3.5.3-pf
Sources:
/usr/src/linux-3.5.3-pf            3.5.3-pf
/usr/src/linux-3.5.4-pf            3.5.4-pf
[ root@desktop ] megabaks # kernel-cleaner -r
Kernels....                                                                                                                                              [ ok ]
Initrams...                                                                                                                                              [ ok ]
Configs....                                                                                                                                              [ ok ]
Maps.......                                                                                                                                              [ ok ]

Next files will be removed:
/boot/config-2.6.38.8
/boot/config-3.0.17-gentoo-r2
/boot/config-3.3.2-gentoo
/boot/config-3.3.2-gentoo.old
/boot/config-3.4.4
/boot/config-3.4.4-gentoo
/boot/config-3.5.1-pf
/boot/System.map-2.6.38.8
/boot/System.map-3.0.17-gentoo-r2
/boot/System.map-3.3.2-gentoo
/boot/System.map-3.4.4
/boot/System.map-3.4.4-gentoo
/boot/System.map-3.5.1-pf
/boot/vmlinuz-2.6.38.8
/boot/vmlinuz-3.0.17-gentoo-r2
/boot/vmlinuz-3.3.2-gentoo
/boot/vmlinuz-3.3.2-gentoo.old
/boot/vmlinuz-3.4.4
/boot/vmlinuz-3.4.4-gentoo
/boot/vmlinuz-3.5.1-pf

Would you like to remove this trash? [Yes/No]

Removing...                                                                                                                                              [ ok ]

[ 34M ] Total space from 20 files were freed.

[ root@desktop ] megabaks #
good job!
Back to top
View user's profile Send private message
Penaz
n00b
n00b


Joined: 30 Sep 2012
Posts: 7

PostPosted: Sat Oct 06, 2012 10:15 am    Post subject: Reply with quote

I think I'll try it :D
Thanks for the suggestion.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
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