Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Multiple boot videos?

    Reply
    Page 4 of 13 | Prev |   2     3   4   5     6   | Next | Last
    b666m | # 31 | 2010-02-19, 23:56 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by b666m; 2010-02-20 at 06:21.

     
    b666m | # 32 | 2010-02-20, 00:51 | Report

    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)

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to b666m For This Useful Post:
    Schturman

     
    b666m | # 33 | 2010-02-20, 04:20 | Report

    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 )

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Images
     

    Last edited by b666m; 2010-02-20 at 04:22.

     
    b666m | # 34 | 2010-02-20, 05:39 | Report

    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:

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Images
     

    Last edited by b666m; 2010-02-21 at 16:51.
    The Following User Says Thank You to b666m For This Useful Post:
    Schturman

     
    b666m | # 35 | 2010-02-20, 05:53 | Report

    and...
    YEAH BABY!!!

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

    Edit | Forward | Quote | Quick Reply | Thanks
    Attached Files
    File Type: zip rvid.zip (469 Bytes, 112 views)

    Last edited by b666m; 2010-02-22 at 02:05.
    The Following 5 Users Say Thank You to b666m For This Useful Post:
    F2thaK, kamiwey, Lobi_Earl, rolan900d, Schturman

     
    rolan900d | # 36 | 2010-02-20, 06:09 | Report

    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

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by rolan900d; 2010-02-20 at 12:10.

     
    rolan900d | # 37 | 2010-02-20, 12:28 | Report

    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/

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by rolan900d; 2010-02-20 at 12:33.

     
    b666m | # 38 | 2010-02-20, 12:32 | Report

    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.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    rolan900d | # 39 | 2010-02-20, 12:33 | Report

    I did that but than only the hands animation runs.
    My default.conf is the hands one

    Edit | Forward | Quote | Quick Reply | Thanks

     
    rolan900d | # 40 | 2010-02-20, 12:36 | Report

    Originally Posted by b666m View Post
    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

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 4 of 13 | Prev |   2     3   4   5     6   | Next | Last
vBulletin® Version 3.8.8
Normal Logout