diff --git a/tools-uclibc/run.sh b/tools-uclibc/run.sh index e45f7df2..a896e66d 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() { diff --git a/tools-uclibc/stage-all.conf.template b/tools-uclibc/stage-all.conf.template new file mode 100644 index 00000000..28bb2d80 --- /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 accca1ed..00000000 --- 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 4bfc2c74..00000000 --- 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 97941d64..00000000 --- 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 4e60c07d..00000000 --- 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 82b721f0..00000000 --- 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 71fb47ae..00000000 --- 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 59b9acb2..00000000 --- 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 95d85f3e..00000000 --- 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 1cc923d1..00000000 --- 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 4e3d6023..00000000 --- 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 59159364..00000000 --- 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 c84c48f0..00000000 --- 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