public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/
@ 2020-05-20  2:29 Matt Turner
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2020-05-20  2:29 UTC (permalink / raw
  To: gentoo-commits

commit:     759584b0ea8c9adac497a1141ac26080ba8ab8a4
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Wed May 20 02:22:11 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed May 20 02:29:23 2020 +0000
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 <mattst88 <AT> 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/
@ 2020-05-27  6:20 Matt Turner
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2020-05-27  6:20 UTC (permalink / raw
  To: gentoo-commits

commit:     d62e0bec798c9fb404da306f464e77b8dd0bf293
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu May 21 22:37:29 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed May 27 06:19:55 2020 +0000
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 <mattst88 <AT> 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..00000000
--- 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
-
-fi


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/
@ 2020-05-27  6:22 Matt Turner
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2020-05-27  6:22 UTC (permalink / raw
  To: gentoo-commits

commit:     d11d5eb2cf32fc09c323871c2ca6fcb6b468f822
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu May 21 22:37:29 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed May 27 06:22:51 2020 +0000
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 <mattst88 <AT> 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..00000000
--- 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
-
-fi


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/
  2020-10-30 22:41 [gentoo-commits] proj/catalyst:master " Matt Turner
@ 2020-12-19 19:56 ` Matt Turner
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2020-12-19 19:56 UTC (permalink / raw
  To: gentoo-commits

commit:     f7fe02da2825122eb6347e569170e34515f112e3
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 22 18:19:09 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Oct 30 22:40:52 2020 +0000
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 <mattst88 <AT> 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..00000000
--- 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
-
-fi


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/
@ 2021-01-18 19:38 Matt Turner
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2021-01-18 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     580c065a40682c4597ddd4bbb79c25b67c58ead6
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 03:09:30 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Jan 18 19:37:55 2021 +0000
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 <mattst88 <AT> 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/
  2021-01-28  1:54 [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
@ 2021-01-29 23:50 ` Matt Turner
  0 siblings, 0 replies; 6+ messages in thread
From: Matt Turner @ 2021-01-29 23:50 UTC (permalink / raw
  To: gentoo-commits

commit:     a500400592aaa309602331705b27cdbee8ae58c4
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 18 03:09:30 2021 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Jan 23 16:19:07 2021 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=a5004005

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 <mattst88 <AT> 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-29 23:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-18 19:38 [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, catalyst/base/ Matt Turner
  -- strict thread matches above, loose matches on Subject: below --
2021-01-28  1:54 [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2021-01-29 23:50 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-10-30 22:41 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-12-19 19:56 ` [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-27  6:22 Matt Turner
2020-05-27  6:20 Matt Turner
2020-05-20  2:29 Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox