[gentoo-catalyst] [PATCH] catalyst: generate .sha256 file if any digest is enabled

2021-11-04 Thread Georgy Yakovlev
checksum format is simple one, identical to one
sha256sum from coreutils produces, lines starting with # are ignored.

example:[1]

# SHA256 HASH
.  stage3-tar.xz

systemd upstream calls it suse-style .sha256 files.[0]
infra already supports inline signing of files.

Bug: https://bugs.gentoo.org/821568
[0] 
https://github.com/systemd/systemd/blob/aedec452b9e5dd197881f2164fb205dfe8bfdcec/src/import/pull-common.c#L236
[1] 
https://mirrors.edge.kernel.org/opensuse/distribution/leap/15.0/iso/openSUSE-Leap-15.0-DVD-x86_64.iso.sha256
Signed-off-by: Georgy Yakovlev 
---
 catalyst/base/genbase.py  | 3 +++
 doc/catalyst-config.5.txt | 7 ---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/catalyst/base/genbase.py b/catalyst/base/genbase.py
index 6d039a8f..1643b1dc 100644
--- a/catalyst/base/genbase.py
+++ b/catalyst/base/genbase.py
@@ -43,3 +43,6 @@ class GenBase():
 for f in [path, path + '.CONTENTS.gz']:
 for i in self.settings['digests']:
 file.write(self.generate_hash(f, name=i))
+
+with io.open(path + '.sha256', 'w', encoding='utf-8') as sha256file:
+sha256file.write(self.generate_hash(path, name='sha256'))
diff --git a/doc/catalyst-config.5.txt b/doc/catalyst-config.5.txt
index 003d40b6..ca9335d6 100644
--- a/doc/catalyst-config.5.txt
+++ b/doc/catalyst-config.5.txt
@@ -38,9 +38,10 @@ Basic configuration
 *digests*::
 Create a `.DIGESTS` file containing the hash output from any of the
 supported options below.  Adding them all may take a long time.
-(example: `md5 sha1 sha512 whirlpool`).  The set of supported hashes
-is dependent on the version of Python. To see the set of hashes
-supported by the version of Python in use, run
+(example: `md5 sha1 sha512 whirlpool`).  Enabling ANY digest will
+generate `.sha256` file in addition `.DIGESTS` file.  The set of
+supported hashes is dependent on the version of Python. To see the
+set of hashes supported by the version of Python in use, run
 +
 -
 $ python3 -c 'import hashlib; print(hashlib.algorithms_available)'
-- 
2.33.1




[gentoo-catalyst] [PATCH] targets/support/bootloader-setup.sh: add arm64 support

2021-07-25 Thread Georgy Yakovlev
Signed-off-by: Georgy Yakovlev 
---
 targets/support/bootloader-setup.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index ea18f736..4cfa61eb 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -87,7 +87,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
-   amd64|ia64|ppc*|powerpc*|sparc*|x86)
+   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
-- 
2.32.0




[gentoo-catalyst] [PATCH 2/2] targets/support/create-iso.sh: use app-cdr/cdrtools instead of virtual

2021-07-25 Thread Georgy Yakovlev
virtual no longer exist

Signed-off-by: Georgy Yakovlev 
---
 targets/support/create-iso.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 729f5c15..5269b77e 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -24,11 +24,11 @@ case ${clst_hostarch} in
#  xorriso from libisoburn
#  mkisofs from cdrtools
#  mformat from mtools
-   cdmakerpkg="sys-fs/mtools, dev-libs/libisoburn, 
sys-boot/grub:2, and virtual/cdrtools"
+   cdmakerpkg="sys-fs/mtools, dev-libs/libisoburn, 
sys-boot/grub:2, and app-cdr/cdrtools"
;;
*)
cdmaker="mkisofs"
-   cdmakerpkg="virtual/cdrtools"
+   cdmakerpkg="app-cdr/cdrtools"
;;
 esac
 
-- 
2.32.0




[gentoo-catalyst] [PATCH 1/2] targets/support/create-iso.sh: add arm64 support

2021-07-25 Thread Georgy Yakovlev
Signed-off-by: Georgy Yakovlev 
---
 targets/support/create-iso.sh | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 70684f78..729f5c15 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -18,7 +18,7 @@ case ${clst_hostarch} in
 cdmaker="grub-mkrescue"
 cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
 ;;
-   amd64|ia64|x86)
+   amd64|arm64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
@@ -52,6 +52,9 @@ then
arm)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
+   arm64)
+   clst_iso_volume_id="Gentoo Linux - 
ARM64"
+   ;;
hppa)
clst_iso_volume_id="Gentoo Linux - HPPA"
;;
@@ -188,7 +191,7 @@ case ${clst_hostarch} in
# o=output image (burnable to CD; readable by fdisk)
/usr/bin/sgibootcd c=${cfg} o=${clst_iso}
;;
-   amd64|ia64|ppc*|powerpc*|sparc*|x86)
+   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
isoroot_checksum
 
extra_opts=("-joliet")
-- 
2.32.0




[gentoo-catalyst] [PATCH] targets/support/create-iso.sh: use mkrescue on arm64

2021-07-24 Thread Georgy Yakovlev
Signed-off-by: Georgy Yakovlev 
---
 targets/support/create-iso.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 70684f78..88d9870f 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -18,7 +18,7 @@ case ${clst_hostarch} in
 cdmaker="grub-mkrescue"
 cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
 ;;
-   amd64|ia64|x86)
+   amd64|arm64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
-- 
2.32.0




[gentoo-catalyst] [PATCH 3/3] arch/ppc.toml: add power9 subarches

2020-10-20 Thread Georgy Yakovlev
Signed-off-by: Georgy Yakovlev 
---
 arch/ppc.toml | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/ppc.toml b/arch/ppc.toml
index 6f74789d..c8623cca 100644
--- a/arch/ppc.toml
+++ b/arch/ppc.toml
@@ -42,6 +42,16 @@ COMMON_FLAGS = "-O2 -pipe -mcpu=power8 -mtune=power8"
 CHOST = "powerpc64le-unknown-linux-gnu"
 USE = [ "altivec", "ibm",]
 
+[ppc64.power9]
+COMMON_FLAGS = "-O2 -pipe -mcpu=power9 -mtune=power9"
+CHOST = "powerpc64-unknown-linux-gnu"
+USE = [ "altivec", "ibm",]
+
+[ppc64.power9le]
+COMMON_FLAGS = "-O2 -pipe -mcpu=power9 -mtune=power9"
+CHOST = "powerpc64le-unknown-linux-gnu"
+USE = [ "altivec", "ibm",]
+
 [ppc64.ppc64]
 COMMON_FLAGS = "-O2 -pipe"
 CHOST = "powerpc64-unknown-linux-gnu"
-- 
2.29.0




[gentoo-catalyst] [PATCH 2/3] arch/ppc.toml: don't force -mabi=elfv2 on power subarches.

2020-10-20 Thread Georgy Yakovlev
-mabi=elfv2 is default on ppc64le in gcc/glibc toolchain for all
powerpc64le-*-linux-gnu CHOSTS, so we don't need to pass it.

forcing -mabi=elfv2 on ppc64(be) is quite risky, as it's not standard
configuration and not officialy supported by glibc at all.
according to glibc upstream it should be a separate ABI port.
Also many apps/tools assume elfv1 on big-endian, and while fixes are
being upstreamed, we've observed breakage in: openssl[asm], nodejs,
ffmpeg and  others.

If we want to ship elfv2 ppc64be stage,
we should define it as separate subarch and strictly put it in experimental.

to my knowledge those subarch definitions are not used by releng yet, so
we will not break anything.

Signed-off-by: Georgy Yakovlev 
---
 arch/ppc.toml | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/ppc.toml b/arch/ppc.toml
index 870c7647..6f74789d 100644
--- a/arch/ppc.toml
+++ b/arch/ppc.toml
@@ -23,22 +23,22 @@ CHOST = "powerpc64-unknown-linux-gnu"
 USE = [ "altivec", "ibm",]
 
 [ppc64.power7]
-COMMON_FLAGS = "-O2 -pipe -mcpu=power7 -mtune=power7 -mabi=elfv2"
+COMMON_FLAGS = "-O2 -pipe -mcpu=power7 -mtune=power7"
 CHOST = "powerpc64-unknown-linux-gnu"
 USE = [ "altivec", "ibm",]
 
 [ppc64.power7le]
-COMMON_FLAGS = "-O2 -pipe -mcpu=power7 -mtune=power7 -mabi=elfv2"
+COMMON_FLAGS = "-O2 -pipe -mcpu=power7 -mtune=power7"
 CHOST = "powerpc64le-unknown-linux-gnu"
 USE = [ "altivec", "ibm",]
 
 [ppc64.power8]
-COMMON_FLAGS = "-O2 -pipe -mcpu=power8 -mtune=power8 -mabi=elfv2"
+COMMON_FLAGS = "-O2 -pipe -mcpu=power8 -mtune=power8"
 CHOST = "powerpc64-unknown-linux-gnu"
 USE = [ "altivec", "ibm",]
 
 [ppc64.power8le]
-COMMON_FLAGS = "-O2 -pipe -mcpu=power8 -mtune=power8 -mabi=elfv2"
+COMMON_FLAGS = "-O2 -pipe -mcpu=power8 -mtune=power8"
 CHOST = "powerpc64le-unknown-linux-gnu"
 USE = [ "altivec", "ibm",]
 
-- 
2.29.0




[gentoo-catalyst] [PATCH 1/3] arch/ppc.toml: add CHOST based subarches

2020-10-20 Thread Georgy Yakovlev
if stage spec sets chost value, code in
catalyst/base/stagebase.py#L76 will derive subarch
value from the frontmost part of CHOST triple.

if such subarch is not defined in toml file, build will fail.

Add generic copy of base subarches defined in CHOST format.

Signed-off-by: Georgy Yakovlev 
---
 arch/ppc.toml | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/arch/ppc.toml b/arch/ppc.toml
index a3db919e..870c7647 100644
--- a/arch/ppc.toml
+++ b/arch/ppc.toml
@@ -46,10 +46,18 @@ USE = [ "altivec", "ibm",]
 COMMON_FLAGS = "-O2 -pipe"
 CHOST = "powerpc64-unknown-linux-gnu"
 
+[ppc64.powerpc64]
+COMMON_FLAGS = "-O2 -pipe"
+CHOST = "powerpc64-unknown-linux-gnu"
+
 [ppc64.ppc64le]
 COMMON_FLAGS = "-O2 -pipe"
 CHOST = "powerpc64le-unknown-linux-gnu"
 
+[ppc64.powerpc64le]
+COMMON_FLAGS = "-O2 -pipe"
+CHOST = "powerpc64le-unknown-linux-gnu"
+
 [ppc.g3]
 CHOST = "powerpc-unknown-linux-gnu"
 COMMON_FLAGS = "-O2 -mcpu=G3 -mtune=G3 -pipe"
@@ -68,3 +76,6 @@ USE = [ "altivec",]
 CHOST = "powerpc-unknown-linux-gnu"
 COMMON_FLAGS = "-O2 -mcpu=powerpc -mtune=powerpc -pipe"
 
+[ppc.powerpc]
+CHOST = "powerpc-unknown-linux-gnu"
+COMMON_FLAGS = "-O2 -mcpu=powerpc -mtune=powerpc -pipe"
-- 
2.29.0