Find the answer to your Linux question:
Page 3 of 3 FirstFirst 1 2 3
Results 21 to 29 of 29
this is the rc.local file.. #!/bin/sh cd /usr/gp2x ./bw & exec ./gp2xmenu...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #21
    Just Joined!
    Join Date
    Aug 2012
    Posts
    17

    this is the rc.local file..

    #!/bin/sh
    cd /usr/gp2x
    ./bw &
    exec ./gp2xmenu

  2. #22
    Just Joined!
    Join Date
    Aug 2012
    Posts
    17
    I did this:
    #!/bin/sh
    cd /usr/gp2x
    ./bw &
    exec ./gp2xmenu
    umount /mnt/sd && mount /dev/mmcblk0p1 /mnt/sd -t vfat -o rw,sync,noatime,check=r

    Didn't work though

  3. #23
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by LTStone View Post
    I did this:
    #!/bin/sh
    cd /usr/gp2x
    ./bw &
    exec ./gp2xmenu
    umount /mnt/sd && mount /dev/mmcblk0p1 /mnt/sd -t vfat -o rw,sync,noatime,check=r

    Didn't work though
    that is b/c exec turns over control to the command it called (i.e. gp2xmenu) and does not return to the calling process (i.e. rc.local or whatever).

    try putting it before those commands, e.g.:

    Code:
    #!/bin/sh
    
    umount /mnt/sd && \
      mount /dev/mmcblk0p1 /mnt/sd -t vfat -o rw,sync,noatime,check=r
    
    cd /usr/gp2x
    ./bw &
    exec ./gp2xmenu
    Note: i added a bash line continuation character "\" to separate the umount and mount commands on two different lines.

  4. #24
    Just Joined!
    Join Date
    Aug 2012
    Posts
    17
    Darn, nope no change..

  5. #25
    Just Joined!
    Join Date
    Aug 2012
    Posts
    17
    Ok, so I made a script and stuck it in the /temp dir. i just run it then run the game. BUT how do I remount the sd back to normal? and do I even need to? everything seems to run fine anyway..

  6. #26
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by LTStone View Post
    Darn, nope no change..
    then i would guess that either "bw" or "gp2xmenu" are doing the job of mounting the SD card.

    You can try running gp2xmenu in the background (notice the ampersand after it) and then calling the mount commands:

    Code:
    #!/bin/sh
    cd /usr/gp2x
    ./bw &
    ./gp2xmenu &
    umount /mnt/sd && mount /dev/mmcblk0p1 /mnt/sd -t vfat -o rw,sync,noatime,check=r

  7. #27
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by LTStone View Post
    Ok, so I made a script and stuck it in the /temp dir. i just run it then run the game. BUT how do I remount the sd back to normal? and do I even need to? everything seems to run fine anyway..
    if you are worried remounting the SD card after every time you run games, then maybe you'd want to put the umount/mount commands in the launcher for every DOS game. then again, maybe that makes more sense, if you only have a few DOS games.

    i don't really see the big deal if you leave "check=relaxed" for your FAT filesystem. but if you want to, then i'd recommend writing a simple DOS game launcher script that you'd use for all your DOS games: you can pass the game to run as an argument to th script. you can modify your /temp script for this purpose. here's an example:

    Code:
    #!/bin/sh
    
    # make sure game script is passed as first arg to script
    [ $# -ne 1 ] && echo "Usage: $0 </path/to/game>" && exit 1
    
    # this will be /path/to/martian.gpe or whatever
    game=$1
    
    # make sure game script is found (use absolute path)
    ! [ -f $game ] && echo "$game: No such file" && exit 1
    
    # remount SD card with relaxed check
    umount /mnt/sd
    if [ $? -ne 0 ]; then
      echo "Failed to unmount SD card"
      exit 1
    fi
    mount /dev/mmcblk0p1 /mnt/sd -t vfat -o rw,sync,noatime,check=r
    
    # execute the game
    $game
    
    # when game is done, remount the SD Card with normal check
    mount -o remount,check=n /dev/mmcblk0p1 /mnt/sd
    call the script "dos-game.sh", make it executable ("chmod +x /tmp/dos-game.sh") and run games like this:

    Code:
    /tmp/dos-game.sh /path/to/martian.gpe
    /tmp/dos-game.sh /path/to/ultima.gpe
    there might even be ways to create desktop shortcuts or app launchers or whatever GPX2 uses for these commands.

  8. #28
    Just Joined!
    Join Date
    Aug 2012
    Posts
    17
    Whoohoo, Well, I have made a desktop launcher, and the games that gave me trouble are working fine now,
    It was almost as much fun just trying to get this working and learning a few things in the process
    (file systems, how my GP2X Wiz works, scripts) etc. Once again I appreciate you taking the time to help me through
    the process while others just ignored me or just said its a problem with the old unfinished unsupported Dosbox port blah blah blah.. either way its doing what I want now and I'll pay it forward. Well I'm off to the coffee shop to relax and play some Martian Dreams or Ultima Underworld..

  9. #29
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    Quote Originally Posted by LTStone View Post
    It was almost as much fun just trying to get this working and learning a few things in the process
    (file systems, how my GP2X Wiz works, scripts) etc.
    i know exactly what you mean. i often get caught up in the thrill of tweaking a fix vs actually doing something "fun" like fragging.

    Once again I appreciate you taking the time to help me through
    the process
    you are welcome and I'm glad it got sorted!

    Well I'm off to the coffee shop to relax and play some Martian Dreams or Ultima Underworld..
    i have to admit, seeing Ultima in the description of your problem struck a chord w/me. I cut my gaming teeth on Ultima III and IV back in the day on a Commodore 64, so I'm glad to help out a fellow expatriate of Britannia!

Page 3 of 3 FirstFirst 1 2 3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •