Jump to content

newbie question : How do I boot from a built file?


dhkim0225

Recommended Posts

Hello I am a newbie.
Some of you may be surprised by my lack of questions. However, I have not been able to find the answer in a few days.
Please help me a little.

I am using Raspberry Pie 3.
I have built the mine_sweeper example using ugfx.
The Makefile was created as follows.

# General settings
        # See $ (GFXLIB) /tools/gmake_scripts/readme.txt for the list of variables
        OPT_OS = linux
        OPT_LINK_OPTIMIZE = yes
        OPT_CPU = raspberrypi

# UGFX settings
        # See $ (GFXLIB) /tools/gmake_scripts/library_ugfx.mk for the list of variables
        GFXLIB = ../resources/ugfx
        GFXBOARD = Linux-Framebuffer-Touch
        GFXDEMO = games / minesweeper

# Linux settings
        # See $ (GFXLIB) /tools/gmake_scripts/os_linux.mk for the list of variables

####################################################### ##################################################
# Set these for your project
#

ARCH =
SRCFLAGS = -ggdb -O0
CFLAGS = `sdl2-config -libs -cflags`
CXXFLAGS =
ASFLAGS =
LDFLAGS = -lm

SRC =
OBJS =
DEFS =
LIBS =
INCPATH =
LIBPATH =

####################################################### ##################################################
# These should be at the end
#

Include $ (GFXLIB) /tools/gmake_scripts/library_ugfx.mk
Include $ (GFXLIB) / tools / gmake_scripts / os_ $ (OPT_OS) .mk
Include $ (GFXLIB) /tools/gmake_scripts/compiler_gcc.mk
# *** EOF ***


The build worked just fine and I ran .build / mine_sweeper so it worked well in RaspberryPie.

But I do not know how to make this executable program run as soon as Raspberry Pie is turned on.

Https://www.youtube.com/watch?v=yOONtUsOOVw

I want to do this as it appears on the YouTube link.

So I added the following line to rc.local and rebooted, but nothing happened.

~ / Documents / projects / mine_sweeper / .build / mine_sweeper

The path was clear and the above statement worked fine in the bash shell.

What did I do wrong? T-T

Link to comment
Share on other sites

~ is not a valid path component. It is normally expanded by the shell to your user home directory. 

You need to replace the ~ with the path to your home directory eg /home/myusername.

You also need to ensure that the root process has permission to get to the executable. Because of that you actually may want to copy the program to a directory such as /usr/local/bin and run it from there instead as part of your boot process.

Also, don't forget to turn off X starting up in your boot process as that will prevent µGFX accessing the framebuffer.

One last comment...

As you are using the linux framebuffer you can safely remove the CFLAGS for sdl from your makefile.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...