Bug 7545

Summary: Installing extensible SDK as root should fail earlier with a proper error
Product: [Yocto Project Subprojects] ADT Reporter: Yi Zhao <yi.zhao>
Component: adtAssignee: Randy Witt <randy.e.witt>
Status: VERIFIED FIXED QA Contact: Yi Zhao <yi.zhao>
Severity: normal    
Priority: Medium CC: alexandru.c.georgescu, bluelightning, ke.zou, poky.adt.watcher, poky.watcher, yi.zhao
Version: 1.8   
Target Milestone: 1.9 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yi Zhao 2015-03-31 09:08:57 UTC
Git rev: master/8b3d3e7c957ad06c390886487f69aeb8e145da6a

Steps:
1. set the arch to qemuppc
2. bitbake core-image-sato -c populate_sdk_ext
3. Install the poky-glibc-x86_64-core-image-sato-ppc7400-toolchain-ext-1.8.sh

############################
$ sudo ./poky-glibc-x86_64-core-image-sato-ppc7400-toolchain-ext-1.8.sh 
Enter target directory for SDK (default: /opt/poky/1.8): 
You are about to install the SDK to "/opt/poky/1.8". Proceed[Y/n]?
Extracting SDK...done
Setting it up...
Extracting buildtools...
Preparing build system...
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Do not use Bitbake as root.
SDK preparation failed
#############################
Comment 1 Paul Eggleton 2015-03-31 13:04:03 UTC
This is a known limitation - even if we bypassed the check, the user must be able to write to the directory where the extensible SDK is installed, so there's no point installing it as root. Ideally we would check for it up front however rather than waiting until the preparation stage.
Comment 2 Alexandru Georgescu 2015-04-09 15:32:43 UTC
found during 1.8_M4.rc2 testing
fido:33558eacc8a2d3dce3396b9ab2fd0773ac5076bc
Comment 3 Yi Zhao 2015-07-02 06:01:20 UTC
This issue still exists in 1.9 M1 rc1 (master/18e902b2dc17746af453869bcc1fba4dbae7c94f)
Comment 4 Randy Witt 2015-07-22 19:56:50 UTC
This should be fixed in master as of:

commit 2563aa55281c60c877d8a298b6884ee7da550234
Author: Randy Witt <randy.e.witt@linux.intel.com>
Date:   Thu Jul 16 13:34:21 2015 -0700
Comment 5 Yi Zhao 2015-08-07 09:20:55 UTC
I tested on the 1.9 M2 rc1 (master/22078d5e533e59a9aa6999abefbf6ece4e01de8d)
It can throw error properly now:

$ sudo ./poky-glibc-x86_64-core-image-sato-ppc7400-toolchain-ext-1.8+snapshot.sh
Poky (Yocto Project Reference Distro) Extensible SDK installer version 1.8+snapshot
===========================================================
ERROR: The extensible sdk cannot be installed as root.

But there is still other error when install it by normal user. I will open a new bug.