PDA

View Full Version : Multiple boot videos?


Psymastr
02-09-2010, 12:42 AM
Is there a way to chain boot videos so one plays after the other? (I tried searching, but couldn't find any info for a yes or a no). Such as in the boot video config just writing:

filename=xx.avi
filename=yy.avi?

Or is it not possible?

maxximuscool
02-09-2010, 01:29 AM
yes you can. just do what you did above. it will work.

bandora
02-09-2010, 01:32 AM
Lol but why? Like do you really want to wait for those videos to load? idk.. just curious.. :o

Sunderland
02-09-2010, 04:00 AM
Maybe he wants to have defferent videos on each reboot?
i mean he loads up his phone and have xx.avi boot video, and next time he will reboot N900 he'll have yy.avi boot video.

sry for poor eng.

bandora
02-09-2010, 06:03 PM
Oh.. so when having multiple entries then it will play one each time? I thought it plays them one after another in one boot.

kopte3
02-09-2010, 08:17 PM
No, if you have multiple entries it will always play all of them in order you wrote them in your conf file.

rolan900d
02-12-2010, 09:59 AM
Not working for me...

I did this setup:

[hildon-welcome]
filename=maemo_flyby_xvid_lame_r3.avi
filename=short.avi


But it just plays short.avi

All the names are right of the videos!

rolan900d
02-13-2010, 03:08 PM
I found it...
I need to make 2 config files like this:

default.conf
default2.conf

Ahmed360
02-13-2010, 04:01 PM
oh so it can be done

ignore my PM rolan900d

But....why?!!!

rolan900d
02-13-2010, 09:31 PM
Why, I like to be weird!
:p

neboja
02-17-2010, 07:24 PM
ok... so you make a bunch a config files, and every time you boot, it plays a diferent movie??? wright??? O_o

Pfuh3z
02-18-2010, 11:53 AM
ok... so you make a bunch a config files, and every time you boot, it plays a diferent movie??? wright??? O_o

No, every time you boot, it plays all the movies referenced to by your config files. "Random" movie during boot would be a cooler feature though :)

Dries

b666m
02-18-2010, 12:10 PM
I found it...
I need to make 2 config files like this:

default.conf
default2.conf

if this really works...

you could store all of those files in an additional folder ../dconfs (for example).
then write a script which deletes the current defaultX.conf in the hildon/welcome folder and randomly copies any of the configs in /dconfs back when shutting the system down.

this script could be stored in /etc/init.d/. then you have to symlink it to the correct rcX.d folder, i guess it would be rc0.d (http://en.wikipedia.org/wiki/Runlevel).

ehm yeah... the script should then be executed when your system goes into halt?! o.O

and you'll always have a random video at (re)boot. ^^

edit: maybe it would be the best to change it on bootup with a rc2.d script :)

EDIT: THAT'S MY FINAL SOLUTION FOR HAVING RANDOM BOOTVIDEOS ON STARTUP AUTOMATICALLY -> http://talk.maemo.org/showpost.php?p=537905&postcount=35

rolan900d
02-18-2010, 01:04 PM
On my end it could only play 2 videos on boot!
The 3rd and 4rd worked but only for sound..

b666m
02-18-2010, 01:25 PM
that would be a quick&dirty script for replacing the default.conf

you have:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/ <- new folder where the configs are named "1.conf", "2.conf", "3.conf" and so on.

the script determines the number of conf-files in the dconfs-folder and replaces the default.conf randomly with one of them :)

#!/bin/bash

# determine number of files in /dconfs
cd /etc/hildon-welcome.d/dconfs/
nof=$(ls *.conf | wc -l)

# get random number in range of 1 - nof
let "rn = $RANDOM % $nof + 1"

# choose random conf
rf="$rn.conf"

# copy it over to default.conf
cp $rf ../default.conf

# exit
exit 0

vietn900
02-18-2010, 01:32 PM
mightm as well put on a whole movie ;p

silverstar29
02-18-2010, 02:16 PM
Hey Rolan900d,

I tried creating 2 default files.

default.conf

[hildon-welcome]
filename= (Hand boot screen)

And default2.conf

[hildon-welcome]
filename=short.avi

But It didn't work. Still shows only the Hands as intro and thats it.

b666m
02-18-2010, 02:56 PM
you could also make desktop-shortcut which executes the script or only the code (as one-liner) when you want to have a another/random bootvideo next time. xD

rolan900d
02-18-2010, 04:08 PM
that would be a quick&dirty script for replacing the default.conf

you have:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/ <- new folder where the configs are named "1.conf", "2.conf", "3.conf" and so on.

the script determines the number of conf-files in the dconfs-folder and replaces the default.conf randomly with one of them :)

#!/bin/bash

# determine number of files in /dconfs
cd /etc/hildon-welcome.d/dconfs/
nof=$(ls *.conf | wc -l)

# get random number in range of 1 - nof
let "rn = $RANDOM % $nof + 1"

# choose random conf
rf="$rn.conf"

# copy it over to default.conf
cp $rf ../default.conf

# exit
exit 0

I was really good in Symbian, but so a noob in Linux...
Learning a lot over here, but you are out of my league mate!


@b66m:
That would be great; but I got lost on that script...

b666m
02-18-2010, 04:14 PM
outsch... too bad... $RANDOM doesn't deliver anything... this command isn't recognized at the n900 :/

b666m
02-18-2010, 05:24 PM
wuhaha :D
got it ^^

#!/bin/bash

# determine number of files in /dconfs
cd /etc/hildon-welcome.d/dconfs/
nof=$(ls *.conf | wc -l)

# get random number
rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
rf="$rr.conf"
echo "$rr.conf"

# copy it over to default.conf
cp $rf ../default.conf

# exit
exit 0

the new random number generator looks quite ugly but it works (look at the pic at the bottom)
(i only have 2 confs in the dconfs-folder ^^)

maybe i'll try to get it in rc2.d :)
a shortcut on the desktop (for doing it manually) to this script is done very fast (:

b666m
02-18-2010, 06:11 PM
if anybody is interested in this random bootvideo shortcut on the desktop. i could write a short how-to :)

Schturman
02-19-2010, 01:47 AM
Hi b666m
Can you write please the "how-to" for a noob in Linux....

1) How-to random video automaticly

2) How-to random bootvideo shortcut on the desktop

Thanks

rolan900d
02-19-2010, 05:20 AM
if anybody is interested in this random bootvideo shortcut on the desktop. i could write a short how-to :)

I really would like a step by step as well...
Than I will get smarter in this

b666m
02-19-2010, 04:29 PM
omg... the shortcut wasn't as easy as i thought it would be... but finally it's working...

instructions:
1. download the zip-file and unpack the two files anywhere in a new folder in your MyDocs. for example: ~/MyDocs/randomvid/
(unplug usb cable)
2. open xterm and type "sudo gainroot"
3. type "mkdir /etc/hildon-welcome.d/dconfs"
4. in this folder you have to store your default.conf files named 1.conf, 2.conf, 3.conf and so on (you have to start with 1 and then incremental count up (2, 3, 4, 5,...))
5. type "cd MyDocs/randomvid/"
6. type "cp rvid.sh /etc/hildon-welcome.d/"
7. type "chmod a+x /etc/hildon-welcome.d/rvid.sh"
8. type "cp rvid.desktop /usr/share/applications/hildon/"
9. close xterm, go to your desktop and add the shortcut named "rvid".

it uses the terminal-icon. if you want your own icon do following:
1. place a .png with 48 * 48 px in /usr/share/icons/hicolor/48x48/hildon/
(for example: rvid.png)
2. open the rvid.desktop with a editor and change the icon-line to:
"Icon=rvid". save it.
3. you may have to reboot your device.

thanks go to:
fatalsaint for pointing me in the right direction with the desktop file.
(http://talk.maemo.org/showpost.php?p=537067&postcount=66)
subcore for hack-around changing xterm to busybox.
(http://talk.maemo.org/showpost.php?p=480869&postcount=11)
archebyte for changing the desktop-icon and some other neat work.
(http://talk.maemo.org/showpost.php?p=423380&postcount=26)

edit:
it's normal that the terminal opens up, stays black and closes after a few seconds.
it's also normal that it may replaces the current default.conf with the same config - so your video may not change everytime you click on it. but hey... that's randomness ;D

EDIT: updated the rvid.sh with new code with generates random number out of date and checks which default.conf is used at the moment so the video is changed every time you click it :)
(code is available on page 4 where the instructions are given on how to do this random vid change automatically ^)

b666m
02-19-2010, 05:07 PM
script:
#!/bin/bash

cd /etc/hildon-welcome.d/dconfs/

if [ -f 1.conf ]; then

# determine number of files in /dconfs
nof=$(ls *.conf | wc -l)

# get random number
rna=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")
rna=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

if [ $rna -ge $rnb ]; then
let "rn = $rna - $rnb"
else
let "rn = $rnb - $rna"
fi

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
rf="$rr.conf"
echo "$rr.conf"

# copy it over to default.conf
cp $rf ../default.conf

fi

# exit
exit 0
(added check if "1.conf" exists. yes: run the script and exit 0. no: quit with exit 0.)
(edit: for some reason there was 5:1 chance of 2.conf to 1.conf... so i added some more randomness by creating two random numbers and substract the smaller number from the greater one.)
(edit2: i could add some lines which force the bootvideo to change. in the current version the default could be replaced by the same file and the bootvideo would still be the same. good idea? bad idea?!)

desktop:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=rvid
Exec=/bin/busybox sh -c 'echo sh /etc/hildon-welcome.d/rvid.sh | sudo gainroot'
Icon=terminal
#X-Window-Icon=
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable

Schturman
02-19-2010, 05:20 PM
where I need put the video files ? to /MyDocs/randomvid/ ?
or in default folder /media ?

b666m
02-19-2010, 05:48 PM
where I need put the video files ? to /MyDocs/randomvid/ ?
or in default folder /media ?

0. sudo gainroot
(get root-terminal)
1. cp -r /usr/share/hildon-welcome/media /opt/
(this should make /opt/media with the nokia hands video as content)
2. rm -r /usr/share/hildon-welcome/media
(this should remove the media folder from there)
3. cd /usr/share/hildon-welcome
(change the directory ^^)
4. ln -s /opt/media media
(symlinking /opt/media to /usr/share/hildon-welcome/media)

then you can put all of your videos into /opt/media/ ;)

Schturman
02-19-2010, 06:11 PM
I get this ! Thank you very much !
Another question, can we get this process automatically, without pressing on the button on desktop before reboot ? I mean on all reboot it the load another video ? (sorry for my ugly english :-) )

b666m
02-19-2010, 07:31 PM
I get this ! Thank you very much !
Another question, can we get this process automatically, without pressing on the button on desktop before reboot ? I mean on all reboot it the load another video ? (sorry for my ugly english :-) )

maybe someone will write a init-script which executes my shell-script at bootup or shutdown (:

haven't done this before... but i could take a look... (better said: google could have a look ^^)

CAN ANYONE PROVIDE AN INIT SCRIPT WHICH LAUNCHES A SHELL SCRIPT? :D

b666m
02-19-2010, 07:56 PM
EDIT: FORGET USING INIT.D ON MAEMO! FOR STARTING YOUR OWN SCRIPTS RUN IT VIA EVENT.D! LOOK DOWN THIS SITE FOR AN EXAMPLE! ;D

QUESTION: ^^

#! /bin/sh
# /etc/init.d/rvid

# Carry out specific functions when asked to by the system
case "$1" in
start)
cd /etc/hildon-welcome.d/dconfs/

if [ -f 1.conf ]; then

# determine number of files in /dconfs
nof=$(ls *.conf | wc -l)

# get random number
rna=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")
rna=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

if [ $rna -ge $rnb ]; then
let "rn = $rna - $rnb"
else
let "rn = $rnb - $rna"
fi

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
rf="$rr.conf"
echo "$rr.conf"

# copy it over to default.conf
cp $rf ../default.conf

fi
;;
stop)
;;
*)
;;
esac

exit 0

source: http://www.debian-administration.org/article/Making_scripts_run_at_boot_time_with_Debian

then doing:
chmod 755 /etc/init.d/rvid
update-rc.d rvid defaults

is this the correct way for launching my script on bootup? o.O

b666m
02-19-2010, 08:51 PM
mkay... doesn't work... i can't get it work...

so you have to stick to the shortcut-method until someone points me the direction to launch my script on startup. ^^

the only thing i could do in addition would be checking which bootvideo is currently used so that another default.conf gets loaded.

(in my current version the same bootvideo can be played several times because maybe the default.conf gets overwritten by the same default.conf)

so... if you want to have a new bootvideo each time you click the shortcut... leave a comment here... ^^
(or program it by yourself ;D)

b666m
02-20-2010, 12:20 AM
omg.... i've done so much... just look at my friggin' battery drainage xD

(see this straight drop of about 30%??? this is how multiple reboots (about mhm... 5?!) look like :D)

b666m
02-20-2010, 01:39 AM
first things first ^^

new script which will check the currently used video so that it's always another video on bootup :)

(ok... if you run it for the first time it may be not changing the video because my check-file doesn't exist in this moment but it will be created then ^^)

blablabla... same as in the code under this code.. blablabla

# get random number
rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

blablabla... the same again... blablabla

EDIT: i kicked the /dev/urandom number generation because the entropy pool is sparely seeded. so i'll use the seconds since 00:00:00, Jan 1, 1970 ^^

start on starting shutdown

script

cd /etc/hildon-welcome.d/dconfs/

if [ -f 1.conf ]; then

# check which file is currently used
if [ -f *.lock ]; then
cuf=$(ls *.lock)
ruf=$cuf
rm *.lock
else
cuf="1.lock"
ruf=$cuf
fi

# determine number of files in /dconfs
nof=$(ls *.conf | wc -l)

while [ "$ruf" = "$cuf" ]; do

# get "random" number lol
rn=$(date +%s)

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
ruf="$rr.lock"
rf="$rr.conf"

done

# set file for checking which file is in use
rb="$rr.lock"

# copy it over to default.conf
cp $rf ../default.conf
touch $rb

fi

end script

how it works:

b666m
02-20-2010, 01:53 AM
and...
YEAH BABY!!! :D

got it replaced automatically... even before the video is loaded ^^ *hrhr*

instructions:

1. download the zip-file and place file "rvid" in ~/MyDocs/ranvid/ (for example)
2. open xterm
3. type "sudo gainroot"
4. type "cp MyDocs/ranvid/rvid /etc/event.d/"
5. type "chmod 777 /etc/event.d/rvid"

if you haven't done it yet:
8. type "mkdir /etc/hildon-welcome.d/dconfs"
9. place your default.conf files there BUT rename them in 1.conf, 2.conf, 3.conf and so on.

so the contents should be:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.

ehm yeah... have fun ;)

edit: forgot to mention... this one is the code which will always replace the current bootvideo with any other bootvideo out of the x.conf files (:

EDIT: UPDATED TO FINAL VERSION. ^^

rolan900d
02-20-2010, 02:09 AM
You are my member of the month in here..
Always there, always helpfull and in here for others as well..

Bravo!

Will test and try later

================================================== =========
Did it all but not working for me.
So I guess I made a mistake...

To verify:

I kept the default.conf file in etc/hildon-welcome.d

With your tweak exicuted it keeps on booting with hands...
I think it is because of that default.conf in there.
I will try to delete that one so it will use the hildon-welcome.d/donfs



Midleading as you stated how the contents must look

rolan900d
02-20-2010, 08:28 AM
Now I left default.conf in /etc/hildon-welcome.d.
with also 6 others (named the default1.conf until default6.conf)

These 7 default conf files I copied and renamed them 1.conf until 7.conf and placed them in /etc/hildon-welcome.d./dconfs

This gave me a lot of videos in a continious loop!
It showed 5 of the 7 and 2 I could hear but didn't see

So I did something wrong I guess


In your described progress I cam acroos on error on my end..
1. download the zip-file and place the two files "rvid" and "rvide" (for example) in ~/MyDocs/ranvid/
2. open xterm
3. type "sudo gainroot"
4. type "cp ranvid/rvid /usr/bin/"
5. type "chmod 777 /usr/bin/rvid"
6. type "cp ranvid/rvide /etc/event.d/"

At 4 and 6 in needed to put this between cp and ranvid due to errors

/home/user/MyDocs/

b666m
02-20-2010, 08:32 AM
ONLY have ONE default.conf in /etc/hildon-welcome.d/

(delete all other defaultx.conf files!)

just let the x.conf files in /etc/hildon-welcome.d/dconfs/

to make it clear. it must look like:

/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.

rolan900d
02-20-2010, 08:33 AM
I did that but than only the hands animation runs.
My default.conf is the hands one

rolan900d
02-20-2010, 08:36 AM
ONLY have ONE default.conf in /etc/hildon-welcome.d/

(delete all other defaultx.conf files!)

just let the x.conf files in /etc/hildon-welcome.d/dconfs/

to make it clear. it must look like:

/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.

I had this understood from the get go but didn't do anything for me...
Just booted on hands

b666m
02-20-2010, 08:39 AM
your x.conf files have to look like this:

[hildon-welcome]
filename=videoname.avi

and 1.conf should contain another video then 2.conf, 3.conf....

so:
if you have 2 videos you should have 1.conf and 2.conf.
if you have 3 videos you should have 1.conf, 2.conf and 3.conf.

rolan900d
02-20-2010, 08:40 AM
Checked all again but this code also didn't work me!


cp -r /usr/share/media /opt/
rm -r /usr/share/media

Error: no such file or directory

rolan900d
02-20-2010, 08:42 AM
your x.conf files have to look like this:

[hildon-welcome]
filename=videoname.avi

and 1.conf should contain another video then 2.conf, 3.conf....

so:
if you have 2 videos you should have 1.conf and 2.conf.
if you have 3 videos you should have 1.conf, 2.conf and 3.conf.

I have all that...
I think the issues are that the videos aren't being recognized in opt/media

Or the sym link isn't good?

I did symlink before from this thread!

http://tuxrunner.com/tech/optify-your-n900-boot-videos/

Under point 5

b666m
02-20-2010, 08:48 AM
wth ^^

sorry if i have to say that... but this manual is way too complicated...

i did following:
0. sudo gainroot
(get root-terminal)
1. cp -r /usr/share/hildon-welcome/media /opt/
(this should make /opt/media with the nokia hands video as content)
2. rm -r /usr/share/hildon-welcome/media
(this should remove the media folder from there)
3. cd /usr/share/hildon-welcome
(change the directory ^^)
4. ln -s /opt/media media
(symlinking /opt/media to /usr/share/hildon-welcome/media)

that should work :)
and you can place all of your additional videos in /opt/media/ ;)

rolan900d
02-20-2010, 08:57 AM
On post 28 you had another string....

Will try this one...

NO, still no go....
I am afraid I am done with this for now....
Been busy for 2 hours to make it work...

Just noticed with MC that usr/share/hildon-welcome/media folder wasn't deleted

I saw this : 'wave symbol'media inside usr/share/hildon-welcome/

When I go in there I see this:

'wave symbol'media
and underneath the 7 avi files I also had in /opt/media

b666m
02-20-2010, 09:03 AM
On post 28 you had another string....

Will try this one...

oooops...
you're right.. sorry for that..
(but you should have noticed the error because the command threw an error, didn't it?)
i'm only human... even i make mistakes... sometimes ^^

but thanks for pointing that out... i will edit the post before anybody else uses this...
(although it doesn't do anything at all xD)

rolan900d
02-20-2010, 09:06 AM
I now have around 7 'wave symbol'media folder with 7 avi files inside usr/share/hildon-welcome/media

Some how it all is copied???

This also happened in /opt/media

Just deleted the media folder in usr/shar/hildon-welcome/media

and also the multiple ones in opt/media

Now none of the videos boot

b666m
02-20-2010, 09:11 AM
ehm... you do know that you have to execute this commands as root, don't you?

so you have to type "sudo gainroot" first...
but you should have noticed that already. ^^
(from reading all along this thread)

i don't understand what you mean with:
"I now have around 7 'wave symbol'media folder with 7 avi files inside usr/share/hildon-welcome/media" ??? o.O

rolan900d
02-20-2010, 09:14 AM
Yeah I know mate!

It looked like thsi:

In the /opt/media folder were the 7 avi files but also a 'wave symbol'media folder

Inside that 'wave symbol'media folder was the same and in there the same and so on...

Also this issue in etc/share/hildon-welcome/media

b666m
02-20-2010, 09:21 AM
ok... start over again (i think the other manual did something wrong).

(1. make sure there is /opt/media/ with all your video-files inside.
check? check. ^^)
2. open xterm
3. type "sudo gainroot"
4. type "rm -r /opt/media/~media" (<- that's what you mean with 'wave symbol'media, right?)
5. type "ls /usr/share/hildon-welcome/media"

you shouldn't see the ~media folder anymore in /usr/share/hildon-welcome/media, right?

rolan900d
02-20-2010, 09:29 AM
That last command gave me a list with the 7 files in there...

So it looks good so far

b666m
02-20-2010, 09:31 AM
That last command gave me a list with the 7 files in there...

So it looks good so far

jap. that looks good. :)

rolan900d
02-20-2010, 09:31 AM
That 'wave'media folder is still there and also with the 7 files in there

Inside usr/share/hildon-welcome/media

I mean

b666m
02-20-2010, 09:35 AM
if it's only in /usr/share/hildon-welcome/media/ you can remove it via mc (i don't use it... so i'm only guessing) or
1. open xterm
2. sudo gainroot
3. rm -r /usr/share/hildon-welcome/media/~media

if it's still in /opt/media/ then you did something wrong with my commands above ^^

and if the ~media folder shows up anywhere else... you did something really strange wrong o.O

rolan900d
02-20-2010, 09:36 AM
Should I also do this?

rm -r /usr/share/hildon-welcome/media/~media

b666m
02-20-2010, 09:38 AM
if the folder /usr/share/hildon-welcome/media/~media exists, yes. ^^

rolan900d
02-20-2010, 09:39 AM
Okay deleted that folder!
It looks like this now...

usr/share/hildon-welcome/media/

Empty folder....

What now?

rolan900d
02-20-2010, 09:41 AM
Now when i boot up, none of the videos work

can't it be because of that other site explaining me a code:

for i in /opt/bootvideos/*; do ln -s $i /usr/share/hildon-welcome/media/$(echo $i | awk ‘BEGIN { FS=”/” } ; { print $4 }’); done

I think it might be corrupting one or the other?

b666m
02-20-2010, 09:42 AM
Okay deleted that folder!

usr/share/hildon-welcome/media/

still exists

and in this folder your movie-files show up, right?

if yes then i would say... you're ready to go if you followed my other instructions with chmod 777 /usr/bin/rvid and chmod 777 /etc/event.d/rvide after moving the files to those places ^^

(and of course having the default.conf and x.conf files in the right place)

just reboot your phone and report what's happening ;)

rolan900d
02-20-2010, 09:44 AM
and in this folder your movie-files show up, right?

if yes then i would say... you're ready to go if you followed my other instructions with chmod 777 /usr/bin/rvid and chmod 777 /etc/event.d/rvide after moving the files to those places ^^

(and of course having the default.conf and x.conf files in the right place)

just reboot your phone and report what's happening ;)


NO!
There are in /opt/media

My usr/share/hildon-welcome/media/ is empty

b666m
02-20-2010, 09:47 AM
ok *breath in, breath out*

1. sudo gainroot
(get root-terminal)
2. rm -r /usr/share/hildon-welcome/media
(this should remove the media folder from there)
3. cd /usr/share/hildon-welcome
(change the directory ^^)
4. ln -s /opt/media media
(symlinking /opt/media to /usr/share/hildon-welcome/media)

rolan900d
02-20-2010, 09:54 AM
I am sorry mate!
I am really do all of that!

Now there has a 'wave symbol'media folder appeared in usr/share/hildon-welcome/

In there are the 7 video files

Should I now execute those other commands ?

b666m
02-20-2010, 09:57 AM
where the heck does this ~media folder come from!?!? o.O

you need to have following:

1. in /opt/media/ there should only be your videos
2. because this folder is symlinked to /usr/share/hildon-welcome/media/ the videos should show up there too

everything else just shouldn't be there.

rolan900d
02-20-2010, 09:58 AM
I know...
It just keeps popping inside a 'wave'media folder...

I think it has to do with that command I did a while back to optify it...

rolan900d
02-20-2010, 10:06 AM
Trying again....

Is this command starting with a l (the letter from the word long) or is it I (caps on from the word Impossible)

Or is it that symbol like this |

rolan900d
02-20-2010, 10:10 AM
No, it had to be the letters long neck

So indeed ln

Everytime I do this:

ln -s /opt/media media

There is a folder created in usr/share/hildon-welcome/

wich has a wavesymbol in front of the word media

b666m
02-20-2010, 10:15 AM
ok...

which case is yours:

1. you only have /usr/share/hildon-welcome/media/

2. you only have /usr/share/hildon-welcome/~media/

3. you have both folders

4. you have /usr/share/hildon-welcome/media/~media/

rolan900d
02-20-2010, 10:18 AM
I have option 2

b666m
02-20-2010, 10:20 AM
is this shown in MC or when you type "ls /usr/share/hildon-welcome/" ?

rolan900d
02-20-2010, 10:22 AM
It is stated in MC

When I use the string it looks normal

b666m
02-20-2010, 10:26 AM
eeeeeeeq xD

i thought it is shown via the ls-command.

in MC a @ is shown in front of a file and a ~ in front of a directory if it's symlinked to somewhere else. so everything's OK.

(lol... this one was even hard to google ^^)

so mhm... if you've done everything i said.... symlinking... chmodding... placing the files in the correct place... reboot your device... :)

rolan900d
02-20-2010, 10:29 AM
Just checked the 2 file that needed the cp command..

They show up with * in front of it???

1. download the zip-file and place the two files "rvid" and "rvide" (for example) in ~/MyDocs/ranvid/
2. open xterm
3. type "sudo gainroot"
4. type "cp ranvid/rvid /usr/bin/"
5. type "chmod 777 /usr/bin/rvid"
6. type "cp ranvid/rvide /etc/event.d/"
7. type "chmod 777 /etc/event.d/rvide"

So the rvid in usr/bin and the rvide inside /etc/event.d/

b666m
02-20-2010, 10:32 AM
So the rvid in usr/bin and the rvide inside /etc/event.d/

correct and you have to "chmod 777" them :)

rolan900d
02-20-2010, 10:35 AM
Just checked the 2 file that needed the cp command..

They show up with * in front of it???

1. download the zip-file and place the two files "rvid" and "rvide" (for example) in ~/MyDocs/ranvid/
2. open xterm
3. type "sudo gainroot"
4. type "cp ranvid/rvid /usr/bin/"
5. type "chmod 777 /usr/bin/rvid"
6. type "cp ranvid/rvide /etc/event.d/"
7. type "chmod 777 /etc/event.d/rvide"

So the rvid in usr/bin and the rvide inside /etc/event.d/

I started it again from this part
Command 4 doesn't work for me...
I think it needs to be this:

cp home/user/MyDocs/ranvid/rvid /usr/bin

Or first this:

cd home/user/MyDocs

and then the commands

b666m
02-20-2010, 10:39 AM
I started it again from this part
Command 4 doesn't work for me...
I think it needs to be this:

cp home/user/MyDocs/ranvid/rvid /usr/bin

you can use full-path, yes :)

rolan900d
02-20-2010, 10:40 AM
Booted again several times and only the Hands show...

This is getting me nuts!

b666m
02-20-2010, 10:44 AM
1. open xterm
2. sudo gainroot
3. sh /usr/bin/rvid
4. cat /etc/hildon-welcome.d/default.conf

do all these commands work without any error?
what is line 4's output?

rolan900d
02-20-2010, 10:45 AM
What does your default.conf state inside :

etc/hildon-welcome.d/

b666m
02-20-2010, 10:50 AM
please try what i mentioned above your post. (:

rolan900d
02-20-2010, 10:51 AM
1. open xterm
2. sudo gainroot
3. sh /usr/bin/rvid
4. cat /etc/hildon-welcome.d/default.conf

do all these commands work without any error?
what is line 4's output?

1 - No problem
2 - All right
3 - rb 2.lock - rf 2.conf
4 -
[hildon-welcome]
filename=N900_2.avi

rolan900d
02-20-2010, 10:53 AM
Changed the default.conf to this:

[hildon-welcome]
filename=Hands-v32-h264.avi


Also didn't help

b666m
02-20-2010, 10:55 AM
so i guess "N900_2.avi" isn't nokia hands, right?

so my script is working (:

check if rvide is in /etc/event.d -> it should be /etc/event.d/rvide

1. open xterm
2. type "sudo gainroot"
3. type "chmod 777 /usr/bin/rvid"
4. type "chmod 777 /etc/event.d/rvide"

then reboot and watch xD

rolan900d
02-20-2010, 11:05 AM
Sorry, messed up on that default.conf

Did the last thing and rvide was in there

Did the chmod commands, rebooted several times but still only the Nokia hands

I am really sorry for spending your precious time...

I have had enough of it...

maybe I will try to reflash it and start from scrath,

That really long string from this site and thread:

http://tuxrunner.com/tech/optify-your-n900-boot-videos/

And this string I performed:

for i in /opt/bootvideos/*; do ln -s $i /usr/share/hildon-welcome/media/$(echo $i | awk ‘BEGIN { FS=”/” } ; { print $4 }’); done


Might messed it all up...

b666m
02-20-2010, 11:08 AM
i will restore my folders to default again and then follow my instructions to see if everything is understandable and working. (:

rolan900d
02-20-2010, 11:09 AM
You have as much patience like me...
Good thing, but without a wireless router is a pain!

b666m
02-20-2010, 11:39 AM
don't know what's going wrong... o.O

i did it mostly like he does:
http://talk.maemo.org/showthread.php?p=512874&highlight=event.d#post512874

maybe you could try "chmod a+x" instead of "chmod 777" although it should do the same.

you could also try to move the file from /usr/bin/rvid to /usr/local/bin/rvid and edit the "rvide" file. (you have to edit the path in this file)

i'll take some hours off... i'll continue trying different things the next few days... and hopefully there is a solution which works for everyone (:

rolan900d
02-20-2010, 11:52 AM
I only got in this thread when I saw your solution...

But after I edited the rvide file for the rvid path, I saw something stated about a script...

I haven't got that script in here right?

wasn't it in the solution you posted are in another post somewhere...

That could be it then?

b666m
02-20-2010, 12:05 PM
"script" and "end script" are only the tags which must be used in a file which is placed and executed in/by event.d ;)

maybe it would work by deleting rvid from /usr/bin/
and editing /etc/event.d/rvide to following:

start on startup

script

cd /etc/hildon-welcome.d/dconfs/

if [ -f 1.conf ]; then

# check which file is currently used
if [ -f *.lock ]; then
cuf=$(ls *.lock)
ruf=$cuf
rm *.lock
else
cuf="1.lock"
ruf=$cuf
fi

# determine number of files in /dconfs
nof=$(ls *.conf | wc -l)

while [ "$ruf" = "$cuf" ]; do

# get random number
rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
ruf="$rr.lock"
rf="$rr.conf"

done

# set file for checking which file is in use
rb="$rr.lock"
echo "rb $rb - rf $rf"

# copy it over to default.conf
cp $rf ../default.conf
touch $rb

fi

end script

rolan900d
02-20-2010, 12:14 PM
But I never did put a script any where!!!!

b666m
02-20-2010, 12:14 PM
THIS IS WORKING 100% :-D

YEAH BABY xD

i'll update my instructions and files here: ;)
http://talk.maemo.org/showpost.php?p=537905&postcount=35

b666m
02-20-2010, 12:15 PM
But I never did put a script any where!!!!

omg ^^
"rvid" and "rvide" ARE scripts ;)
but just wait for my instruction-update :D

b666m
02-20-2010, 12:20 PM
updated and working for me :)

-> http://talk.maemo.org/showpost.php?p=537905&postcount=35 <-

feedback please ^^

does it work for you too? (:

rolan900d
02-20-2010, 12:28 PM
I told you I was a noob but I am getting there....

Tried it with deletion of rvid and edit of rvide file.

Did the cp command and the 777 stuff...

Still only hands 4 me

rolan900d
02-20-2010, 12:31 PM
Will start from scratch again from here!

http://talk.maemo.org/showpost.php?p=537905&postcount=35

b666m
02-20-2010, 12:36 PM
thanks for being patient and testing my rubbish *hahaha* :D

i'm off for the next few hours ;)

(edit: if it doesn't work with "chmod 777" then use "chmod a+x" and try again ^^)

rolan900d
02-20-2010, 12:42 PM
We have lift off!

You did it mate!


That latest tweak worked 4 me!



Hallelujah!

rolan900d
02-20-2010, 12:45 PM
thanks for being patient and testing my rubbish *hahaha* :D

i'm off for the next few hours ;)

(edit: if it doesn't work with "chmod 777" then use "chmod a+x" and try again ^^)

Like i said above...

All good now!

Thanks for helping me!
This way you did a better job also!

b666m
02-20-2010, 01:12 PM
hehe :)

good to have someone who reads the things i wrote and point on some smaller errors (:

hope you enjoy your random video each time you boot up your device ;D *hehe*

rolan900d
02-20-2010, 01:17 PM
I do and all copied it over at maemo-freak (symbian-freak) and give credits...

I think it is better to create a new thread with just your last version.

This thread is a pain to go through now!

Thanks again

Now an app for this!

:rolleyes:

b666m
02-20-2010, 01:34 PM
This thread is a pain to go through now!

this is real development xD :p :D

Schturman
02-20-2010, 01:40 PM
and...
YEAH BABY!!! :D

got it replaced automatically... even before the video is loaded ^^ *hrhr*

instructions:

1. download the zip-file and place file "rvid" in ~/MyDocs/ranvid/ (for example)
2. open xterm
3. type "sudo gainroot"
4. type "cp MyDocs/ranvid/rvid /etc/event.d/"
5. type "chmod 777 /etc/event.d/rvid"

if you haven't done it yet:
8. type "mkdir /etc/hildon-welcome.d/dconfs"
9. place your default.conf files there BUT rename them in 1.conf, 2.conf, 3.conf and so on.

so the contents should be:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.

ehm yeah... have fun ;)

edit: forgot to mention... this one is the code which will always replace the current bootvideo with any other bootvideo out of the x.conf files (:

Thanks !!
Something strange...
I use the winSCP. I put the rvid file to the /etc/event.d and reboot the phone 4 times !
It's work, but it's change only between 2 videos from 4 I have :(
Why ?

rolan900d
02-20-2010, 03:08 PM
Better start from scratch as the rvid has been re-written

rolan900d
02-20-2010, 03:34 PM
Well, I am checking as well and indeed from the 7 videos I have, only the ones that are called 1.conf and 2.conf are shuffled!
Others won't do it....

I guess I was overexicited to see something diff. than those hands all the time..


Checked 15 times....

Only loops 1 and 2.conf files...

Schturman
02-20-2010, 03:50 PM
I get this :-)
Now it's play 3 videos from 4....
I check the dconfs folder and I found the file named 1.lock. I deleted this file and reboot again 4 times. Now it's play 3 videos from 4....
I check again the dconfs folder and I found the file named 4.lock... :cool:
I think, maybe I have put some simple video5 + 5.conf + 5.lock. Maybe this option lock the video number 5 and it's play only 4 videos :)
I'll try it's now...

Schturman
02-20-2010, 04:30 PM
Does not work ...
It's lock file created automatically, all time I reboot the phone...
I see again only 2 videos :cool:

rolan900d
02-20-2010, 04:32 PM
Must be a script issue...

Let's hope out German friend comes online soon...

Schturman
02-20-2010, 04:49 PM
Yep.... If random video not work, maybe it's better change the script to loopble for play 1,2,3,4.... and again 1,2,3,4...

b666m
02-21-2010, 12:16 AM
hey guys ;)

don't worry... the *.lock files are my way to check which default.conf is used at the moment... because i don't want to replace the file with the same file and _maybe_ get the same bootvideo over and over again.

i have tested my shellscript with 5 x.conf files.
you can see the output in the image i attached.
my script is doing what it is supposed to do.
maybe there is an issue with generating random numbers out of /dev/urandom on startup?!
http://en.wikipedia.org/wiki//dev/random

edit:
GOD DAMN IT!
my random number generating line only produces two different numbers. that's because /dev/urandom is based on drivers' noise and (that would be my explanation) gets flushed at power on. so the noise the drivers are producing is always the same at the same time. -.-

i need to find another way to get a random number :/
($RANDOM didn't work for me...)

b666m
02-21-2010, 01:18 AM
any suggestions for generating a REAL random number on startup?

i tried to launch the script on shutdown with "start on shutdown" but this doesn't work.
edit: "start on runlevel 0" doesn't work too. :(
would be nice if there would be any chance of running the a script in event.d on shutdown.
especially if it depends on a good entropy pool like generating a random number out of /dev/urandom. ^^

if anyone is interested in why my script doesn't work properly on startup... take a look here:
http://linux.about.com/library/cmd/blcmdl4_urandom.htm :)

Schturman
02-21-2010, 03:11 AM
Maybe we need write numbers of our videos here:

# get random number
rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")


to something:


# get random number
rn=$(dd if=/dev/urandom count=1 7> /dev/null | cksum | cut -f1 -d" ")


7 - this is a number of videos your have ?

b666m
02-21-2010, 03:32 AM
ehm... this line is ONLY for generating a RANDOM number (because $RANDOM doesn't seem to work).

it makes a copy (dd) of /dev/urandom but only of the first block (count 1) and deletes the rest (2> /dev/null).
because urandom doesn't only consists of numbers - but we want a number/integer - you have to change this using the checksum (cksum).
but this checksum is way too long so we are cutting (cut) it off. (:

i'm only searching for another way of getting randomness in my script on startup.
i tried it with rn=$(date +%S) which saves only the seconds of the current timestamp in rn... but on startup date-command only counts up and doesn't show the actual time :(
so i'm only getting 1 and 2... -.-

i've been searching google for the last few hours... but i can't find anything useful...

btw: i'm awake for over 40 hours... my eyes are bloody-red... so i'll go in my bed now ^^

if somebody knows a solution for getting a random number at startup... please post :)

good night. (:

tuminoid
02-21-2010, 03:44 AM
i tried to launch the script on shutdown with "start on shutdown" but this doesn't work.


I think it should be
start on starting shutdown
as you can see from other event.d scripts:
grep shutdown /etc/event.d/*

rolan900d
02-21-2010, 06:49 AM
Editing the first line in rvid to :

"start on starting shutdown"

made it run 3 diff. for now....

I have to go but try one more...
Look all right to me now!

Loop went like this:

1

2

5

1

2

5



Only 3 loops now

b666m
02-21-2010, 12:19 PM
as far as i understand /dev/urandom gets seeded with noise from drivers during operations from the user.
so if you just startup and shutdown there are very small chances that there are any differences.

unfortunately i don't know when the entropy pool gets seeded exactly. it could be when you open any app. but it could be that it's only seeded when special things happen.

so my suggestion would be a "longer" testing of this:
1. edit /etc/event.d/rvid and change the line "start on startup" to "start on starting shutdown" and then do "chmod 777 /etc/event.d/rvid"
2. but don't startup and then shutdown your phone immediatly.
3. after startup maybe you want to open different apps. for example: surf the web with browser and things you would also do normally.
(hopefully by doing so the pool gets seeded)

if this doesn't bring any improvements i could write some additional code which saves some blocks of on shutdown /dev/urandom to a file and then seeds /dev/urandom on startup first before doing my random number generation.
(that would be a very freaky solution ^^)

one other thing you can do when you have changed to "start on starting shutdown":
open /etc/event.d/rvid and comment out the line "rn=$(dd ... )". make a new line right under this one and type "rn=$(date +%s)".
seconds since 00:00:00, Jan 1, 1970 (a GNU extension)
Note that this value is defined by the localtime system
call.
ok... it's not 100% random but hey... chances are nearly equal for all of the x.conf to get loaded.

b666m
02-21-2010, 12:41 PM
blubb... working... the bootvideo gets set on shutdown... here's the code:

start on starting shutdown

script

cd /etc/hildon-welcome.d/dconfs/

if [ -f 1.conf ]; then

# check which file is currently used
if [ -f *.lock ]; then
cuf=$(ls *.lock)
ruf=$cuf
rm *.lock
else
cuf="1.lock"
ruf=$cuf
fi

# determine number of files in /dconfs
nof=$(ls *.conf | wc -l)

while [ "$ruf" = "$cuf" ]; do

# get "random" number lol
rn=$(date +%s)

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
ruf="$rr.lock"
rf="$rr.conf"

done

# set file for checking which file is in use
rb="$rr.lock"
echo "rb $rb - rf $rf"

# copy it over to default.conf
cp $rf ../default.conf
touch $rb

fi

end script

will update the instructions with a this new file. thanks for testing again! :)

edit: instructions and attachment on page 4 updated.
and i attached the file here too. (but you could also copy & paste the code from this post ^^)

how it works:

rolan900d
02-21-2010, 12:42 PM
It did indeed.
I forgot to chmod 777 the file

All is good over here...

Thanx 2 Tuminoid as well

Buddy. where you have updated it?

On page 4 it is stated that the last update was done yesterday

b666m
02-21-2010, 12:45 PM
i would take "rn=$(date +%s)" instead of random number generation out of /dev/urandom.

we just need something which is different every time we look at it and it don't have to be something for strong cryptography. (:

b666m
02-21-2010, 12:53 PM
Buddy. where you have updated it?

On page 4 it is stated that the last update was done yesterday

the attachment of page 4 is updated now.
but i posted the code above.
so you could just make a new file and copy & paste it. *G*

edit:
sorry... but i have to say it... /dev/urandom is a b*tch !!! ^^

rolan900d
02-21-2010, 01:06 PM
Got it!

Cheers

b666m
02-21-2010, 01:08 PM
wow... that was really tricky... but like hatebreed would shout it:

a lesson lived is a lesson learned :p

rolan900d
02-21-2010, 01:35 PM
Hahahaha, indeed mate.

Schturman
02-21-2010, 02:29 PM
b666m, you are king !!!
Thank you !!!

b666m
02-21-2010, 02:51 PM
it's fascinating to see how such a project evolves :)

from:
#!/bin/bash

# determine number of files in /dconfs
cd /etc/hildon-welcome.d/dconfs/
nof=$(ls *.conf | wc -l)

# get random number
rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
rf="$rr.conf"
echo "$rr.conf"

# copy it over to default.conf
cp $rf ../default.conf

# exit
exit 0

to:
start on starting shutdown

script

cd /etc/hildon-welcome.d/dconfs/

if [ -f 1.conf ]; then

# check which file is currently used
if [ -f *.lock ]; then
cuf=$(ls *.lock)
ruf=$cuf
rm *.lock
else
cuf="1.lock"
ruf=$cuf
fi

# determine number of files in /dconfs
nof=$(ls *.conf | wc -l)

while [ "$ruf" = "$cuf" ]; do

# get "random" number lol
rn=$(date +%s)

# in range of 1 - nof
let "rr = $rn % $nof + 1"

# choose random conf
ruf="$rr.lock"
rf="$rr.conf"

done

# set file for checking which file is in use
rb="$rr.lock"

# copy it over to default.conf
cp $rf ../default.conf
touch $rb

fi

end script

btw:
this is why i love the n900. try to run such a script on any other phone. it won't be that easy (if it's possible at all... ^^)

b666m
02-21-2010, 05:41 PM
btw: i found something REALLY nerdy:

a hourglass random number generator ^^

take a look:
http://blog.makezine.com/archive/2009/12/usb_hourglass_random_number_generat.html

rolan900d
02-21-2010, 07:57 PM
Hahahaha, some guys have all the fun!

b666m
02-22-2010, 12:10 AM
a summation in the end:

if you like having a single script and aren't afraid of using some xterm:
http://talk.maemo.org/showpost.php?p=537905&postcount=35

if you want a gui and eyecandy:
http://talk.maemo.org/showpost.php?p=540418&postcount=69

my work is done here. :p

rolan900d
02-22-2010, 04:36 AM
You did good!