public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/releng:master commit in: tools-uclibc/
Date: Thu,  9 May 2013 21:11:12 +0000 (UTC)	[thread overview]
Message-ID: <1368133848.57e35418478abc16845636fab6857767dc381f06.blueness@gentoo> (raw)

commit:     57e35418478abc16845636fab6857767dc381f06
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Thu May  9 21:10:48 2013 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Thu May  9 21:10:48 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=57e35418

tools-uclibc: improve template logic

---
 tools-uclibc/run.sh                                |   60 +++++++++++++------
 tools-uclibc/stage-all.conf.template               |    9 +++
 .../stage1-amd64-uclibc-hardened.conf.template     |    9 ---
 .../stage1-amd64-uclibc-vanilla.conf.template      |    9 ---
 .../stage1-i686-uclibc-hardened.conf.template      |    9 ---
 .../stage1-i686-uclibc-vanilla.conf.template       |    9 ---
 .../stage2-amd64-uclibc-hardened.conf.template     |    9 ---
 .../stage2-amd64-uclibc-vanilla.conf.template      |    9 ---
 .../stage2-i686-uclibc-hardened.conf.template      |    9 ---
 .../stage2-i686-uclibc-vanilla.conf.template       |    9 ---
 .../stage3-amd64-uclibc-hardened.conf.template     |    8 ---
 .../stage3-amd64-uclibc-vanilla.conf.template      |    8 ---
 .../stage3-i686-uclibc-hardened.conf.template      |    8 ---
 .../stage3-i686-uclibc-vanilla.conf.template       |    8 ---
 14 files changed, 50 insertions(+), 123 deletions(-)

diff --git a/tools-uclibc/run.sh b/tools-uclibc/run.sh
index e45f7df..4d89f19 100755
--- a/tools-uclibc/run.sh
+++ b/tools-uclibc/run.sh
@@ -12,6 +12,7 @@ source /etc/catalyst/catalyst.conf
 mydate=`date +%Y%m%d`
 
 undo_grsec() {
+  [[ -d /proc/sys/kernel/grsecurity ]] || return
   for i in /proc/sys/kernel/grsecurity/chroot_* ; do
     echo 0 > $i
   done
@@ -22,10 +23,31 @@ prepare_confs() {
   local flavor=$2
 
   for s in 1 2 3; do
-    cat stage${s}-${arch}-uclibc-${flavor}.conf.template | \
+
+    local cstage=stage${s}
+    local p=$(( s - 1 ))
+    [[ $p == 0 ]] && p=3
+    local pstage=stage${p}
+
+    local parch="${arch}"
+    [[ "${arch}" == "i686" ]] && parch="x86"
+
+    local tarch="${arch}"
+    [[ "${arch}" == "amd64" ]] && tarch="x86_64"
+
+    cat stage-all.conf.template | \
       sed -e "s:\(^version_stamp.*$\):\1-${mydate}:" \
-        -e "s:MyCatalyst:$(pwd):" >  stage${s}-${arch}-uclibc-${flavor}.conf
+        -e "s:CSTAGE:${cstage}:g" \
+        -e "s:PSTAGE:${pstage}:g" \
+        -e "s:SARCH:${arch}:g" \
+        -e "s:PARCH:${parch}:g" \
+        -e "s:TARCH:${tarch}:g" \
+        -e "s:FLAVOR:${flavor}:g" \
+        -e "s:MYCATALYST:$(pwd):g" \
+        >  stage${s}-${arch}-uclibc-${flavor}.conf
   done
+
+  sed -i "/^chost/d" stage3-${arch}-uclibc-${flavor}.conf
 }
 
 banner() {
@@ -101,13 +123,13 @@ main() {
 
   undo_grsec
 
-  if [[ "x${pretend}" != "xtest" ]]; then
-     catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
-  else
-     >snapshot.log
-     >snapshot.err
-     echo "PRETEND: catalyst -s current > snapshot.log 2> snapshot.err"
-  fi
+#  if [[ "x${pretend}" != "xtest" ]]; then
+#     catalyst -s current | tee -a zzz.log >snapshot.log 2>snapshot.err
+#  else
+#     >snapshot.log
+#     >snapshot.err
+#     echo "PRETEND: catalyst -s current > snapshot.log 2> snapshot.err"
+#  fi
 
   for arch in amd64 i686; do
     for flavor in hardened vanilla; do
@@ -115,16 +137,16 @@ main() {
     done
   done
   
-  for arch in amd64 i686; do
-    for flavor in hardened vanilla; do
-      do_stages ${arch} ${flavor} ${pretend}
-      ret=$?
-      if [[ $? == 1 ]]; then
-         echo "FAILURE at ${arch} ${flavor} ${pretend} " | tee zzz.log
-         return 1
-      fi
-    done
-  done
+#  for arch in amd64 i686; do
+#    for flavor in hardened vanilla; do
+#      do_stages ${arch} ${flavor} ${pretend}
+#      ret=$?
+#      if [[ $? == 1 ]]; then
+#         echo "FAILURE at ${arch} ${flavor} ${pretend} " | tee zzz.log
+#         return 1
+#      fi
+#    done
+#  done
 
   if [[ "x${pretend}" == "xtest" ]]; then
     tree /var/tmp/catalyst/builds

diff --git a/tools-uclibc/stage-all.conf.template b/tools-uclibc/stage-all.conf.template
new file mode 100644
index 0000000..28bb2d8
--- /dev/null
+++ b/tools-uclibc/stage-all.conf.template
@@ -0,0 +1,9 @@
+subarch: SARCH
+target: CSTAGE
+version_stamp: uclibc-FLAVOR
+rel_type: FLAVOR/SARCH
+profile: hardened/linux/uclibc/PARCH
+snapshot: current
+source_subpath: FLAVOR/SARCH/PSTAGE-SARCH-uclibc-FLAVOR
+chost: TARCH-gentoo-linux-uclibc
+portage_confdir: MYCATALYST/portage.SARCH.FLAVOR

diff --git a/tools-uclibc/stage1-amd64-uclibc-hardened.conf.template b/tools-uclibc/stage1-amd64-uclibc-hardened.conf.template
deleted file mode 100644
index accca1e..0000000
--- a/tools-uclibc/stage1-amd64-uclibc-hardened.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: amd64
-target: stage1
-version_stamp: uclibc-hardened
-rel_type: hardened/amd64
-profile: hardened/linux/uclibc/amd64
-snapshot: current
-source_subpath: hardened/amd64/stage3-amd64-uclibc-hardened
-chost: x86_64-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.amd64.hardened

diff --git a/tools-uclibc/stage1-amd64-uclibc-vanilla.conf.template b/tools-uclibc/stage1-amd64-uclibc-vanilla.conf.template
deleted file mode 100644
index 4bfc2c7..0000000
--- a/tools-uclibc/stage1-amd64-uclibc-vanilla.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: amd64
-target: stage1
-version_stamp: uclibc-vanilla
-rel_type: vanilla/amd64
-profile: hardened/linux/uclibc/amd64
-snapshot: current
-source_subpath: vanilla/amd64/stage3-amd64-uclibc-vanilla
-chost: x86_64-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.amd64.vanilla

diff --git a/tools-uclibc/stage1-i686-uclibc-hardened.conf.template b/tools-uclibc/stage1-i686-uclibc-hardened.conf.template
deleted file mode 100644
index 97941d6..0000000
--- a/tools-uclibc/stage1-i686-uclibc-hardened.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: i686
-target: stage1
-version_stamp: uclibc-hardened
-rel_type: hardened/i686
-profile: hardened/linux/uclibc/x86
-snapshot: current
-source_subpath: hardened/i686/stage3-i686-uclibc-hardened
-chost: i686-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.i686.hardened

diff --git a/tools-uclibc/stage1-i686-uclibc-vanilla.conf.template b/tools-uclibc/stage1-i686-uclibc-vanilla.conf.template
deleted file mode 100644
index 4e60c07..0000000
--- a/tools-uclibc/stage1-i686-uclibc-vanilla.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: i686
-target: stage1
-version_stamp: uclibc-vanilla
-rel_type: vanilla/i686
-profile: hardened/linux/uclibc/x86
-snapshot: current
-source_subpath: vanilla/i686/stage3-i686-uclibc-vanilla
-chost: i686-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.i686.vanilla

diff --git a/tools-uclibc/stage2-amd64-uclibc-hardened.conf.template b/tools-uclibc/stage2-amd64-uclibc-hardened.conf.template
deleted file mode 100644
index 82b721f..0000000
--- a/tools-uclibc/stage2-amd64-uclibc-hardened.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: amd64
-target: stage2
-version_stamp: uclibc-hardened
-rel_type: hardened/amd64
-profile: hardened/linux/uclibc/amd64
-snapshot: current
-source_subpath: hardened/amd64/stage1-amd64-uclibc-hardened
-chost: x86_64-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.amd64.hardened

diff --git a/tools-uclibc/stage2-amd64-uclibc-vanilla.conf.template b/tools-uclibc/stage2-amd64-uclibc-vanilla.conf.template
deleted file mode 100644
index 71fb47a..0000000
--- a/tools-uclibc/stage2-amd64-uclibc-vanilla.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: amd64
-target: stage2
-version_stamp: uclibc-vanilla
-rel_type: vanilla/amd64
-profile: hardened/linux/uclibc/amd64
-snapshot: current
-source_subpath: vanilla/amd64/stage1-amd64-uclibc-vanilla
-chost: x86_64-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.amd64.vanilla

diff --git a/tools-uclibc/stage2-i686-uclibc-hardened.conf.template b/tools-uclibc/stage2-i686-uclibc-hardened.conf.template
deleted file mode 100644
index 59b9acb..0000000
--- a/tools-uclibc/stage2-i686-uclibc-hardened.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: i686
-target: stage2
-version_stamp: uclibc-hardened
-rel_type: hardened/i686
-profile: hardened/linux/uclibc/x86
-snapshot: current
-source_subpath: hardened/i686/stage1-i686-uclibc-hardened
-chost: i686-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.i686.hardened

diff --git a/tools-uclibc/stage2-i686-uclibc-vanilla.conf.template b/tools-uclibc/stage2-i686-uclibc-vanilla.conf.template
deleted file mode 100644
index 95d85f3..0000000
--- a/tools-uclibc/stage2-i686-uclibc-vanilla.conf.template
+++ /dev/null
@@ -1,9 +0,0 @@
-subarch: i686
-target: stage2
-version_stamp: uclibc-vanilla
-rel_type: vanilla/i686
-profile: hardened/linux/uclibc/x86
-snapshot: current
-source_subpath: vanilla/i686/stage1-i686-uclibc-vanilla
-chost: i686-gentoo-linux-uclibc
-portage_confdir: MyCatalyst/portage.i686.vanilla

diff --git a/tools-uclibc/stage3-amd64-uclibc-hardened.conf.template b/tools-uclibc/stage3-amd64-uclibc-hardened.conf.template
deleted file mode 100644
index 1cc923d..0000000
--- a/tools-uclibc/stage3-amd64-uclibc-hardened.conf.template
+++ /dev/null
@@ -1,8 +0,0 @@
-subarch: amd64
-target: stage3
-version_stamp: uclibc-hardened
-rel_type: hardened/amd64
-profile: hardened/linux/uclibc/amd64
-snapshot: current
-source_subpath: hardened/amd64/stage2-amd64-uclibc-hardened
-portage_confdir: MyCatalyst/portage.amd64.hardened

diff --git a/tools-uclibc/stage3-amd64-uclibc-vanilla.conf.template b/tools-uclibc/stage3-amd64-uclibc-vanilla.conf.template
deleted file mode 100644
index 4e3d602..0000000
--- a/tools-uclibc/stage3-amd64-uclibc-vanilla.conf.template
+++ /dev/null
@@ -1,8 +0,0 @@
-subarch: amd64
-target: stage3
-version_stamp: uclibc-vanilla
-rel_type: vanilla/amd64
-profile: hardened/linux/uclibc/amd64
-snapshot: current
-source_subpath: vanilla/amd64/stage2-amd64-uclibc-vanilla
-portage_confdir: MyCatalyst/portage.amd64.vanilla

diff --git a/tools-uclibc/stage3-i686-uclibc-hardened.conf.template b/tools-uclibc/stage3-i686-uclibc-hardened.conf.template
deleted file mode 100644
index 5915936..0000000
--- a/tools-uclibc/stage3-i686-uclibc-hardened.conf.template
+++ /dev/null
@@ -1,8 +0,0 @@
-subarch: i686
-target: stage3
-version_stamp: uclibc-hardened
-rel_type: hardened/i686
-profile: hardened/linux/uclibc/x86
-snapshot: current
-source_subpath: hardened/i686/stage2-i686-uclibc-hardened
-portage_confdir: MyCatalyst/portage.i686.hardened

diff --git a/tools-uclibc/stage3-i686-uclibc-vanilla.conf.template b/tools-uclibc/stage3-i686-uclibc-vanilla.conf.template
deleted file mode 100644
index c84c48f..0000000
--- a/tools-uclibc/stage3-i686-uclibc-vanilla.conf.template
+++ /dev/null
@@ -1,8 +0,0 @@
-subarch: i686
-target: stage3
-version_stamp: uclibc-vanilla
-rel_type: vanilla/i686
-profile: hardened/linux/uclibc/x86
-snapshot: current
-source_subpath: vanilla/i686/stage2-i686-uclibc-vanilla
-portage_confdir: MyCatalyst/portage.i686.vanilla


             reply	other threads:[~2013-05-09 21:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09 21:11 Anthony G. Basile [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-02 16:25 [gentoo-commits] proj/releng:master commit in: tools-uclibc/ Anthony G. Basile
2017-06-07 10:25 Anthony G. Basile
2014-08-18 21:59 Robin H. Johnson
2014-08-18 21:59 Robin H. Johnson
2014-08-17 12:16 Anthony G. Basile
2014-08-12 15:04 Anthony G. Basile
2014-06-12 15:50 Anthony G. Basile
2014-06-12 15:30 Anthony G. Basile
2013-07-15 21:25 Anthony G. Basile
2013-06-14 13:28 Anthony G. Basile
2013-05-09 21:41 Anthony G. Basile
2013-03-27 23:23 Anthony G. Basile
2013-03-10 14:57 Anthony G. Basile
2013-03-10 14:50 Anthony G. Basile
2013-02-03 14:46 Anthony G. Basile
2013-02-03 14:45 Anthony G. Basile
2012-12-31  9:59 Anthony G. Basile
2012-12-29  3:56 Anthony G. Basile
2012-12-28 18:08 Anthony G. Basile
2012-12-28 15:50 Anthony G. Basile
2012-11-15 20:33 Anthony G. Basile
2012-11-14 22:47 Anthony G. Basile
2012-11-01  2:41 Anthony G. Basile
2012-10-27 22:37 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368133848.57e35418478abc16845636fab6857767dc381f06.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox