aboutsummaryrefslogtreecommitdiffstats
path: root/tools/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/scripts')
-rw-r--r--tools/scripts/pkgmk-test.conf10
-rw-r--r--tools/scripts/pkgmk-test.sh2
-rw-r--r--tools/scripts/runvm/profile/crux3
-rw-r--r--tools/scripts/runvm/runvm.sh22
-rw-r--r--tools/scripts/setup-nginx.sh22
-rw-r--r--tools/scripts/system-qemu.sh58
6 files changed, 42 insertions, 75 deletions
diff --git a/tools/scripts/pkgmk-test.conf b/tools/scripts/pkgmk-test.conf
index 2336685..1ebdccb 100644
--- a/tools/scripts/pkgmk-test.conf
+++ b/tools/scripts/pkgmk-test.conf
@@ -2,11 +2,13 @@
# /etc/pkgmk.conf: pkgmk(8) configuration
#
-export CFLAGS="-O2 -march=x86-64"
+export CPPFLAGS="-D_FORTIFY_SOURCE=2"
+export CFLAGS="-O2 -march=native -mtune=native -pipe -fPIC -fPIE -fstack-protector-strong --param=ssp-buffer-size=4 -fno-plt -fstack-check"
export CXXFLAGS="${CFLAGS}"
-
+export LDFLAGS="-fPIE -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
export MAKEFLAGS="-j4"
+
case ${PKGMK_ARCH} in
"64"|"")
;;
@@ -22,7 +24,7 @@ case ${PKGMK_ARCH} in
;;
esac
- PKGMK_SOURCE_MIRRORS=(https://ports.c9.core/distfiles/)
+PKGMK_SOURCE_MIRRORS=(https://c9.root.sx/ports/distfiles/)
# PKGMK_SOURCE_DIR="$PWD"
# PKGMK_PACKAGE_DIR="$PWD"
# PKGMK_WORK_DIR="$PWD/work"
@@ -34,5 +36,3 @@ esac
# PKGMK_WGET_OPTS=""
# PKGMK_CURL_OPTS=""
# PKGMK_COMPRESSION_MODE="gz"
-
-
diff --git a/tools/scripts/pkgmk-test.sh b/tools/scripts/pkgmk-test.sh
index 5509ac2..a279967 100644
--- a/tools/scripts/pkgmk-test.sh
+++ b/tools/scripts/pkgmk-test.sh
@@ -2,4 +2,4 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CONF=${DIR}/pkgmk-test.conf
-fakeroot pkgmk -cf $CONF -d $1
+fakeroot pkgmk -cf $CONF -d -is $1
diff --git a/tools/scripts/runvm/profile/crux b/tools/scripts/runvm/profile/crux
new file mode 100644
index 0000000..eb2dc63
--- /dev/null
+++ b/tools/scripts/runvm/profile/crux
@@ -0,0 +1,3 @@
+iso=iso/crux-3.2.iso
+image=img/crux-img.qcow2
+tap="tap1"
diff --git a/tools/scripts/runvm/runvm.sh b/tools/scripts/runvm/runvm.sh
new file mode 100644
index 0000000..db479cc
--- /dev/null
+++ b/tools/scripts/runvm/runvm.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+function rmac_addr (){
+printf '54:60:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))
+}
+
+source profile/$1
+boot=$2
+
+mac=$(rmac_addr)
+
+qemu-system-x86_64 \
+ -enable-kvm \
+ -m 1024 \
+ -boot ${boot} \
+ -cdrom ${iso} \
+ -hda ${image} \
+ -vga std \
+ -display sdl \
+ -device e1000,netdev=t0,mac=${mac} \
+ -netdev tap,id=t0,ifname=${tap},script=no,downscript=no \
+ &
diff --git a/tools/scripts/setup-nginx.sh b/tools/scripts/setup-nginx.sh
index decacc1..11065d2 100644
--- a/tools/scripts/setup-nginx.sh
+++ b/tools/scripts/setup-nginx.sh
@@ -1,16 +1,16 @@
#!/bin/sh
-. `dirname $0`/config-install.sh
-
-prt-get depinst nginx
-
-cp -R $CONF_DIR/etc/nginx/* /etc/nginx/
-
-mkdir /srv/www
-chown nginx:www /srv/www
-
-usermod -a -G www nginx
-usermod -m -d /srv/www nginx
+#. `dirname $0`/config-install.sh
+#
+#prt-get depinst nginx
+#
+#cp -R $CONF_DIR/etc/nginx/* /etc/nginx/
+#
+#mkdir /srv/www
+#chown www:www /srv/www
+#
+#usermod -a -g www nginx
+#usermod -m -d /srv/www nginx
openssl genrsa -des3 -out /etc/ssl/keys/nginx.key 2048
openssl req -new -key /etc/ssl/keys/nginx.key -out /etc/ssl/certs/nginx.csr
diff --git a/tools/scripts/system-qemu.sh b/tools/scripts/system-qemu.sh
deleted file mode 100644
index 489af5e..0000000
--- a/tools/scripts/system-qemu.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-# First we define the function
-ConfirmOrExit ()
-{
- while true
- do
- echo -n "Please confirm (y or n) :"
- read CONFIRM
- case $CONFIRM in
- y|Y|YES|yes|Yes) break ;;
- n|N|no|NO|No)
- echo "Aborting - you entered $CONFIRM"
- exit
- ;;
- *) echo "Please enter only y or n"
- esac
- done
- echo "You entered $CONFIRM. Continuing ..."
-}
-
-SCRIPT=$(readlink -f "$0")
-# Absolute path this script is in, thus /home/user/bin
-SCRIPTPATH=$(dirname "$SCRIPT")
-
-DIR=$(dirname "$SCRIPTPATH");
-DIR_LOCAL="$(dirname $(dirname ${DIR}))/local";
-
-MEM=$1
-TAP=$2
-ISO_FILE="${DIR_LOCAL}/$3"
-IMG="${DIR_LOCAL}/$4"
-
-echo "MEM (512): $MEM"
-echo "TAP (tap1): $TAP"
-echo "ISO_FILE (crux-3.2.iso): $ISO_FILE"
-echo "IMG (crux-img.qcow2): $IMG"
-ConfirmOrExit
-
-if [ "$ISO_FILE" = "$DIR_LOCAL/" ]
-then
- qemu-system-x86_64 \
- -enable-kvm \
- -m $MEM \
- -boot c \
- -hda ${IMG} \
- -net nic,model=virtio -net tap,ifname=${TAP},script=no,downscript=no
-else
- qemu-system-x86_64 \
- -enable-kvm \
- -m $MEM \
- -boot d \
- -cdrom ${ISO_FILE} \
- -hda ${IMG} \
- -net nic,model=virtio -net tap,ifname=${TAP},script=no,downscript=no
-fi
-
-exit 0;