maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Design (https://talk.maemo.org/forumdisplay.php?f=46)
-   -   Multiple boot videos? (https://talk.maemo.org/showthread.php?t=43840)

b666m 2010-02-19 23:56

Re: Multiple boot videos?
 
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: ^^

Code:

#! /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...me_with_Debian

then doing:
Code:

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 2010-02-20 00:51

Re: Multiple boot videos?
 
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 2010-02-20 04:20

Re: Multiple boot videos?
 
1 Attachment(s)
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 2010-02-20 05:39

Re: Multiple boot videos?
 
1 Attachment(s)
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 ^^)

Code:

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 ^^

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"

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

  fi

end script

how it works:

b666m 2010-02-20 05:53

Re: Multiple boot videos?
 
1 Attachment(s)
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 2010-02-20 06:09

Re: Multiple boot videos?
 
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 2010-02-20 12:28

Re: Multiple boot videos?
 
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 2010-02-20 12:32

Re: Multiple boot videos?
 
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 2010-02-20 12:33

Re: Multiple boot videos?
 
I did that but than only the hands animation runs.
My default.conf is the hands one

rolan900d 2010-02-20 12:36

Re: Multiple boot videos?
 
Quote:

Originally Posted by b666m (Post 538343)
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


All times are GMT. The time now is 17:19.

vBulletin® Version 3.8.8