From a1e9913ff549395bd0375c6f044a0a0ddc3c1097 Mon Sep 17 00:00:00 2001 From: Paul J R Date: Sun, 25 Aug 2013 00:18:22 +1000 Subject: [PATCH] makefile for pps-tools --- setup_build.sh | 2 + .../filesystem/etc/init.d/S01custom_pre_startup | 74 ++++++++++++++++++++ src/pps-tools/Makefile | 35 +++++++++ 3 files changed, 111 insertions(+), 0 deletions(-) create mode 100644 src/pps-tools/Makefile diff --git a/setup_build.sh b/setup_build.sh index ed7b075..d0c8124 100755 --- a/setup_build.sh +++ b/setup_build.sh @@ -16,5 +16,7 @@ echo "Setting up buildroot" tar xfz ../src_arch/buildroot-2013.05.tar.gz echo "..... done" +echo "Getting ppstools" + echo "You now need to do a \"git reset --hard\" then \"sh makeitall\"" diff --git a/src/buildroot-2013.05/custom/filesystem/etc/init.d/S01custom_pre_startup b/src/buildroot-2013.05/custom/filesystem/etc/init.d/S01custom_pre_startup index 17929bb..3ac5d70 100755 --- a/src/buildroot-2013.05/custom/filesystem/etc/init.d/S01custom_pre_startup +++ b/src/buildroot-2013.05/custom/filesystem/etc/init.d/S01custom_pre_startup @@ -1,33 +1,107 @@ #!/bin/sh # deal with our mounts +echo "Mounting normal file systems" +echo ".... proc" mkdir /proc > /dev/null 2>&1 mount -t proc proc /proc mkdir /sys > /dev/null 2>&1 +echo ".... sys" mount -t sysfs sys /sys mkdir -p /dev/pts > /dev/null 2>&1 +echo ".... devpts" mount -t devpts devpts /dev/pts +echo ".... tmpfs" mount /tmp > /dev/null 2>&1 # create out gps0 +echo "Creating serial devices" +echo ".... gps0" ln -s /dev/ttyS0 /dev/gps0 +echo ".... gpspps0" mknod -m 0664 /dev/pps0 c 252 0 ln -s /dev/pps0 /dev/gpspps0 # mount the config file system mkdir /fs > /dev/null 2>&1 +echo "Mounting /fs" mount /dev/sda1 /fs > /dev/null 2>&1 +echo "Looking for system config" if [ -f /fs/config/system ] then + echo ".... found - loading" . /fs/config/system fi +echo "Looking for dropbear config" if [ -f /fs/config/dropbear.tar ] then RD=`pwd` cd / + echo ".... found - installing" tar xf /fs/config/dropbear.tar cd $RD fi + +# create the interfaces layout +echo "Setting up network interfaces configuration" +echo ".... loopback" +cat << EOF > /etc/network/interfaces +auto lo +iface lo inet loopback + +EOF + +# create network interfaces bit +if [ "x$INTERFACE" == "xdhcp" ] +then +echo ".... eth0 - dhcp" +cat << EOF >> /etc/network/interfaces +auto eth0 +iface eth0 inet dhcp +EOF + +else + # static network address + if [ "x$NET_ADDRESS" != "x" ] + then + + echo ".... eth0 - static $NET_ADDRESS - $NET_MASK" +cat << EOF >> /etc/network/interfaces +auto eth0 +iface eth0 inet static +address $NET_ADDRESS +netmask $NET_MASK +EOF + fi + + # set gateway + if [ "x$NET_GW" != "x" ] + then + echo ".... eth0 - gateway $NET_GW" +cat << EOF >> /etc/network/interfaces +gateway $NET_GW +EOF + fi + + # dns search domain + if [ "x$NET_SEARCH_DOMAIN" != "x" ] + then + echo ".... eth0 - search domain $NET_SEARCH_DOMAIN" +cat << EOF >> /etc/network/interfaces +gateway $NET_SEARCH_DOMAIN +EOF + fi + + # dns servers + if [ "x$NET_DNS_SERVERS" != "x" ] + then + echo ".... eth0 - dns servers $NET_DNS_SERVERS" +cat << EOF >> /etc/network/interfaces +gateway $NET_DNS_SERVERS +EOF + fi + +fi diff --git a/src/pps-tools/Makefile b/src/pps-tools/Makefile new file mode 100644 index 0000000..d96f58c --- /dev/null +++ b/src/pps-tools/Makefile @@ -0,0 +1,35 @@ +TARGETS = ppstest ppsctl ppswatch + +CFLAGS += -Wall -O2 -D_GNU_SOURCE -m32 -static +CFLAGS += -I . +CFLAGS += -ggdb +CFLAGS += -D__N_PPS=18 + +# -- Actions section -- + +.PHONY : all depend dep + +all : .depend $(TARGETS) + +.depend depend dep : + $(CC) $(CFLAGS) -M $(TARGETS:=.c) > .depend + +ifeq (.depend,$(wildcard .depend)) +include .depend +endif + +install : all + install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS) + install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h + +uninstall : + for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done + rm $(DESTDIR)/usr/include/sys/timepps.h + +# -- Clean section -- + +.PHONY : clean + +clean : + rm -f *.o *~ core .depend + rm -f ${TARGETS} -- 1.7.0.4