[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 0d3d82f639bb98457df670b6e12455f670887d0a
Author: Matt Turner  gentoo  org>
AuthorDate: Sun Nov 20 00:02:56 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Apr 10 19:48:49 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0d3d82f6

targets: Fix CHOST vs `uname -m` confusion

We've had difficulties keeping straight CHOST (e.g. "hppa") vs `uname
-m` output in the past, and I suspect I've made it worse over time.

Fix the issues I spotted, and add a catch-all for architectures we are
missing support for, so if ISO/netboot/etc creation doesn't silently
fail.

mattst88@bogsucker ~ $ uname -m
ppc64le
mattst88@bogsucker ~ $ linux32 uname -m
ppcle

mattst88@timberdoodle ~ $ uname -m
ppc64
mattst88@timberdoodle ~ $ linux32 uname -m
ppc

mattst88@guppy ~ $ uname -m
ia64

mattst88@catbus ~ $ uname -m
sparc64
mattst88@catbus ~ $ linux32 uname -m
sparc

mattst88@jiji ~ $ uname -m
aarch64
mattst88@jiji ~ $ linux32 uname -m
armv8l

mattst88@framework ~ % uname -m
x86_64
mattst88@framework ~ % linux32 uname -m
i686

mattst88@hake ~ $ uname -m
parisc

mattst88@lgentoo4 ~ $ uname -m
s390x
mattst88@lgentoo4 ~ $ linux32 uname -m
s390

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 13 +++--
 targets/support/create-iso.sh   | 36 +++-
 targets/support/netboot-final.sh|  8 ++--
 targets/support/pre-kmerge.sh   |  2 +-
 4 files changed, 33 insertions(+), 26 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index d6d5f96e..73854cb8 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -78,10 +78,7 @@ case ${clst_hostarch} in
((bctr=${bctr}+1))
done
;;
-   arm)
-   # NO SOFTLEVEL SUPPORT YET
-   ;;
-   hppa)
+   parisc)
# NO SOFTLEVEL SUPPORT YET
mkdir -p $1/boot
 
@@ -103,7 +100,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
-   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86|i?86)
+   aarch64*|ia64|ppc*|sparc*|i?86|x86_64)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
@@ -142,7 +139,7 @@ case ${clst_hostarch} in
done
memtest_grub $1 >> ${iacfg}
;;
-   mips)
+   mips*)
# NO SOFTLEVEL SUPPORT YET
 
# Mips is an interesting arch -- where most archs will
@@ -202,5 +199,9 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+   *)
+   echo "Boot loader support for ${clst_hostarch} is unimplemented"
+   exit 1
+   ;;
 esac
 exit $?

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 74c24a1d..7c644bae 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -10,15 +10,15 @@ case ${clst_hostarch} in
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
;;
-   mips)
+   mips*)
cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
-   ppc*|powerpc*|sparc*)
+   ppc*|sparc*)
cdmaker="grub-mkrescue"
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
;;
-   amd64|arm64|ia64|x86|i?86)
+   aarch64*|ia64|i?86|x86_64)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
@@ -49,28 +49,28 @@ then
amd64)
clst_iso_volume_id="Gentoo Linux - 
AMD64"
;;
-   arm)
+   arm*)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
-   arm64)
+   aarch64*)
clst_iso_volume_id="Gentoo Linux - 
ARM64"
;;
-   hppa)
-   clst_iso_volume_id="Gentoo Linux - HPPA"
-   ;;
ia64)
clst_iso_volume_id="Gentoo Linux - IA64"
;;
m68k)
clst_iso_volume_id="Gentoo Linux - M68K"
;;
-   mips)
+   mips*)
clst_iso_volume_

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: fd528f28ff1157ced65edb2e821cd16aa68c1802
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 18:48:27 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:37 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=fd528f28

livecdfs-update.sh: remove confusing "reduce tmpfs usage" hack

I don't believe this provides any real value now, and it makes the
livecd layout confusing.

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index ca8997f7..16e201d5 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -113,13 +113,6 @@ rm -f /etc/generic.motd.txt /etc/universal.motd.txt 
/etc/minimal.motd.txt /etc/l
 # Post configuration
 case ${clst_livecd_type} in
gentoo-release-live*)
-   # This is my hack to reduce tmpfs usage
-   mkdir -p /usr/livecd
-   cp -r ${clst_repo_basedir}/${clst_repo_name}/{profiles,eclass} 
/usr/livecd
-   rm -rf 
/usr/livecd/profiles/{co*,default-{1*,a*,b*,d*,h*,i*,m*,p*,s*,x*},g*,hardened-*,n*,x*}
-   mv -f /var/db /usr/livecd
-   ln -sf /usr/livecd/db /var/db
-
# Clear out lastlog
rm -f /var/log/lastlog && touch /var/log/lastlog
 



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: c21f53e42bf007ad074b0c6b23bfd85564832d46
Author: Ben Kohler  gentoo  org>
AuthorDate: Fri Mar 31 13:26:08 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:38 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=c21f53e4

remove obsolete root=/dev/ram0 init=/linuxrc from a few more places

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/bootloader-setup.sh | 8 
 targets/support/netboot-final.sh| 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index 32d86028..d6d5f96e 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -64,8 +64,8 @@ case ${clst_hostarch} in
for x in ${clst_boot_kernel}
do
echo -n "${bctr}:/boot/${x} " >> ${acfg}
-   echo -n "initrd=/boot/${x}.igz root=/dev/ram0 " >> 
${acfg}
-   echo "init=/linuxrc ${cmdline_opts[@]} cdroot" >> 
${acfg}
+   echo -n "initrd=/boot/${x}.igz " >> ${acfg}
+   echo "${cmdline_opts[@]} cdroot" >> ${acfg}
((bctr=${bctr}+1))
done
# Pass 2 is for serial
@@ -73,8 +73,8 @@ case ${clst_hostarch} in
for x in ${clst_boot_kernel}
do
echo -n "${bctr}:/boot/${x} " >> ${acfg}
-   echo -n "initrd=/boot/${x}.igz root=/dev/ram0 " >> 
${acfg}
-   echo "init=/linuxrc ${cmdline_opts[@]} cdroot" >> 
${acfg}
+   echo -n "initrd=/boot/${x}.igz " >> ${acfg}
+   echo "${cmdline_opts[@]} cdroot" >> ${acfg}
((bctr=${bctr}+1))
done
;;

diff --git a/targets/support/netboot-final.sh b/targets/support/netboot-final.sh
index 7a26e0f4..fc0de880 100755
--- a/targets/support/netboot-final.sh
+++ b/targets/support/netboot-final.sh
@@ -31,7 +31,7 @@ case ${clst_hostarch} in
-s ${clst_target_path}/${kname}-hppa.lif \
-f /dev/null \
-b /usr/share/palo/iplboot \
-   -c "0/vmlinux initrd=0/ramdisk root=/dev/ram0" \
+   -c "0/vmlinux initrd=0/ramdisk" \
|| exit 1
 
;;



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 1dfba7ee041d6b1e6a8a7af58f28728a8912a1ab
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 18:37:43 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:37 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1dfba7ee

livecdfs-update.sh: remove code obsoleted by sys-apps/hwids package

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 24 
 1 file changed, 24 deletions(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index 1be4baea..a2ac26c8 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -101,30 +101,6 @@ alias ll='ls -l'
 alias grep='grep --color=auto'
 EOF
 
-# Make sure we have the latest pci,usb and hotplug ids.  Older versions of
-# pciutils and usbutils used /sbin, where newer versions use /usr/sbin.
-[ -x /sbin/update-pciids ] && /sbin/update-pciids
-[ -x /sbin/update-usbids ] && /sbin/update-usbids
-[ -x /usr/sbin/update-pciids ] && /usr/sbin/update-pciids
-[ -x /usr/sbin/update-usbids ] && /usr/sbin/update-usbids
-if [ -d /usr/share/hwdata ]
-then
-   # If we have uncompressed pci and usb ids files, symlink them.
-   [ -f /usr/share/misc/pci.ids ] && [ -f /usr/share/hwdata/pci.ids ] && \
-   rm -f /usr/share/hwdata/pci.ids && ln -s 
/usr/share/misc/pci.ids \
-   /usr/share/hwdata/pci.ids
-   [ -f /usr/share/misc/usb.ids ] && [ -f /usr/share/hwdata/usb.ids ] && \
-   rm -f /usr/share/hwdata/usb.ids && ln -s 
/usr/share/misc/usb.ids \
-   /usr/share/hwdata/usb.ids
-   # If we have compressed pci and usb files, we download our own copies.
-   [ -f /usr/share/misc/pci.ids.gz ] && [ -f /usr/share/hwdata/pci.ids ] 
&& \
-   rm -f /usr/share/hwdata/pci.ids && wget -O 
/usr/share/hwdata/pci.ids \
-   http://pciids.sourceforge.net/v2.2/pci.ids
-   [ -f /usr/share/misc/usb.ids.gz ] && [ -f /usr/share/hwdata/usb.ids ] 
&& \
-   rm -f /usr/share/hwdata/usb.ids && wget -O 
/usr/share/hwdata/usb.ids \
-   http://www.linux-usb.org/usb.ids
-fi
-
 # Tweak the MOTD for Gentoo releases
 case ${clst_livecd_type} in
gentoo-release-universal)



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: f478e8f34af1a45c706f18a34df7f3efa208d581
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 20:01:32 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:38 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f478e8f3

bootloader-setup.sh: remove obsolete cmdline args

These haven't been needed since kernel 2.4 days, as far as I know.

Signed-off-by: Ben Kohler  gentoo.org>

 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 065f2bb5..32d86028 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -53,7 +53,7 @@ memtest_grub() {
   fi
 }
 
-default_append_line=(root=/dev/ram0 init=/linuxrc ${cmdline_opts[@]} cdroot)
+default_append_line=(${cmdline_opts[@]} cdroot)
 
 case ${clst_hostarch} in
alpha)



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 1c67748297c23157c693cfee5f869a0deb9f6802
Author: Ben Kohler  gentoo  org>
AuthorDate: Mon Jan  2 20:22:02 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Jan  2 20:22:02 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1c677482

targets/support/livecdfs-update.sh: set hostname= rather than HOSTNAME=

Apparently the use of HOSTNAME in /etc/conf.d/hostname has been
deprecated in favor of hostname for a while.  Support for that was
completely removed recently.

https://github.com/OpenRC/openrc/commit/d2b31440708bd0cb70e5317e05b8ae80e4866269

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index 251a6887..dafe4c3a 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -17,7 +17,7 @@ rm -rf /etc/localtime
 cp /usr/share/zoneinfo/UTC /etc/localtime
 
 # Setup the hostname
-echo 'HOSTNAME="livecd"' > /etc/conf.d/hostname
+echo 'hostname="livecd"' > /etc/conf.d/hostname
 echo "127.0.0.1 livecd.gentoo livecd localhost" > /etc/hosts
 
 # Since we're an official Gentoo release, we do things the official Gentoo way.



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 79ee199b34761ca2e2204ed687d7b245552d8cf6
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 19:11:28 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:38 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=79ee199b

livecdfs-update: remove old evms code

Mostly obsoleted by LVM almost 20 years ago

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 5 -
 1 file changed, 5 deletions(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index d4548020..05714c52 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -147,9 +147,4 @@ case ${clst_livecd_type} in
;;
 esac
 
-if [ -e /lib/rcscripts/addons/udev-start.sh ]
-then
-   sed -i "s:\t\[\[ -x /sbin/evms_activate:\t\[\[ -x \${CDBOOT} \]\] \&\& 
\[\[ -x /sbin/evms_activate:" /lib/rcscripts/addons/udev-start.sh
-fi
-
 env-update



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 0c26863c06762bb954d283849777dcde1dc0f616
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 18:54:21 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:37 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0c26863c

livecdfs-update.sh: replace local handbook with wiki handbook

Code to look for a local html handbook is obsolete.  Link to the wiki
handbook instead, and install the entry unconditionally for gentoo
targets.

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 32 +---
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index 16e201d5..bf19ccf5 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -112,28 +112,22 @@ rm -f /etc/generic.motd.txt /etc/universal.motd.txt 
/etc/minimal.motd.txt /etc/l
 
 # Post configuration
 case ${clst_livecd_type} in
-   gentoo-release-live*)
+   gentoo-release-*)
# Clear out lastlog
rm -f /var/log/lastlog && touch /var/log/lastlog
 
-   create_handbook_icon() {
-   cat <<-EOF > 
/usr/share/applications/gentoo-handbook.desktop
-   [Desktop Entry]
-   Encoding=UTF-8
-   Version=1.0
-   Type=Link
-   
URL=file:///mnt/cdrom/docs/handbook/html/index.html
-   Terminal=false
-   Name=Gentoo Linux Handbook
-   GenericName=Gentoo Linux Handbook
-   Comment=This is a link to the local copy of the 
Gentoo Linux Handbook.
-   Icon=text-editor
-   EOF
-   }
-
-   # Create our Handbook icon
-   [ -e /docs/handbook/index.html ] && create_handbook_icon
-   [ -n "${clst_livecd_overlay}" ] && [ -e 
${clst_livecd_overlay}/docs/handbook/index.html ] && create_handbook_icon
+   cat <<-EOF > /usr/share/applications/gentoo-handbook.desktop
+   [Desktop Entry]
+   Encoding=UTF-8
+   Version=1.0
+   Type=Link
+   URL=https://wiki.gentoo.org/wiki/Handbook:Main_Page
+   Terminal=false
+   Name=Gentoo Linux Handbook
+   GenericName=Gentoo Linux Handbook
+   Comment=This is a link to Gentoo Linux Handbook.
+   Icon=text-editor
+   EOF
 
# Copy our icons into place and build home directories
if [ -n "${clst_livecd_users}" ]



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 0a8ca2598868cce8f3289a5f517e4d6f10234d9f
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 18:39:46 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:37 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0a8ca259

livecdfs-update.sh: remove old devfsd code

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index a2ac26c8..9e0fd6cc 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -88,9 +88,6 @@ cat < ${clst_make_conf}
 EOF
 cat ${clst_make_conf}.old >> ${clst_make_conf}
 
-# devfs tweaks
-[ -e /etc/devfsd.conf ] && sed -i '/dev-state/ s:^:#:' /etc/devfsd.conf
-
 # Add some helpful aliases
 cat <> /etc/profile
 alias cp='cp -i'



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: f351f8e56ce00c8c36646b2ade13c4f2c9b96751
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 18:40:38 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:37 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f351f8e5

livecdfs-update.sh: remove net.eth[1234] symlinks

I don't think these are providing any value to anyone, since interfaces
don't get eth* names by default and very few livecd users will be using
netifrc anyway.

Signed-off-by: Ben Kohler  gentoo.org>

 targets/support/livecdfs-update.sh | 6 --
 1 file changed, 6 deletions(-)

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index 9e0fd6cc..ca8997f7 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -60,12 +60,6 @@ then
sed -i '/NOPASSWD: ALL/ s/^# //' /etc/sudoers
 fi
 
-# Setup links for ethernet devices
-cd /etc/init.d
-for i in {1..4}; do
-   ln -sf net.lo net.eth${i}
-done
-
 # Add this for hwsetup/mkx86config
 mkdir -p /etc/sysconfig
 



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, livecd/files/

2023-05-11 Thread Matt Turner
commit: b66d5721d6da0bb14d5106e634e1544c53242bd9
Author: Ben Kohler  gentoo  org>
AuthorDate: Wed Mar 29 18:33:52 2023 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Mar 31 13:27:37 2023 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b66d5721

reorganize motd files

Having all 3 livecd targets inherit generic.motd.txt AND
minimal.motd.txt was causing some duplication of messages.  Now all 3
targets inherit generic and their own single motd file.

Signed-off-by: Ben Kohler  gentoo.org>

 livecd/files/livecd.motd.txt   |  8 +++-
 livecd/files/minimal.motd.txt  |  2 +-
 livecd/files/universal.motd.txt| 12 ++--
 targets/support/livecdfs-update.sh |  6 ++
 4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/livecd/files/livecd.motd.txt b/livecd/files/livecd.motd.txt
index a37f53cb..029c2f6e 100644
--- a/livecd/files/livecd.motd.txt
+++ b/livecd/files/livecd.motd.txt
@@ -1,5 +1,11 @@
+The latest version of the Handbook is always available from the Gentoo web
+site by typing "links https://wiki.gentoo.org/wiki/Handbook";.
+
+To start an ssh server on this system, type "/etc/init.d/sshd start".  If you
+need to log in remotely as root, type "passwd root" to reset root's password
+to a known value.
+
 Please report any bugs you find to https://bugs.gentoo.org. Be sure to include
 detailed information about how to reproduce the bug you are reporting.
 
 Thank you for using Gentoo Linux!
-

diff --git a/livecd/files/minimal.motd.txt b/livecd/files/minimal.motd.txt
index 3058b854..029c2f6e 100644
--- a/livecd/files/minimal.motd.txt
+++ b/livecd/files/minimal.motd.txt
@@ -7,5 +7,5 @@ to a known value.
 
 Please report any bugs you find to https://bugs.gentoo.org. Be sure to include
 detailed information about how to reproduce the bug you are reporting.
-Thank you for using Gentoo Linux!
 
+Thank you for using Gentoo Linux!

diff --git a/livecd/files/universal.motd.txt b/livecd/files/universal.motd.txt
index 403b8729..416d59d8 100644
--- a/livecd/files/universal.motd.txt
+++ b/livecd/files/universal.motd.txt
@@ -1,5 +1,13 @@
+The latest version of the Handbook is always available from the Gentoo web
+site by typing "links https://wiki.gentoo.org/wiki/Handbook";.
 
 Stage tarball(s), distfiles and packages can be found in /mnt/cdrom/.
 
-You can view the networkless installation instructions for this release by
-typing "links /mnt/cdrom/docs/handbook/html".
+To start an ssh server on this system, type "/etc/init.d/sshd start".  If you
+need to log in remotely as root, type "passwd root" to reset root's password
+to a known value.
+
+Please report any bugs you find to https://bugs.gentoo.org. Be sure to include
+detailed information about how to reproduce the bug you are reporting.
+
+Thank you for using Gentoo Linux!

diff --git a/targets/support/livecdfs-update.sh 
b/targets/support/livecdfs-update.sh
index dafe4c3a..1be4baea 100755
--- a/targets/support/livecdfs-update.sh
+++ b/targets/support/livecdfs-update.sh
@@ -128,8 +128,7 @@ fi
 # Tweak the MOTD for Gentoo releases
 case ${clst_livecd_type} in
gentoo-release-universal)
-   cat /etc/generic.motd.txt /etc/universal.motd.txt \
-   /etc/minimal.motd.txt > /etc/motd
+   cat /etc/generic.motd.txt /etc/universal.motd.txt > /etc/motd
sed -i 's:^##GREETING:Welcome to the Gentoo Linux Universal 
Installation CD!:' /etc/motd
;;
gentoo-release-minimal)
@@ -137,8 +136,7 @@ case ${clst_livecd_type} in
sed -i 's:^##GREETING:Welcome to the Gentoo Linux Minimal 
Installation CD!:' /etc/motd
;;
gentoo-release-live*)
-   cat /etc/generic.motd.txt \
-   /etc/minimal.motd.txt /etc/livecd.motd.txt > /etc/motd
+   cat /etc/generic.motd.txt /etc/livecd.motd.txt > /etc/motd
sed -i -e 's:^##GREETING:Welcome to the Gentoo Linux LiveCD!:' 
/etc/motd
;;
 esac



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 33eedbd166f355069a4c8ac958f78fdc01c3a6d0
Author: Andreas K. Hüttel  gentoo  org>
AuthorDate: Tue Dec 27 11:20:40 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Tue Dec 27 11:20:40 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=33eedbd1

More i?86 fixes for x86

Signed-off-by: Andreas K. Hüttel  gentoo.org>

 targets/support/bootloader-setup.sh | 2 +-
 targets/support/create-iso.sh   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 8a603944..74c24a1d 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -191,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|arm64|ia64|ppc*|powerpc*|sparc*|x86)
+   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86|i?86)
isoroot_checksum
 
extra_opts=("-joliet" "-iso-level" "3")



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2023-05-11 Thread Matt Turner
commit: 567981dca789e70eaf53b5bc5240750da56fe04a
Author: Andreas K. Hüttel  gentoo  org>
AuthorDate: Mon Dec 26 23:02:28 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Dec 26 23:02:28 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=567981dc

Run grub-mkrescue also for i?86 subarches

Signed-off-by: Andreas K. Hüttel  gentoo.org>

 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 8eada6a7..8a603944 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|arm64|ia64|x86)
+   amd64|arm64|ia64|x86|i?86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-28 Thread Matt Turner
commit: 5d853732df20b4d41985231a5bbd510709470066
Author: Matt Turner  gentoo  org>
AuthorDate: Sun Nov 20 00:02:56 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Tue Nov 22 21:19:03 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5d853732

targets: Fix CHOST vs `uname -m` confusion

We've had difficulties keeping straight CHOST (e.g. "hppa") vs `uname
-m` output in the past, and I suspect I've made it worse over time.

Fix the issues I spotted, and add a catch-all for architectures we are
missing support for, so if ISO/netboot/etc creation doesn't silently
fail.

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 13 +++--
 targets/support/create-iso.sh   | 30 --
 targets/support/netboot-final.sh|  8 ++--
 targets/support/pre-kmerge.sh   |  2 +-
 4 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index 08d25b59..6ca3e38a 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -56,10 +56,7 @@ case ${clst_hostarch} in
((bctr=${bctr}+1))
done
;;
-   arm)
-   # NO SOFTLEVEL SUPPORT YET
-   ;;
-   hppa)
+   hppa*)
# NO SOFTLEVEL SUPPORT YET
mkdir -p $1/boot
 
@@ -81,7 +78,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
-   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
+   aarch64*|amd64|ia64|ppc*|powerpc*|sparc*|x86)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
@@ -119,7 +116,7 @@ case ${clst_hostarch} in
echo "" >> ${iacfg}
done
;;
-   mips)
+   mips*)
# NO SOFTLEVEL SUPPORT YET
 
# Mips is an interesting arch -- where most archs will
@@ -179,5 +176,9 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+   *)
+   echo "Boot loader support for ${clst_hostarch} is unimplemented"
+   exit 1
+   ;;
 esac
 exit $?

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 8eada6a7..8412f6fb 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -10,7 +10,7 @@ case ${clst_hostarch} in
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
;;
-   mips)
+   mips*)
cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
@@ -18,7 +18,7 @@ case ${clst_hostarch} in
cdmaker="grub-mkrescue"
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
;;
-   amd64|arm64|ia64|x86)
+   aarch64*|amd64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
@@ -49,28 +49,28 @@ then
amd64)
clst_iso_volume_id="Gentoo Linux - 
AMD64"
;;
-   arm)
+   arm*)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
-   arm64)
+   aarch64*)
clst_iso_volume_id="Gentoo Linux - 
ARM64"
;;
-   hppa)
-   clst_iso_volume_id="Gentoo Linux - HPPA"
-   ;;
ia64)
clst_iso_volume_id="Gentoo Linux - IA64"
;;
m68k)
clst_iso_volume_id="Gentoo Linux - M68K"
;;
-   mips)
+   mips*)
clst_iso_volume_id="Gentoo Linux - MIPS"
;;
+   hppa*)
+   clst_iso_volume_id="Gentoo Linux - HPPA"
+   ;;
ppc*|powerpc*)
clst_iso_volume_id="Gentoo Linux - 
PowerPC"
;;
-   s390)
+   s390*)
clst_iso_volume_id="Gentoo Linux - S390"
;;

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-21 Thread Matt Turner
commit: 26f1a66a46f8d170f267696805ed904dfbbcae91
Author: Matt Turner  gentoo  org>
AuthorDate: Sun Nov 20 00:02:56 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Tue Nov 22 03:48:34 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=26f1a66a

targets: Fix CHOST vs `uname -m` confusion

We've had difficulties keeping straight CHOST (e.g. "hppa") vs `uname
-m` output in the past, and I suspect I've made it worse over time.

Fix the issues I spotted, and add a catch-all for architectures we are
missing support for, so if ISO/netboot/etc creation doesn't silently
fail.

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 13 +++--
 targets/support/create-iso.sh   | 30 --
 targets/support/netboot-final.sh|  8 ++--
 targets/support/pre-kmerge.sh   |  2 +-
 4 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index 08d25b59..6ca3e38a 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -56,10 +56,7 @@ case ${clst_hostarch} in
((bctr=${bctr}+1))
done
;;
-   arm)
-   # NO SOFTLEVEL SUPPORT YET
-   ;;
-   hppa)
+   hppa*)
# NO SOFTLEVEL SUPPORT YET
mkdir -p $1/boot
 
@@ -81,7 +78,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
-   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
+   aarch64*|amd64|ia64|ppc*|powerpc*|sparc*|x86)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
@@ -119,7 +116,7 @@ case ${clst_hostarch} in
echo "" >> ${iacfg}
done
;;
-   mips)
+   mips*)
# NO SOFTLEVEL SUPPORT YET
 
# Mips is an interesting arch -- where most archs will
@@ -179,5 +176,9 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+   *)
+   echo "Boot loader support for ${clst_hostarch} is unimplemented"
+   exit 1
+   ;;
 esac
 exit $?

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 8eada6a7..8412f6fb 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -10,7 +10,7 @@ case ${clst_hostarch} in
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
;;
-   mips)
+   mips*)
cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
@@ -18,7 +18,7 @@ case ${clst_hostarch} in
cdmaker="grub-mkrescue"
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
;;
-   amd64|arm64|ia64|x86)
+   aarch64*|amd64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
@@ -49,28 +49,28 @@ then
amd64)
clst_iso_volume_id="Gentoo Linux - 
AMD64"
;;
-   arm)
+   arm*)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
-   arm64)
+   aarch64*)
clst_iso_volume_id="Gentoo Linux - 
ARM64"
;;
-   hppa)
-   clst_iso_volume_id="Gentoo Linux - HPPA"
-   ;;
ia64)
clst_iso_volume_id="Gentoo Linux - IA64"
;;
m68k)
clst_iso_volume_id="Gentoo Linux - M68K"
;;
-   mips)
+   mips*)
clst_iso_volume_id="Gentoo Linux - MIPS"
;;
+   hppa*)
+   clst_iso_volume_id="Gentoo Linux - HPPA"
+   ;;
ppc*|powerpc*)
clst_iso_volume_id="Gentoo Linux - 
PowerPC"
;;
-   s390)
+   s390*)
clst_iso_volume_id="Gentoo Linux - S390"
;;

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-21 Thread Matt Turner
commit: 46c9ad4cfca84d7020b6be9098581ce31d559b55
Author: Sam James  gentoo  org>
AuthorDate: Mon Nov 21 07:37:00 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Tue Nov 22 03:49:24 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=46c9ad4c

targets/support/pre-kmerge.sh: fix comparison operator

'<' and '>' work lexicographically in bash.

Signed-off-by: Sam James  gentoo.org>
Signed-off-by: Matt Turner  gentoo.org>

 targets/support/pre-kmerge.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/targets/support/pre-kmerge.sh b/targets/support/pre-kmerge.sh
index 4a14fe8d..6f05082e 100755
--- a/targets/support/pre-kmerge.sh
+++ b/targets/support/pre-kmerge.sh
@@ -18,8 +18,8 @@ if [[ ${clst_hostarch} == hppa* ]]; then
;;
esac
done
-   [[ $num32 > 1 ]] && die "Only one 32-bit kernel can be configured"
-   [[ $num64 > 1 ]] && die "Only one 64-bit kernel can be configured"
+   [[ $num32 -gt 1 ]] && die "Only one 32-bit kernel can be configured"
+   [[ $num64 -gt 1 ]] && die "Only one 64-bit kernel can be configured"
 fi
 
 run_merge --oneshot sys-kernel/genkernel



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-19 Thread Matt Turner
commit: 4524aa8d8861b6526caa347a5ee5b46884c6098a
Author: Matt Turner  gentoo  org>
AuthorDate: Sun Nov 20 00:02:56 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Sun Nov 20 01:43:21 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=4524aa8d

targets: Fix KEYWORDS vs `uname -m` confusion

We've had difficulties keeping straight KEYWORDS (e.g. "hppa") vs `uname
-m` output in the past, and I suspect I've made it worse over time.

Fix the issues I spotted, and add a catch-all for architectures we are
missing support for, so if ISO/netboot/etc creation doesn't silently
fail.

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 13 +++--
 targets/support/create-iso.sh   | 30 --
 targets/support/netboot-final.sh|  8 ++--
 targets/support/pre-kmerge.sh   |  2 +-
 4 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index 08d25b59..6ca3e38a 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -56,10 +56,7 @@ case ${clst_hostarch} in
((bctr=${bctr}+1))
done
;;
-   arm)
-   # NO SOFTLEVEL SUPPORT YET
-   ;;
-   hppa)
+   hppa*)
# NO SOFTLEVEL SUPPORT YET
mkdir -p $1/boot
 
@@ -81,7 +78,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
-   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
+   aarch64*|amd64|ia64|ppc*|powerpc*|sparc*|x86)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
@@ -119,7 +116,7 @@ case ${clst_hostarch} in
echo "" >> ${iacfg}
done
;;
-   mips)
+   mips*)
# NO SOFTLEVEL SUPPORT YET
 
# Mips is an interesting arch -- where most archs will
@@ -179,5 +176,9 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+   *)
+   echo "Boot loader support for ${clst_hostarch} is unimplemented"
+   exit 1
+   ;;
 esac
 exit $?

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 8eada6a7..8412f6fb 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -10,7 +10,7 @@ case ${clst_hostarch} in
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
;;
-   mips)
+   mips*)
cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
@@ -18,7 +18,7 @@ case ${clst_hostarch} in
cdmaker="grub-mkrescue"
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
;;
-   amd64|arm64|ia64|x86)
+   aarch64*|amd64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
@@ -49,28 +49,28 @@ then
amd64)
clst_iso_volume_id="Gentoo Linux - 
AMD64"
;;
-   arm)
+   arm*)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
-   arm64)
+   aarch64*)
clst_iso_volume_id="Gentoo Linux - 
ARM64"
;;
-   hppa)
-   clst_iso_volume_id="Gentoo Linux - HPPA"
-   ;;
ia64)
clst_iso_volume_id="Gentoo Linux - IA64"
;;
m68k)
clst_iso_volume_id="Gentoo Linux - M68K"
;;
-   mips)
+   mips*)
clst_iso_volume_id="Gentoo Linux - MIPS"
;;
+   hppa*)
+   clst_iso_volume_id="Gentoo Linux - HPPA"
+   ;;
ppc*|powerpc*)
clst_iso_volume_id="Gentoo Linux - 
PowerPC"
;;
-   s390)
+   s390*)
clst_iso_volume_id="Gentoo Linux - S390"
;;
  

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-19 Thread Matt Turner
commit: 2d85dcc908a49d5d271c518ba34d637c536e926a
Author: Matt Turner  gentoo  org>
AuthorDate: Sat Nov 19 23:52:19 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Sat Nov 19 23:52:19 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2d85dcc9

targets: Fix some indentation

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/create-iso.sh | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 9991b930..8eada6a7 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -11,13 +11,13 @@ case ${clst_hostarch} in
cdmakerpkg="dev-libs/libisoburn"
;;
mips)
-   cdmaker="sgibootcd"
+   cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
-ppc*|powerpc*|sparc*)
-cdmaker="grub-mkrescue"
-cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
-;;
+   ppc*|powerpc*|sparc*)
+   cdmaker="grub-mkrescue"
+   cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
+   ;;
amd64|arm64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-19 Thread Matt Turner
commit: a9fecdaed3d67ec1cc4dcb9e7bb5ee471850e399
Author: Matt Turner  gentoo  org>
AuthorDate: Sun Nov 20 00:02:56 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Sun Nov 20 00:20:45 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=a9fecdae

targets: Fix KEYWORDS vs `uname -m` confusion

We've had difficulties keeping straight KEYWORDS (e.g. "hppa") vs `uname
-m" output in the past, and I suspect I've made it worse over time.

Fix the issues I spotted, and add a catch-all for architectures we are
missing support for, so if ISO/netboot/etc creation doesn't silently
fail.

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 13 +++--
 targets/support/create-iso.sh   | 30 --
 targets/support/netboot-final.sh|  8 ++--
 targets/support/pre-kmerge.sh   |  2 +-
 4 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index 08d25b59..8cc367f8 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -56,10 +56,7 @@ case ${clst_hostarch} in
((bctr=${bctr}+1))
done
;;
-   arm)
-   # NO SOFTLEVEL SUPPORT YET
-   ;;
-   hppa)
+   parisc*)
# NO SOFTLEVEL SUPPORT YET
mkdir -p $1/boot
 
@@ -81,7 +78,7 @@ case ${clst_hostarch} in
echo "--recoverykernel=boot/${x}" >> ${icfg}
done
;;
-   amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
+   aarch64*|amd64|ia64|ppc*|powerpc*|sparc*|x86)
kern_subdir=/boot
iacfg=$1/boot/grub/grub.cfg
mkdir -p $1/boot/grub
@@ -119,7 +116,7 @@ case ${clst_hostarch} in
echo "" >> ${iacfg}
done
;;
-   mips)
+   mips*)
# NO SOFTLEVEL SUPPORT YET
 
# Mips is an interesting arch -- where most archs will
@@ -179,5 +176,9 @@ case ${clst_hostarch} in
[ -e "${1}/sash64" ] && mv ${1}/sash64 ${scratch}/arcload
[ -e "${1}/arc.cf" ] && mv ${1}/arc.cf ${scratch}/arcload
;;
+   *)
+   echo "Boot loader support for ${clst_hostarch} is unimplemented"
+   exit 1
+   ;;
 esac
 exit $?

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 8eada6a7..f8f605f6 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -10,7 +10,7 @@ case ${clst_hostarch} in
cdmaker="xorriso"
cdmakerpkg="dev-libs/libisoburn"
;;
-   mips)
+   mips*)
cdmaker="sgibootcd"
cdmakerpkg="sys-boot/sgibootcd"
;;
@@ -18,7 +18,7 @@ case ${clst_hostarch} in
cdmaker="grub-mkrescue"
cdmakerpkg="dev-libs/libisoburn and sys-boot/grub:2"
;;
-   amd64|arm64|ia64|x86)
+   aarch64*|amd64|ia64|x86)
cdmaker="grub-mkrescue"
# grub-mkrescue requires:
#  xorriso from libisoburn
@@ -49,28 +49,28 @@ then
amd64)
clst_iso_volume_id="Gentoo Linux - 
AMD64"
;;
-   arm)
+   arm*)
clst_iso_volume_id="Gentoo Linux - ARM"
;;
-   arm64)
+   aarch64*)
clst_iso_volume_id="Gentoo Linux - 
ARM64"
;;
-   hppa)
-   clst_iso_volume_id="Gentoo Linux - HPPA"
-   ;;
ia64)
clst_iso_volume_id="Gentoo Linux - IA64"
;;
m68k)
clst_iso_volume_id="Gentoo Linux - M68K"
;;
-   mips)
+   mips*)
clst_iso_volume_id="Gentoo Linux - MIPS"
;;
+   parisc*)
+   clst_iso_volume_id="Gentoo Linux - HPPA"
+   ;;
ppc*|powerpc*)
clst_iso_volume_id="Gentoo Linux - 
PowerPC"
;;
-   s390)
+   s390*)
clst_iso_volume_id="Gentoo Linux - S390"
;;
  

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-11-19 Thread Matt Turner
commit: 05b1f53a03e6e4ca9373cbd280c4e22ed234ac4f
Author: Daniel Cordero  0xdc  io>
AuthorDate: Tue Apr 19 17:40:15 2022 +
Commit: Matt Turner  gentoo  org>
CommitDate: Wed Apr 20 23:24:10 2022 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=05b1f53a

create-iso.sh: split iso-level arguments

When enclosed in quotes and expanded with "${variable[@]}", the word is expanded
to be a single argument, rather than two separate arguments.

i.e. argv[2] = "-iso-level 3"
instead of
  argv[2] = "-iso-level"
  argv[3] = "3"

This lead to the failure:
  xorriso : FAILURE : -as mkisofs: Unrecognized option '-iso-level 3'
  xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE'
  grub-mkrescue: error: `xorriso` invocation failed

Fixes: 0b56dbe4 ("livecd: Use ISO level 3")
Signed-off-by: Matt Turner  gentoo.org>

 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 45ef1696..9991b930 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -194,7 +194,7 @@ case ${clst_hostarch} in
amd64|arm64|ia64|ppc*|powerpc*|sparc*|x86)
isoroot_checksum
 
-   extra_opts=("-joliet" "-iso-level 3")
+   extra_opts=("-joliet" "-iso-level" "3")
case ${clst_hostarch} in
sparc*) extra_opts+=("--sparc-boot") ;;
esac



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-01-30 Thread Matt Turner
commit: 436daf985ada2e38d255cd57aad4bcd460adb30f
Author: Georgy Yakovlev  gentoo  org>
AuthorDate: Sun Jul 25 23:51:13 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Thu Jul 29 00:36:43 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=436daf98

targets: Use app-cdr/cdrtools instead of virtual

virtual no longer exists as of gentoo.git commit 45233a05d40
("virtual/cdrtools: Remove").

Signed-off-by: Georgy Yakovlev  gentoo.org>
Signed-off-by: Matt Turner  gentoo.org>

 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 838962fe..9ff227a9 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
 



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-01-30 Thread Matt Turner
commit: 6976c5fe167b7949c8a33edace8cd93fd87e8dcd
Author: Matt Turner  gentoo  org>
AuthorDate: Thu Jul 29 01:07:33 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Thu Jul 29 01:07:33 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=6976c5fe

targets: Remove dead custom_kopts variable

It looks like this has been dead since 2005.

Closes: https://bugs.gentoo.org/804591
Fixes: 1fcca247 ("Removed these as they are moved to the appropriate target 
directories")
Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/targets/support/bootloader-setup.sh 
b/targets/support/bootloader-setup.sh
index 4cfa61eb..a998a420 100755
--- a/targets/support/bootloader-setup.sh
+++ b/targets/support/bootloader-setup.sh
@@ -31,7 +31,7 @@ case ${clst_fstype} in
 esac
 
 
-default_append_line=(root=/dev/ram0 init=/linuxrc ${cmdline_opts[@]} 
${custom_kopts} cdroot)
+default_append_line=(root=/dev/ram0 init=/linuxrc ${cmdline_opts[@]} cdroot)
 
 case ${clst_hostarch} in
alpha)
@@ -99,7 +99,6 @@ case ${clst_hostarch} in
for x in ${clst_boot_kernel}
do
eval "kernel_console=\$clst_boot_kernel_${x}_console"
-   eval custom_kopts=\$${x}_kernelopts
 
echo "menuentry 'Boot LiveCD (kernel: ${x})' --class 
gnu-linux --class os {"  >> ${iacfg}
echo "  linux ${kern_subdir}/${x} 
${default_append_line[@]}" >> ${iacfg}



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-01-30 Thread Matt Turner
commit: e0b9b007b563188cca5f5317f780bb5d4bbb17d1
Author: Georgy Yakovlev  gentoo  org>
AuthorDate: Sun Jul 25 23:51:12 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Thu Jul 29 00:36:42 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=e0b9b007

targets: Add arm64 livecd support

Closes: https://bugs.gentoo.org/785769
Signed-off-by: Georgy Yakovlev  gentoo.org>
Signed-off-by: Matt Turner  gentoo.org>

 targets/support/bootloader-setup.sh | 2 +-
 targets/support/create-iso.sh   | 7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

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

diff --git a/targets/support/create-iso.sh b/targets/support/create-iso.sh
index 9b2cbb60..838962fe 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")



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2022-01-30 Thread Matt Turner
commit: 7183c82189dcfdaf514ce54f3e688fe1d05c4402
Author: Nic Boet  boet  cc>
AuthorDate: Mon Jul 19 03:00:55 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Jul 19 03:03:10 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=7183c821

targets: Pass gk_callback_opts as a string instead of array

Fixes: e5855bef ("targets: Use arrays rather than string concatenation")
Signed-off-by: Nic Boet  boet.cc>
Signed-off-by: Matt Turner  gentoo.org>

 targets/support/kmerge.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
index fb67aba6..20b471f1 100755
--- a/targets/support/kmerge.sh
+++ b/targets/support/kmerge.sh
@@ -60,7 +60,8 @@ genkernel_compile() {
fi
 
if [[ -n ${kernel_merge} ]]; then
-   genkernel --callback="emerge ${gk_callback_opts[@]} 
${kernel_merge}" \
+   gk_callback=${gk_callback_opts[@]}
+   genkernel --callback="emerge ${gk_callback} ${kernel_merge}" \
"${GK_ARGS[@]}" || exit 1
else
genkernel "${GK_ARGS[@]}" || exit 1



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2021-06-09 Thread Matt Turner
commit: 42332a642def9a8d454246da68955172442e7aa5
Author: Daniel Cordero  0xdc  io>
AuthorDate: Thu Feb  4 11:07:21 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Sun Feb 21 02:05:44 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=42332a64

targets: Use the correct distcc libdir

Since distcc-3.3 (and bug 651030) distcc symlinks have been installed to
/usr/lib/distcc/bin/ regardless of get_libdir.

Signed-off-by: Daniel Cordero  0xdc.io>
Signed-off-by: Matt Turner  gentoo.org>

 targets/support/chroot-functions.sh | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 88465c31..d8472d46 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -83,11 +83,10 @@ setup_features() {
# This sets up automatic cross-distcc-fu according to
# https://wiki.gentoo.org/wiki/Distcc/Cross-Compiling
CHOST=$(portageq envvar CHOST)
-   LIBDIR=$(get_libdir)
-   cd /usr/${LIBDIR}/distcc/bin
+   cd /usr/lib/distcc/bin
rm cc gcc g++ c++ 2>/dev/null
-   echo -e '#!/bin/bash\nexec 
/usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
-   chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
+   echo -e '#!/bin/bash\nexec 
/usr/lib/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
+   chmod a+x /usr/lib/distcc/bin/${CHOST}-wrapper
for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
fi
 
@@ -171,13 +170,12 @@ setup_gcc(){
 }
 
 cleanup_distcc() {
-   LIBDIR=$(get_libdir)
-   rm -rf /etc/distcc/hosts
+   rm -f /etc/distcc/hosts
for i in cc gcc c++ g++; do
-   rm -f /usr/${LIBDIR}/distcc/bin/${i}
-   ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
+   rm -f /usr/lib/distcc/bin/${i}
+   ln -s /usr/bin/distcc /usr/lib/distcc/bin/${i}
done
-   rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
+   rm -f /usr/lib/distcc/bin/*-wrapper
 }
 
 cleanup_icecream() {



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/

2021-01-18 Thread Matt Turner
commit: 580c065a40682c4597ddd4bbb79c25b67c58ead6
Author: Matt Turner  gentoo  org>
AuthorDate: Mon Jan 18 03:09:30 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Jan 18 19:37:55 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=580c065a

catalyst: Call config_profile_link for all targets

This reverts the following two commits, which have no documented
rationale.

Revert "Set the profile by calling eselect."

This reverts commit 90c03f9dc255ba89849e46490f9ead7ab3921950.

Revert "Drop config_profile_link from the action_sequence for the generic 
stage."

This reverts commit 3bd10159bf7cfe14b6d8a8218b94eca73be4c997.

Doing so improves the code in two ways:

   1) it makes prepare_sequence identical across all targets, which will
  allow deduplicating some code
   2) it no longer calls eselect profile each time chroot-functions.sh
  is sourced (even for those targets that were still calling
  config_profile_link)

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/base/stagebase.py  | 3 ++-
 targets/support/chroot-functions.sh | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 447e073d..53b0a224 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -500,6 +500,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 """Set basic stage1, 2, 3 action sequences"""
 self.prepare_sequence.extend([
 self.unpack,
+self.config_profile_link,
 self.setup_confdir,
 self.portage_overlay,
 ])
@@ -771,7 +772,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 log.info('Configuring profile link...')
 make_profile = Path(self.settings['chroot_path'] + 
self.settings['port_conf'],
 'make.profile')
-make_profile.unlink()
+make_profile.unlink(missing_ok=True)
 make_profile.symlink_to(Path('../..' + self.settings['repo_basedir'],
  self.settings['repo_name'],
  'profiles',

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 2aec018e..88465c31 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -1,8 +1,5 @@
 #!/bin/bash
 
-# Set the profile
-eselect profile set ${clst_target_profile}
-
 # Trap these signals and kill ourselves if received
 # Force ourselves to die if any of these signals are received
 # most likely our controlling terminal is gone



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, doc/, catalyst/targets/, targets/stage1/

2021-01-18 Thread Matt Turner
commit: 3c8d88942ea97251cea512a11c3ef436b1e5ab0f
Author: Matt Turner  gentoo  org>
AuthorDate: Sat Jan 16 16:28:59 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Jan 18 17:08:05 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3c8d8894

catalyst: Remove update_seed

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/targets/stage1.py  |  2 --
 doc/catalyst-spec.5.txt | 10 --
 targets/stage1/chroot.sh| 34 --
 targets/support/chroot-functions.sh |  2 +-
 4 files changed, 9 insertions(+), 39 deletions(-)

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index 5a154e76..f7c723ee 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -16,8 +16,6 @@ class stage1(StageBase):
 required_values = frozenset()
 valid_values = required_values | frozenset([
 "chost",
-"update_seed",
-"update_seed_command",
 ])
 
 def __init__(self, spec, addlargs):

diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
index 4c1df857..47a62709 100644
--- a/doc/catalyst-spec.5.txt
+++ b/doc/catalyst-spec.5.txt
@@ -116,16 +116,6 @@ releases, we use a default README.txt, and this will be 
used on your
 CD if you do not provide one yourself.  We do not use this for the
 official releases.  This setting is supported by the livecd targets.
 
-*update_seed*::
-This is an optional setting supported by stage1 to tell catalyst if
-it should update the seed stage or not (valid values: `yes no`).
-
-*update_seed_command*::
-This is an optional command to pass to emerge for updating the seed
-stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
-If not specified, catalyst will update gcc deps.
-This setting requires enabling update_seed.
-
 Compilation
 ~~~
 

diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index f5002d75..e6ace213 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -24,32 +24,14 @@ BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)"
 
 FEATURES="${FEATURES} nodoc noman noinfo"
 
-# We need to ensure the base stage3 has USE="bindist"
-# if BINDIST is set to avoid issues with openssl / openssh
-[ -e ${clst_make_conf} ] && echo "USE=\"${BINDIST} ${USE}\"" >> 
${clst_make_conf}
-
-# Update stage3
-if [ -n "${clst_update_seed}" ]; then
-   if [ "${clst_update_seed}" == "yes" ]; then
-   echo "Updating seed stage..."
-   if [ -n "${clst_update_seed_command}" ]; then
-   ROOT=/ run_merge --buildpkg=n 
"${clst_update_seed_command}"
-   else
-   ROOT=/ run_merge --buildpkg=n 
--ignore-built-slot-operator-deps y @changed-subslot
-   fi
-   elif [ "${clst_update_seed}" != "no" ]; then
-   echo "Invalid setting for update_seed: ${clst_update_seed}"
-   exit 1
-   fi
-
-   # reset emerge options for the target
-   clst_update_seed=no setup_emerge_opts
-else
-   echo "Skipping seed stage update..."
-fi
-
-# Clear USE
-[ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" 
${clst_make_conf}
+# Update seed stage
+echo "Updating seed stage"
+(
+   # Don't build or use binpkgs
+   clst_PKGCACHE= setup_emerge_opts
+
+   ROOT=/ run_merge --buildpkg n --ignore-built-slot-operator-deps y 
@changed-subslot
+)
 
 export ROOT="${clst_root_path}"
 mkdir -p "$ROOT"

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 88465c31..94d7c938 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -136,7 +136,7 @@ setup_emerge_opts() {
emerge_opts+=(--load-average "${clst_load_average}")
fi
 
-   if [ -n "${clst_PKGCACHE}" ] && [ -z "${clst_update_seed}" -o 
"${clst_update_seed}" = "no" ]
+   if [ -n "${clst_PKGCACHE}" ]
then
emerge_opts+=(--usepkg --buildpkg --binpkg-respect-use=y 
--newuse)
bootstrap_opts+=(-r)



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/targets/, doc/, targets/stage1/

2021-01-18 Thread Matt Turner
commit: 47f945bd873501a5cdc104f6b269244d8cc2d8a0
Author: Matt Turner  gentoo  org>
AuthorDate: Sat Jan 16 16:28:59 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Jan 18 16:55:29 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=47f945bd

catalyst: Remove update_seed

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/targets/stage1.py  |  2 --
 doc/catalyst-spec.5.txt | 10 --
 targets/stage1/chroot.sh| 34 --
 targets/support/chroot-functions.sh |  2 +-
 4 files changed, 9 insertions(+), 39 deletions(-)

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index 5a154e76..f7c723ee 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -16,8 +16,6 @@ class stage1(StageBase):
 required_values = frozenset()
 valid_values = required_values | frozenset([
 "chost",
-"update_seed",
-"update_seed_command",
 ])
 
 def __init__(self, spec, addlargs):

diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
index 4c1df857..47a62709 100644
--- a/doc/catalyst-spec.5.txt
+++ b/doc/catalyst-spec.5.txt
@@ -116,16 +116,6 @@ releases, we use a default README.txt, and this will be 
used on your
 CD if you do not provide one yourself.  We do not use this for the
 official releases.  This setting is supported by the livecd targets.
 
-*update_seed*::
-This is an optional setting supported by stage1 to tell catalyst if
-it should update the seed stage or not (valid values: `yes no`).
-
-*update_seed_command*::
-This is an optional command to pass to emerge for updating the seed
-stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
-If not specified, catalyst will update gcc deps.
-This setting requires enabling update_seed.
-
 Compilation
 ~~~
 

diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index f5002d75..e6ace213 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -24,32 +24,14 @@ BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)"
 
 FEATURES="${FEATURES} nodoc noman noinfo"
 
-# We need to ensure the base stage3 has USE="bindist"
-# if BINDIST is set to avoid issues with openssl / openssh
-[ -e ${clst_make_conf} ] && echo "USE=\"${BINDIST} ${USE}\"" >> 
${clst_make_conf}
-
-# Update stage3
-if [ -n "${clst_update_seed}" ]; then
-   if [ "${clst_update_seed}" == "yes" ]; then
-   echo "Updating seed stage..."
-   if [ -n "${clst_update_seed_command}" ]; then
-   ROOT=/ run_merge --buildpkg=n 
"${clst_update_seed_command}"
-   else
-   ROOT=/ run_merge --buildpkg=n 
--ignore-built-slot-operator-deps y @changed-subslot
-   fi
-   elif [ "${clst_update_seed}" != "no" ]; then
-   echo "Invalid setting for update_seed: ${clst_update_seed}"
-   exit 1
-   fi
-
-   # reset emerge options for the target
-   clst_update_seed=no setup_emerge_opts
-else
-   echo "Skipping seed stage update..."
-fi
-
-# Clear USE
-[ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" 
${clst_make_conf}
+# Update seed stage
+echo "Updating seed stage"
+(
+   # Don't build or use binpkgs
+   clst_PKGCACHE= setup_emerge_opts
+
+   ROOT=/ run_merge --buildpkg n --ignore-built-slot-operator-deps y 
@changed-subslot
+)
 
 export ROOT="${clst_root_path}"
 mkdir -p "$ROOT"

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 88465c31..94d7c938 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -136,7 +136,7 @@ setup_emerge_opts() {
emerge_opts+=(--load-average "${clst_load_average}")
fi
 
-   if [ -n "${clst_PKGCACHE}" ] && [ -z "${clst_update_seed}" -o 
"${clst_update_seed}" = "no" ]
+   if [ -n "${clst_PKGCACHE}" ]
then
emerge_opts+=(--usepkg --buildpkg --binpkg-respect-use=y 
--newuse)
bootstrap_opts+=(-r)



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, doc/, catalyst/targets/, targets/stage1/

2021-01-17 Thread Matt Turner
commit: 5ae9e8dc9beb04587a92e9ffdb4b5f2073dca17a
Author: Matt Turner  gentoo  org>
AuthorDate: Sat Jan 16 16:28:59 2021 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Jan 18 03:49:48 2021 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5ae9e8dc

catalyst: Remove update_seed

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/targets/stage1.py  |  2 --
 doc/catalyst-spec.5.txt | 10 --
 targets/stage1/chroot.sh| 34 --
 targets/support/chroot-functions.sh |  2 +-
 4 files changed, 9 insertions(+), 39 deletions(-)

diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
index 5a154e76..f7c723ee 100644
--- a/catalyst/targets/stage1.py
+++ b/catalyst/targets/stage1.py
@@ -16,8 +16,6 @@ class stage1(StageBase):
 required_values = frozenset()
 valid_values = required_values | frozenset([
 "chost",
-"update_seed",
-"update_seed_command",
 ])
 
 def __init__(self, spec, addlargs):

diff --git a/doc/catalyst-spec.5.txt b/doc/catalyst-spec.5.txt
index 4c1df857..47a62709 100644
--- a/doc/catalyst-spec.5.txt
+++ b/doc/catalyst-spec.5.txt
@@ -116,16 +116,6 @@ releases, we use a default README.txt, and this will be 
used on your
 CD if you do not provide one yourself.  We do not use this for the
 official releases.  This setting is supported by the livecd targets.
 
-*update_seed*::
-This is an optional setting supported by stage1 to tell catalyst if
-it should update the seed stage or not (valid values: `yes no`).
-
-*update_seed_command*::
-This is an optional command to pass to emerge for updating the seed
-stage (example: `--update dev-libs/mpfr dev-libs/mpc dev-libs/gmp`)
-If not specified, catalyst will update gcc deps.
-This setting requires enabling update_seed.
-
 Compilation
 ~~~
 

diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index f5002d75..e6ace213 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -24,32 +24,14 @@ BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)"
 
 FEATURES="${FEATURES} nodoc noman noinfo"
 
-# We need to ensure the base stage3 has USE="bindist"
-# if BINDIST is set to avoid issues with openssl / openssh
-[ -e ${clst_make_conf} ] && echo "USE=\"${BINDIST} ${USE}\"" >> 
${clst_make_conf}
-
-# Update stage3
-if [ -n "${clst_update_seed}" ]; then
-   if [ "${clst_update_seed}" == "yes" ]; then
-   echo "Updating seed stage..."
-   if [ -n "${clst_update_seed_command}" ]; then
-   ROOT=/ run_merge --buildpkg=n 
"${clst_update_seed_command}"
-   else
-   ROOT=/ run_merge --buildpkg=n 
--ignore-built-slot-operator-deps y @changed-subslot
-   fi
-   elif [ "${clst_update_seed}" != "no" ]; then
-   echo "Invalid setting for update_seed: ${clst_update_seed}"
-   exit 1
-   fi
-
-   # reset emerge options for the target
-   clst_update_seed=no setup_emerge_opts
-else
-   echo "Skipping seed stage update..."
-fi
-
-# Clear USE
-[ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" 
${clst_make_conf}
+# Update seed stage
+echo "Updating seed stage"
+(
+   # Don't build or use binpkgs
+   clst_PKGCACHE= setup_emerge_opts
+
+   ROOT=/ run_merge --buildpkg n --ignore-built-slot-operator-deps y 
@changed-subslot
+)
 
 export ROOT="${clst_root_path}"
 mkdir -p "$ROOT"

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 88465c31..94d7c938 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -136,7 +136,7 @@ setup_emerge_opts() {
emerge_opts+=(--load-average "${clst_load_average}")
fi
 
-   if [ -n "${clst_PKGCACHE}" ] && [ -z "${clst_update_seed}" -o 
"${clst_update_seed}" = "no" ]
+   if [ -n "${clst_PKGCACHE}" ]
then
emerge_opts+=(--usepkg --buildpkg --binpkg-respect-use=y 
--newuse)
bootstrap_opts+=(-r)



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, targets/netboot/, targets/stage1/, targets/embedded/

2020-12-19 Thread Matt Turner
commit: 9abe4ca574e11fe2c3810bac44789143399798a7
Author: Matt Turner  gentoo  org>
AuthorDate: Sat Dec 19 00:22:09 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Sat Dec 19 19:25:14 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9abe4ca5

targets: Remove make_destpath() function

It just read clst_root_path, exported it as ROOT, and ensured that a
directory existed at $ROOT. Setting and resetting clst_* variables adds
a lot of confusion, so just use ROOT directly.

Signed-off-by: Matt Turner  gentoo.org>

 targets/embedded/chroot.sh  | 15 ++-
 targets/netboot/controller.sh   |  2 +-
 targets/netboot/pkg.sh  |  2 +-
 targets/stage1/chroot.sh| 12 +++-
 targets/stage1/controller.sh|  4 ++--
 targets/support/chroot-functions.sh | 32 ++--
 6 files changed, 23 insertions(+), 44 deletions(-)

diff --git a/targets/embedded/chroot.sh b/targets/embedded/chroot.sh
index 2fbba278..11068388 100755
--- a/targets/embedded/chroot.sh
+++ b/targets/embedded/chroot.sh
@@ -2,14 +2,11 @@
 
 source /tmp/chroot-functions.sh
 
-# Setup the environment
-export DESTROOT="${clst_root_path}"
-export clst_root_path="/"
+echo "Installing dependencies..."
+ROOT=/ run_merge -o "${clst_embedded_packages}"
 
-echo "Installing dependencies into ${DESTROOT}..."
-run_merge -o "${clst_embedded_packages}"
+export ROOT="${clst_root_path}"
+mkdir -p "$ROOT"
 
-export clst_root_path="${DESTROOT}"
-export INSTALL_MASK="${clst_install_mask}"
-
-run_merge -1 -O "${clst_embedded_packages}"
+INSTALL_MASK="${clst_install_mask}" \
+   run_merge -1 -O "${clst_embedded_packages}"

diff --git a/targets/netboot/controller.sh b/targets/netboot/controller.sh
index 9a6e14d2..cc946c2c 100755
--- a/targets/netboot/controller.sh
+++ b/targets/netboot/controller.sh
@@ -6,7 +6,7 @@ case ${1} in
build_packages)
echo ">>> Building packages ..."
shift
-   clst_root_path="/" \
+   ROOT="/" \
clst_packages="$*" \
exec_in_chroot \
${clst_shdir}/${clst_target}/pkg.sh

diff --git a/targets/netboot/pkg.sh b/targets/netboot/pkg.sh
index 2ec27062..2ad9491c 100755
--- a/targets/netboot/pkg.sh
+++ b/targets/netboot/pkg.sh
@@ -10,4 +10,4 @@ show_debug
 
 # START BUILD
 
-run_merge ${clst_packages}
+ROOT="$ROOT" run_merge ${clst_packages}

diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh
index 33d5c3c9..b733fc57 100755
--- a/targets/stage1/chroot.sh
+++ b/targets/stage1/chroot.sh
@@ -33,9 +33,9 @@ if [ -n "${clst_update_seed}" ]; then
if [ "${clst_update_seed}" == "yes" ]; then
echo "Updating seed stage..."
if [ -n "${clst_update_seed_command}" ]; then
-   clst_root_path=/ run_merge --buildpkg=n 
"${clst_update_seed_command}"
+   ROOT=/ run_merge --buildpkg=n 
"${clst_update_seed_command}"
else
-   clst_root_path=/ run_merge --update --deep --newuse 
--complete-graph --rebuild-if-new-ver gcc
+   ROOT=/ run_merge --update --deep --newuse 
--complete-graph --rebuild-if-new-ver gcc
fi
elif [ "${clst_update_seed}" != "no" ]; then
echo "Invalid setting for update_seed: ${clst_update_seed}"
@@ -50,7 +50,9 @@ fi
 
 # Clear USE
 [ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" 
${clst_make_conf}
-make_destpath "${clst_root_path}"
+
+export ROOT="${clst_root_path}"
+mkdir -p "$ROOT"
 
 ## START BUILD
 # First, we drop in a known-good baselayout
@@ -59,7 +61,7 @@ run_merge --oneshot --nodeps sys-apps/baselayout
 sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf}
 
 echo "$locales" > /etc/locale.gen
-for etc in /etc "${clst_root_path}"/etc; do
+for etc in /etc "$ROOT"/etc; do
echo "LANG=C.UTF8" > ${etc}/env.d/02locale
 done
 update_env_settings
@@ -84,7 +86,7 @@ run_merge --oneshot "${buildpkgs[@]}"
 # not run locale-gen when ROOT is set. Since we've set LANG, we need to run
 # locale-gen explicitly.
 if [ -x "$(command -v locale-gen)" ]; then
-   locale-gen --destdir "${clst_root_path}"/ || die "locale-gen failed"
+   locale-gen --destdir "$ROOT"/ || die "locale-gen failed"
 fi
 
 # Why are we removing these? Don't we need them for final make.conf?

diff --git a/targets/stage1/controller.sh b/targets/stage1/controller.sh
index f9dd4b9b..ab127114 100755
--- a/targets/stage1/controller.sh
+++ b/targets/stage1/controller.sh
@@ -10,8 +10,8 @@ case "$1" in
cp "${clst_shdir}/stage1/build.py" "${clst_chroot_path}/tmp"
 
# Setup "ROOT in chroot" dir
-   install -d "${clst_chroot_path}/${clst_root_path}/etc"
-   install -d 
"${clst_chroot_path}/${clst_root_path}${clst_port_conf}"
+   install -d "${clst_stage_path}/etc"
+   install -d "${cl

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2020-12-19 Thread Matt Turner
commit: ee1fb86d76f47a38e0c3991f897b4c1896637557
Author: Matt Turner  gentoo  org>
AuthorDate: Sat Dec 19 00:04:23 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Sat Dec 19 02:56:52 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ee1fb86d

targets: Remove EBEEP_IGNORE / EPAUSE_IGNORE

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/chroot-functions.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index 89a313f7..d125756f 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -260,8 +260,6 @@ run_merge() {
 
export EMERGE_WARNING_DELAY=0
export CLEAN_DELAY=0
-   export EBEEP_IGNORE=0
-   export EPAUSE_IGNORE=0
[[ $CONFIG_PROTECT != "-*"* ]] && export CONFIG_PROTECT="-*"
 
if [ -n "${clst_VERBOSE}" ]



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2020-12-19 Thread Matt Turner
commit: eb5509b929cf162ecb1bea35f7aa4e3d150edf6d
Author: Matt Turner  gentoo  org>
AuthorDate: Mon Nov  2 16:47:56 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Mon Nov  2 16:56:08 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=eb5509b9

targets: Expand extra_opts into separate words

I introduced this mistaken when reworking the patch referenced below.

Fixes: 7e1ea3ac ("Build ISO with Joliet directory information")
Signed-off-by: Matt Turner  gentoo.org>

 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 a5d5194e..70684f78 100755
--- a/targets/support/create-iso.sh
+++ b/targets/support/create-iso.sh
@@ -197,7 +197,7 @@ case ${clst_hostarch} in
esac
 
echo ">> Running grub-mkrescue to create iso image"
-   grub-mkrescue "${extra_opts[*]}" -o "${1}" "${clst_target_path}"
+   grub-mkrescue "${extra_opts[@]}" -o "${1}" "${clst_target_path}"
;;
 esac
 exit  $?



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/

2020-12-19 Thread Matt Turner
commit: f7fe02da2825122eb6347e569170e34515f112e3
Author: Matt Turner  gentoo  org>
AuthorDate: Thu Oct 22 18:19:09 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Fri Oct 30 22:40:52 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f7fe02da

catalyst: Remove kill_support_pids()

mount_namespaces(7) says

A mount ceases to be a member of a peer group when either the
mount is explicitly unmounted, or when the mount is implicitly
unmounted because a mount namespace is removed (because it has
no more member processes).

Now that the build sequence is executed in its own mount namespace, the
mounts are implicitly unmounted when the last process in the namespace
dies, meaning we don't need to try any funny business around cleaning up
processes in order to unmount.

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/base/stagebase.py  | 30 +++---
 targets/support/kill-chroot-pids.sh | 62 -
 2 files changed, 4 insertions(+), 88 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index caec5935..bd5ba8d0 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -638,17 +638,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
 assert self.settings[verify] == "blake2"
 self.settings.setdefault("gk_mainargs", []).append("--b2sum")
 
-def kill_chroot_pids(self):
-log.info('Checking for processes running in chroot and killing them.')
-
-# Force environment variables to be exported so script can see them
-self.setup_environment()
-
-killcmd = normpath(self.settings["sharedir"] +
-   self.settings["shdir"] + 
"/support/kill-chroot-pids.sh")
-if os.path.exists(killcmd):
-cmd([killcmd], env=self.env)
-
 def mount_safety_check(self):
 """
 Check and verify that none of our paths in mypath are mounted. We don't
@@ -920,18 +909,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
 try:
 cxt = libmount.Context(target=str(target))
 cxt.umount()
-except OSError:
-log.warning('First attempt to unmount failed: %s', target)
-log.warning('Killing any pids still running in the chroot')
-
-self.kill_chroot_pids()
-
-try:
-cxt.umount()
-except OSError as e:
-umount_failed = True
-log.warning("Couldn't umount: %s, %s", target,
-e.strerror)
+except OSError as e:
+log.warning("Couldn't umount: %s, %s", target,
+e.strerror)
+umount_failed = True
 
 if umount_failed:
 # if any bind mounts really failed, then we need to raise
@@ -1382,9 +1363,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
 def run(self):
 self.chroot_lock.write_lock()
 
-# Kill any pids in the chroot
-self.kill_chroot_pids()
-
 # Check for mounts right away and abort if we cannot unmount them
 self.mount_safety_check()
 

diff --git a/targets/support/kill-chroot-pids.sh 
b/targets/support/kill-chroot-pids.sh
deleted file mode 100755
index ea8ee402..
--- a/targets/support/kill-chroot-pids.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-# Script to kill processes found running in the chroot.
-
-if [ "${clst_chroot_path}" == "/" ]
-then
-   echo "Aborting  clst_chroot_path is set to /"
-   echo "This is very dangerous"
-   exit 1
-fi
-
-if [ "${clst_chroot_path}" == "" ]
-then
-   echo "Aborting  clst_chroot_path is NOT set"
-   echo "This is very dangerous"
-   exit 1
-fi
-
-j=0
-declare -a pids
-# Get files and dirs in /proc
-for i in `ls /proc`
-do
-   # Test for directories
-   if [ -d /proc/$i ]
-   then
-   # Search for exe containing string inside ${clst_chroot_path}
-   ls -la --color=never /proc/$i 2>&1 |grep exe|grep ${clst_chroot_path} > 
/dev/null
-
-   # If found
-   if [ $? == 0 ]
-   then
-   # Assign the pid into the pids array
-   pids[$j]=$i
-   j=$(($j+1))
-   fi
-   fi
-done
-
-if [ ${j} -gt 0 ]
-then
-   echo
-   echo "Killing process(es)"
-   echo "pid: process name"
-   for pid in ${pids[@]}
-   do
-   P_NAME=$(ls -la --color=never /proc/${pid} 2>&1 |grep exe|grep 
${clst_chroot_path}|awk '{print $11}')
-   echo ${pid}: ${P_NAME}
-   done
-   echo
-   echo "Press Ctrl-C within 10 seconds to abort"
-
-   sleep 10
-
-   for pid in ${pids[@]}
-   do
-   kill -9 ${pid}
-   done
-
-   # Small sleep here to give the process(es) a chance to die before 
running unbind again.
-   sleep 5

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/

2020-05-26 Thread Matt Turner
commit: d11d5eb2cf32fc09c323871c2ca6fcb6b468f822
Author: Matt Turner  gentoo  org>
AuthorDate: Thu May 21 22:37:29 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Wed May 27 06:22:51 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d11d5eb2

catalyst: Clean up unbind() function

Does a couple of things:
- drops log.notice -> log.warning
- Removes the kill_chroot_pids support code since 
  namespaces?

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/base/stagebase.py  | 45 +++
 targets/support/kill-chroot-pids.sh | 62 -
 2 files changed, 12 insertions(+), 95 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index aa5cafd0..d92f3ffb 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -625,17 +625,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
 assert self.settings[verify] == "blake2"
 self.settings.setdefault("gk_mainargs", []).append("--b2sum")
 
-def kill_chroot_pids(self):
-log.info('Checking for processes running in chroot and killing them.')
-
-# Force environment variables to be exported so script can see them
-self.setup_environment()
-
-killcmd = normpath(self.settings["sharedir"] +
-   self.settings["shdir"] + 
"/support/kill-chroot-pids.sh")
-if os.path.exists(killcmd):
-cmd([killcmd], env=self.env)
-
 def mount_safety_check(self):
 """
 Check and verify that none of our paths in mypath are mounted. We don't
@@ -886,35 +875,28 @@ class StageBase(TargetBase, ClearBase, GenBase):
 raise CatalystError
 
 def unbind(self):
-ouch = 0
-mypath = self.settings["chroot_path"]
+chroot_path = self.settings["chroot_path"]
+umount_failed = False
 
 # Unmount in reverse order
-for x in [x for x in reversed(self.mount) if self.mount[x]['enable']]:
-target = normpath(mypath + self.mount[x]['target'])
-if not os.path.exists(target):
-log.notice('%s does not exist. Skipping', target)
+for target in [Path(chroot_path + self.mount[x]['target'])
+   for x in reversed(self.mount)
+   if self.mount[x]['enable']]:
+if not target.exists():
+log.debug('%s does not exist. Skipping', target)
 continue
 
 if not ismount(target):
-log.notice('%s is not a mount point. Skipping', target)
+log.debug('%s is not a mount point. Skipping', target)
 continue
 
 try:
 umount(target)
-except CatalystError:
-log.warning('First attempt to unmount failed: %s', target)
-log.warning('Killing any pids still running in the chroot')
-
-self.kill_chroot_pids()
-
-try:
-umount(target)
-except CatalystError:
-ouch = 1
-log.warning("Couldn't umount bind mount: %s", target)
+except OSError as e:
+log.warning("Couldn't umount bind mount: %s", target)
+umount_failed = True
 
-if ouch:
+if umount_failed:
 # if any bind mounts really failed, then we need to raise
 # this to potentially prevent an upcoming bash stage cleanup script
 # from wiping our bind mounts.
@@ -1307,9 +1289,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
 def run(self):
 self.chroot_lock.write_lock()
 
-# Kill any pids in the chroot
-self.kill_chroot_pids()
-
 # Check for mounts right away and abort if we cannot unmount them
 self.mount_safety_check()
 

diff --git a/targets/support/kill-chroot-pids.sh 
b/targets/support/kill-chroot-pids.sh
deleted file mode 100755
index ea8ee402..
--- a/targets/support/kill-chroot-pids.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-# Script to kill processes found running in the chroot.
-
-if [ "${clst_chroot_path}" == "/" ]
-then
-   echo "Aborting  clst_chroot_path is set to /"
-   echo "This is very dangerous"
-   exit 1
-fi
-
-if [ "${clst_chroot_path}" == "" ]
-then
-   echo "Aborting  clst_chroot_path is NOT set"
-   echo "This is very dangerous"
-   exit 1
-fi
-
-j=0
-declare -a pids
-# Get files and dirs in /proc
-for i in `ls /proc`
-do
-   # Test for directories
-   if [ -d /proc/$i ]
-   then
-   # Search for exe containing string inside ${clst_chroot_path}
-   ls -la --color=never /proc/$i 2>&1 |grep exe|grep ${clst_chroot_path} > 
/dev/null
-
-   # If found
-   if [ $? == 0 ]
-   then
-   # Assign the pid into the pids array
-   pids[$

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/

2020-05-26 Thread Matt Turner
commit: d62e0bec798c9fb404da306f464e77b8dd0bf293
Author: Matt Turner  gentoo  org>
AuthorDate: Thu May 21 22:37:29 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Wed May 27 06:19:55 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d62e0bec

catalyst: Clean up unbind() function

Does a couple of things:
- drops log.notice -> log.warning
- Removes the kill_chroot_pids support code since 
  namespaces?

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/base/stagebase.py  | 45 +++
 targets/support/kill-chroot-pids.sh | 62 -
 2 files changed, 12 insertions(+), 95 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index aa5cafd0..d92f3ffb 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -625,17 +625,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
 assert self.settings[verify] == "blake2"
 self.settings.setdefault("gk_mainargs", []).append("--b2sum")
 
-def kill_chroot_pids(self):
-log.info('Checking for processes running in chroot and killing them.')
-
-# Force environment variables to be exported so script can see them
-self.setup_environment()
-
-killcmd = normpath(self.settings["sharedir"] +
-   self.settings["shdir"] + 
"/support/kill-chroot-pids.sh")
-if os.path.exists(killcmd):
-cmd([killcmd], env=self.env)
-
 def mount_safety_check(self):
 """
 Check and verify that none of our paths in mypath are mounted. We don't
@@ -886,35 +875,28 @@ class StageBase(TargetBase, ClearBase, GenBase):
 raise CatalystError
 
 def unbind(self):
-ouch = 0
-mypath = self.settings["chroot_path"]
+chroot_path = self.settings["chroot_path"]
+umount_failed = False
 
 # Unmount in reverse order
-for x in [x for x in reversed(self.mount) if self.mount[x]['enable']]:
-target = normpath(mypath + self.mount[x]['target'])
-if not os.path.exists(target):
-log.notice('%s does not exist. Skipping', target)
+for target in [Path(chroot_path + self.mount[x]['target'])
+   for x in reversed(self.mount)
+   if self.mount[x]['enable']]:
+if not target.exists():
+log.debug('%s does not exist. Skipping', target)
 continue
 
 if not ismount(target):
-log.notice('%s is not a mount point. Skipping', target)
+log.debug('%s is not a mount point. Skipping', target)
 continue
 
 try:
 umount(target)
-except CatalystError:
-log.warning('First attempt to unmount failed: %s', target)
-log.warning('Killing any pids still running in the chroot')
-
-self.kill_chroot_pids()
-
-try:
-umount(target)
-except CatalystError:
-ouch = 1
-log.warning("Couldn't umount bind mount: %s", target)
+except OSError as e:
+log.warning("Couldn't umount bind mount: %s", target)
+umount_failed = True
 
-if ouch:
+if umount_failed:
 # if any bind mounts really failed, then we need to raise
 # this to potentially prevent an upcoming bash stage cleanup script
 # from wiping our bind mounts.
@@ -1307,9 +1289,6 @@ class StageBase(TargetBase, ClearBase, GenBase):
 def run(self):
 self.chroot_lock.write_lock()
 
-# Kill any pids in the chroot
-self.kill_chroot_pids()
-
 # Check for mounts right away and abort if we cannot unmount them
 self.mount_safety_check()
 

diff --git a/targets/support/kill-chroot-pids.sh 
b/targets/support/kill-chroot-pids.sh
deleted file mode 100755
index ea8ee402..
--- a/targets/support/kill-chroot-pids.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-# Script to kill processes found running in the chroot.
-
-if [ "${clst_chroot_path}" == "/" ]
-then
-   echo "Aborting  clst_chroot_path is set to /"
-   echo "This is very dangerous"
-   exit 1
-fi
-
-if [ "${clst_chroot_path}" == "" ]
-then
-   echo "Aborting  clst_chroot_path is NOT set"
-   echo "This is very dangerous"
-   exit 1
-fi
-
-j=0
-declare -a pids
-# Get files and dirs in /proc
-for i in `ls /proc`
-do
-   # Test for directories
-   if [ -d /proc/$i ]
-   then
-   # Search for exe containing string inside ${clst_chroot_path}
-   ls -la --color=never /proc/$i 2>&1 |grep exe|grep ${clst_chroot_path} > 
/dev/null
-
-   # If found
-   if [ $? == 0 ]
-   then
-   # Assign the pid into the pids array
-   pids[$

[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/

2020-05-19 Thread Matt Turner
commit: 759584b0ea8c9adac497a1141ac26080ba8ab8a4
Author: Matt Turner  gentoo  org>
AuthorDate: Wed May 20 02:22:11 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Wed May 20 02:29:23 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=759584b0

catalyst: Emit bool envars as str(var)

This just capitalizes the values of the environemnt variables, since the
Python literals are capitalized.

Enables the next commit to use this path for other types as well.

Signed-off-by: Matt Turner  gentoo.org>

 catalyst/base/stagebase.py  | 5 +
 targets/support/chroot-functions.sh | 4 ++--
 targets/support/kmerge.sh   | 4 ++--
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 9410f151..e87f181d 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1281,10 +1281,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 elif isinstance(self.settings[x], list):
 self.env[varname] = ' '.join(self.settings[x])
 elif isinstance(self.settings[x], bool):
-if self.settings[x]:
-self.env[varname] = "true"
-else:
-self.env[varname] = "false"
+self.env[varname] = str(self.settings[x])
 # This handles a dictionary of objects just one level deep and no 
deeper!
 # Its currently used only for USE_EXPAND flags which are 
dictionaries of
 # lists in arch/amd64.py and friends.  If we wanted 
self.settigs[var]

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index b6e221af..47239b96 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -117,7 +117,7 @@ setup_emerge_opts() {
emerge_opts=()
bootstrap_opts=()
 
-   if [[ "${clst_VERBOSE}" == "true" ]]
+   if [[ "${clst_VERBOSE}" == "True" ]]
then
emerge_opts+=(--verbose)
bootstrap_opts+=(-v)
@@ -256,7 +256,7 @@ run_merge() {
export EPAUSE_IGNORE=0
[[ $CONFIG_PROTECT != "-*"* ]] && export CONFIG_PROTECT="-*"
 
-   if [[ "${clst_VERBOSE}" == "true" ]]
+   if [[ "${clst_VERBOSE}" == "True" ]]
then
echo "ROOT=${ROOT} emerge ${emerge_opts[@]} -pt $@" || exit 1
emerge ${emerge_opts[@]} -pt $@ || exit 3

diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
index 6b589493..1a5fb458 100755
--- a/targets/support/kmerge.sh
+++ b/targets/support/kmerge.sh
@@ -58,7 +58,7 @@ setup_gk_args() {
fi
fi
 
-   if [[ "${clst_VERBOSE}" == "true" ]]
+   if [[ "${clst_VERBOSE}" == "True" ]]
then
GK_ARGS+=(--loglevel=2)
fi
@@ -85,7 +85,7 @@ genkernel_compile(){
esac
# Build with genkernel using the set options
# callback is put here to avoid escaping issues
-   if [[ "${clst_VERBOSE}" == "true" ]]
+   if [[ "${clst_VERBOSE}" == "True" ]]
then
gk_callback_opts=(-vN)
else



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2020-05-19 Thread Matt Turner
commit: 5a8322accecab68d7b00637f288487354e7a01d3
Author: Matt Turner  gentoo  org>
AuthorDate: Wed May 20 01:20:02 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Wed May 20 01:49:30 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=5a8322ac

targets: Remove copy_{file,symlink,lib} functions

Unused since the removal of the original netboot target.

I'm honestly kind of impressed with the strategy of running ldd and
recursively copying libraries to the netboot image. Unfortunately for
this strategy, dlopen() exists so this cannot work.

Fixes: 89f57e145f82 (targets: Delete the netboot target)
Signed-off-by: Matt Turner  gentoo.org>

 targets/support/chroot-functions.sh | 75 -
 1 file changed, 75 deletions(-)

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index d40279ae..d63e4918 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -335,81 +335,6 @@ run_default_funcs() {
fi
 }
 
-# Functions
-# Copy libs of a executable in the chroot
-function copy_libs() {
-   # Check if it's a dynamix exec
-   ldd ${1} > /dev/null 2>&1 || return
-
-   for lib in `ldd ${1} | awk '{ print $3 }'`
-   do
-   echo ${lib}
-   if [ -e ${lib} ]
-   then
-   if [ ! -e ${clst_root_path}/${lib} ]
-   then
-   copy_file ${lib}
-   [ -e "${clst_root_path}/${lib}" ] && \
-   strip -R .comment -R .note 
${clst_root_path}/${lib} \
-   || echo "WARNING : Cannot strip lib 
${clst_root_path}/${lib} !"
-   fi
-   else
-   echo "WARNING : Some library was not found for ${lib} !"
-   fi
-   done
-}
-
-function copy_symlink() {
-   STACK=${2}
-   [ "${STACK}" = "" ] && STACK=16 || STACK=$((${STACK} - 1 ))
-
-   if [ ${STACK} -le 0 ]
-   then
-   echo "WARNING : ${TARGET} : too many levels of symbolic links !"
-   return
-   fi
-
-   [ ! -e ${clst_root_path}/`dirname ${1}` ] && \
-   mkdir -p ${clst_root_path}/`dirname ${1}`
-   [ ! -e ${clst_root_path}/${1} ] && \
-   cp -vfdp ${1} ${clst_root_path}/${1}
-
-   if [[ -n $(type -p realpath) ]]; then
-   TARGET=`realpath ${1}`
-   else
-   TARGET=`readlink -f ${1}`
-   fi
-   if [ -h ${TARGET} ]
-   then
-   copy_symlink ${TARGET} ${STACK}
-   else
-   copy_file ${TARGET}
-   fi
-}
-
-function copy_file() {
-   f="${1}"
-
-   if [ ! -e "${f}" ]
-   then
-   echo "WARNING : File not found : ${f}"
-   continue
-   fi
-
-   [ ! -e ${clst_root_path}/`dirname ${f}` ] && \
-   mkdir -p ${clst_root_path}/`dirname ${f}`
-   [ ! -e ${clst_root_path}/${f} ] && \
-   cp -vfdp ${f} ${clst_root_path}/${f}
-   if [ -x ${f} -a ! -h ${f} ]
-   then
-   copy_libs ${f}
-   strip -R .comment -R .note ${clst_root_path}/${f} > /dev/null 
2>&1
-   elif [ -h ${f} ]
-   then
-   copy_symlink ${f}
-   fi
-}
-
 create_handbook_icon() {
# This function creates a local icon to the Gentoo Handbook
echo "[Desktop Entry]



[gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/

2020-05-19 Thread Matt Turner
commit: b4941f10b5ab361c9dbee8a1ed4957cba564eccd
Author: Matt Turner  gentoo  org>
AuthorDate: Wed May 20 01:24:58 2020 +
Commit: Matt Turner  gentoo  org>
CommitDate: Wed May 20 01:49:37 2020 +
URL:https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b4941f10

targets: Remove check_genkernel_version() function

Existed to ensure a minimum genkernel version, and was last updated in
2005. genkernel is emerged during the catalyst build now, so we will
always have an updated version.

Signed-off-by: Matt Turner  gentoo.org>

 targets/support/chroot-functions.sh | 23 ---
 targets/support/kmerge.sh   |  2 --
 2 files changed, 25 deletions(-)

diff --git a/targets/support/chroot-functions.sh 
b/targets/support/chroot-functions.sh
index d63e4918..b6e221af 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -29,29 +29,6 @@ if [[ -z "${clst_CHOST}" ]] ; then
fi
 fi
 
-check_genkernel_version() {
-   local version parts=() major minor
-
-   version=$(genkernel --version)
-   if [[ -z ${version} ]] ; then
-   echo "ERROR: Could not detect genkernel version!"
-   exit 1
-   fi
-   printf 'Genkernel version '%s' found ... ' "${version}"
-
-   IFS='.' read -a parts <<<"${version}"
-   major=${parts[0]}
-   minor=${parts[1]}
-   if [[ ${major} -gt 3 || ( ${major} -eq 3 && ${minor} -ge 3 ) ]] ; then
-   echo "OK"
-   else
-   echo "FAIL"
-   echo "ERROR: Your genkernel version is too low in your seed 
stage."
-   echo "   genkernel version 3.3.0 or greater is required."
-   exit 1
-   fi
-}
-
 get_libdir() {
ABI=$(portageq envvar ABI)
DEFAULT_ABI=$(portageq envvar DEFAULT_ABI)

diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
index 1a432293..6b589493 100755
--- a/targets/support/kmerge.sh
+++ b/targets/support/kmerge.sh
@@ -2,8 +2,6 @@
 
 source /tmp/chroot-functions.sh
 
-check_genkernel_version
-
 install -d /tmp/kerncache
 PKGDIR=/tmp/kerncache/${clst_kname}/ebuilds