testing for RPi chroot's kernel arch -- getting different results (anrv7l vs armv6l) depending on how I test. why?

grantksupport at operamail.com grantksupport at operamail.com
Thu Sep 4 18:57:46 PDT 2014


Hi,

First checking; & still ...

	chroot /opt/raspbian-chroot bash -c "uname -rm"
		3.16.1-7.g90bc0f1-desktop armv7l

and

	chroot /opt/raspbian-chroot
	uname -rm
		3.16.1-7.g90bc0f1-desktop armv6l

On 09/04/2014 07:55 AM, Stephen Warren wrote:
...
> I'm afraid I don't know the answer, but I'm curious what the following
> says:
> 
> $ chroot /opt/raspbian-chroot bash
> $ uname -rm    # inside the chroot

	chroot /opt/raspbian-chroot bash
	uname -rm
		3.16.1-7.g90bc0f1-desktop armv6l

hmm.

> I wonder if bash somehow changes the environment, or perhaps running
> bach -c skips some login scripts that do/don't do something to change
> the environment? You might try editing /etc/profile and similar, and
> adding "uname -rm" to various points there to try and track down the issue.

Not a lot there,

	ls -d /{etc,root}/{,.}{*profile*,*bash*}
		/etc/bash.bashrc  /etc/profile.d  /root/.bash_history  /root/.bashrc

where

	cat /etc/bash.bashrc | egrep -v "^#|^[[:space:]]*$"
		[ -z "$PS1" ] && return
		shopt -s checkwinsize
		if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
		    debian_chroot=$(cat /etc/debian_chroot)
		fi
		PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
		if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
		        function command_not_found_handle {
		                # check because c-n-f could've been removed in the meantime
		                if [ -x /usr/lib/command-not-found ]; then
		                   /usr/lib/command-not-found -- "$1"
		                   return $?
		                elif [ -x /usr/share/command-not-found/command-not-found ]; then
		                   /usr/share/command-not-found/command-not-found -- "$1"
		                   return $?
		                else
		                   printf "%s: command not found\n" "$1" >&2
		                   return 127
		                fi
		        }
		fi

and

	cat /root/.bashrc
		export QEMU_CPU=arm1176
		export LANGUAGE=
		export LANG=en_US.UTF-8
		export LC_ALL=C
		CC=armv6-raspbian-linux-gnueabihf-gcc
		CXX=armv6-raspbian-linux-gnueabihf-g++
		PATH=/usr/crosscompiler/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
		export PATH CC CXX QEMU_CPU LC_ALL
		alias ls="ls --color=auto"
		alias l="ls -la"
		alias ll="ls -la"
		alias cd..="cd .."
		alias ..="cd .."
		alias ...="cd ../.."

On 09/04/2014 08:24 AM, Leitzell, Harry wrote:
> Here is a Jessie qemu-debootstrap done about an hour ago on Ubuntu 14.04.1:

> /mnt/raspbian# chroot rootfs bash -c "grep PRETTY_NAME /etc/os-release"
> PRETTY_NAME="Raspbian GNU/Linux jessie/sid"
> /mnt/raspbian# chroot rootfs bash -c "uname -rm"
> 3.13.0-35-generic armv7l
> /mnt/raspbian# chroot rootfs
> /# uname -rm
> 3.13.0-35-generic armv7l
> 

Here, similarly

	chroot /opt/raspbian-chroot/ bash -c "grep PRETTY_NAME /etc/os-release"
		PRETTY_NAME="Raspbian GNU/Linux jessie/sid"

	chroot /opt/raspbian-chroot/  bash -c "uname -rm"
		3.16.1-7.g90bc0f1-desktop armv7l

	chroot /opt/raspbian-chroot/
		3.16.1-7.g90bc0f1-desktop armv6l

and, at host

	rpm -qi qemu
		Name        : qemu
		Version     : 2.1.0
		Release     : 257.1
		Architecture: x86_64
		Install Date: Tue 02 Sep 2014 05:54:58 AM PDT
		Group       : System/Emulators/PC
		Size        : 914618
		License     : BSD-3-Clause and GPL-2.0 and GPL-2.0+ and LGPL-2.1+ and MIT
		Signature   : RSA/SHA1, Tue 02 Sep 2014 05:41:51 AM PDT, Key ID a193fbb572174fc2
		Source RPM  : qemu-2.1.0-257.1.src.rpm
		Build Date  : Tue 02 Sep 2014 05:21:54 AM PDT
		Build Host  : build06
		Relocations : (not relocatable)
		Vendor      : obs://build.opensuse.org/Virtualization
		URL         : http://www.qemu.org/
		Summary     : Universal CPU emulator
		Description :
		QEMU is an extremely well-performing CPU emulator that allows you to
		choose between simulating an entire system and running userspace
		binaries for different architectures under your native operating
		system. It currently emulates x86, ARM, PowerPC and SPARC CPUs as well
		as PC and PowerMac systems.
		Distribution: Virtualization / openSUSE_13.1



More information about the linux-rpi-kernel mailing list