I am a bit confused as to what you are trying to do. I guess you don't want to have to load an Arduino sketch every time you want to use the card. For a sketch to remain on the system you have to boot from one of the standard Fat versions of Yocto linux.
If you follow one of the getting started guides for your board (Galileo Gen 1 or Gen 2?) it will walk you through how to format a SD card and boot your system with a fat version of Linux. See Intel® Download Center for files and links.
Once you have that set up you can program you Galileo via the Arduino IDE for Galileo (1.5.3) or go to the Arduino.cc site and download new 1.6 version that does regular Arduinos and the Galileo. Make sure you connect the power prior to connecting the micro-usb.
Sketches you load via the Arduino IDE will be stored in a directory on the SD card and then automatically start when you power on the board so you don't have to reload it again.
If you don't want to use the IDE it would be much more difficult to generate the hex file and put it on the board.
I assume if you are directly connecting to your PC you don't have DHCP so need a static address, so maybe you just want to configure you network files to have a static IP.
If you get a small hub you can share a lan connection and just display the IP address you get. I run a small Python program at startup that displays the IP address on an LCD screen - Python, Wiring_x86, I2C LCD, Grove RGB LCD
Hope this helps, if not please clarify more what you are trying to do.
Yes it is possible to run a script at start up in the linux side. All you need to do is to create a shell script and place it in /etc/init.d, make it executable and add it to the system start-up. Take a look at this guide on how to do it, I know the guide says it is for Edison but Galileo uses init.d so it works as well I just tested it to be sure. Let me know it this works for you as well.
It does work for me.
i have just added these two commands in a etc/init.d/myscript.sh
telnetd -l /bin/sh
ifconfig eth0 169.254.1.1 netmask 255.255.0.0 up
chmod +x myscript.sh
and its done.
Now Galileo is assigning IP address itself and i don't have to manually run a sketch fot it.