Skip to contentSkip to conversation

util-linux: fix alternatives setting for switch-root

PATCH Superseded Randy MacLeod 2 participants 6 messages Oct 13, 2018 – Oct 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 util-linux: fix alternatives setting for switch-root

The alternative setting for switch_root belongs to the util-linux-switch_root package instead of the util-linux package. Fix this problem to avoid a dangling symlink:
/usr/bin/switch_root-> /usr/bin/switch_root.util-linux
on target and in the sdk.

---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +4 -2
index 60ac9c2006..9d424158fd 100644
@@ -206,7 +206,7 @@ do_install_append_class-native () {
 ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = " \
-    dmesg kill more mkswap blockdev pivot_root switch_root \
+    dmesg kill more mkswap blockdev pivot_root \
     hexdump last lastb logger mesg renice wall \
     setsid chrt flock utmpdump eject nologin taskset fallocate \
     fsfreeze nsenter \
@@ -218,7 +218,6 @@ ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
 ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
 ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
-ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
 ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate"
 ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze"
@@ -294,6 +293,9 @@ ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
 ALTERNATIVE_util-linux-unshare = "unshare"
 ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
 
+ALTERNATIVE_util-linux-switch_root = "switch_root"
+ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
+
 BBCLASSEXTEND = "native nativesdk"
 
 python do_package_prepend () {
Signature · 1 line
2.17.0
#1 lore raw
Quoted 11 lines · Randy MacLeod

The alternative setting for switch_root belongs to the util-linux- switch_root
package instead of the util-linux package. Fix this problem to avoid a dangling symlink:

   /usr/bin/switch_root-> /usr/bin/switch_root.util-linux

on target and in the sdk.

---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Sorry, but:

https://autobuilder.yoctoproject.org/typhoon/api/v2/logs/50374/raw
https://autobuilder.yoctoproject.org/typhoon/api/v2/logs/50423/raw

Seems to trigger on deb builds for some reason, probably package installation order related?

Cheers,

Richard

#2 lore raw

PATCH v2 1/1 util-linux: fix alternatives setting for switch-root

V2:

Fixed typo in previous version:
-ALTERNATIVE_util-linux-switch-root
+ALTERNATIVE_util-linux-switch-root
in keeping with the existing package name.

Adding util-linux-switch-root to an image works and the dangling symlink in the sdk is also gone.

#3 lore raw

PATCH v2 1/1 util-linux: fix alternatives setting for switch-root

The alternative setting for switch_root belongs to the util-linux-switch-root package instead of the util-linux package. Fix this problem to avoid a dangling symlink:
/usr/bin/switch_root-> /usr/bin/switch_root.util-linux
on target and in the sdk.

---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/recipes-core/util-linux/util-linux.inc +4 -2
index 60ac9c2006..3d8b3ff592 100644
@@ -206,7 +206,7 @@ do_install_append_class-native () {
 ALTERNATIVE_PRIORITY = "80"
 
 ALTERNATIVE_${PN}  = " \
-    dmesg kill more mkswap blockdev pivot_root switch_root \
+    dmesg kill more mkswap blockdev pivot_root \
     hexdump last lastb logger mesg renice wall \
     setsid chrt flock utmpdump eject nologin taskset fallocate \
     fsfreeze nsenter \
@@ -218,7 +218,6 @@ ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
 ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
 ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
 ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
-ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
 ALTERNATIVE_LINK_NAME[fallocate] = "${bindir}/fallocate"
 ALTERNATIVE_LINK_NAME[fsfreeze] = "${sbindir}/fsfreeze"
@@ -294,6 +293,9 @@ ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
 ALTERNATIVE_util-linux-unshare = "unshare"
 ALTERNATIVE_LINK_NAME[unshare] = "${bindir}/unshare"
 
+ALTERNATIVE_util-linux-switch-root = "switch_root"
+ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
+
 BBCLASSEXTEND = "native nativesdk"
 
 python do_package_prepend () {
Signature · 1 line
2.17.0
#4 lore raw
Quoted 11 lines · Randy MacLeod

The alternative setting for switch_root belongs to the util-linux- switch-root
package instead of the util-linux package. Fix this problem to avoid a dangling symlink:

   /usr/bin/switch_root-> /usr/bin/switch_root.util-linux

on target and in the sdk.

---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

As far as I can tell, this still breaks on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/13/builds/125/steps/7/logs/step1b
https://autobuilder.yoctoproject.org/typhoon/#/builders/13/builds/125/steps/7/logs/step2b
https://autobuilder.yoctoproject.org/typhoon/#/builders/21/builds/132/steps/7/logs/step1b

Cheers,

Richard

#5 lore raw
Quoted 9 lines · Richard Purdie
Quoted 8 lines · Randy MacLeod

The alternative setting for switch_root belongs to the util-linux- switch-root
package instead of the util-linux package. Fix this problem to avoid
a dangling symlink:

   /usr/bin/switch_root-> /usr/bin/switch_root.util-linux

on target and in the sdk.

Quoted 8 lines
Quoted 4 lines
---
 meta/recipes-core/util-linux/util-linux.inc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

As far as I can tell, this still breaks on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/13/builds/125/steps/7/logs/step1b

Quoted 1 line

https://autobuilder.yoctoproject.org/typhoon/#/builders/13/builds/125/steps/7/logs/step2b

Quoted 1 line

https://autobuilder.yoctoproject.org/typhoon/#/builders/21/builds/132/steps/7/logs/step1b

It also appears I did merge the v2 so master is now broken and it doesn't cleanly revert due to other patches against util-linux :(

If someone could figure out why its breaking for debian packaging and help get it fixed that would be most appreciated!

Cheers,

Richard