Skip to content

instructions to demo PowerShell Core on Raspbian - #4882

Merged
Travis Plunk (TravisEz13) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:pi-demo
Sep 23, 2017
Merged

Travis Plunk (TravisEz13) merged 6 commits into
PowerShell:masterfrom
SteveL-MSFT:pi-demo

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

No description provided.

@SteveDesmond-ca

Copy link
Copy Markdown

🎉 I'll get something similar prepped for Chromebooks

@markekraus Mark Kraus (markekraus) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor adjustments.

Comment thread demos/Raspberry-Pi/README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the proper "branding" CoreCLR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will fix

Comment thread .spelling Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think DotNetCore should be added to the Global Dictionary and removed from the other overrides.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree

Comment thread .spelling Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CoreCLR is in the Global dictionary and I believe that is the correct "branding".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

Comment thread demos/Raspberry-Pi/README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalize first letter after # and end sentences with periods.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

Comment thread demos/Raspberry-Pi/README.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe clarify what you mean by supported?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's because CoreCLR is still beta on arm32.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a link to the tracking issue for CoreCLR

@TravisEz13

Copy link
Copy Markdown
Member

also, you need to resolve conflicts with spelling

~/powershell/powershell
```

Note that until arm32 is [fully supported by CoreCLR](https://github.com/dotnet/coreclr/issues/3977), it's not supported by PowerShell Core.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it might be worth mentioning that these instructions apply only to Raspberry Pi 2 and Raspberry Pi 3;
On Pi 1, Pi Zero and Pi Zero W CoreCLR can't run because it requires newer CPU instruction set, so we can't run PowerShell on these versions of Raspberry Pi single-board computers.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll clarify.

@fMichaleczek

Flavien MICHALECZEK (fMichaleczek) commented Sep 22, 2017 •

Copy link
Copy Markdown
Contributor

I followed yours instructions with this environment :

  • raspberry 2 with a fresh install of raspbian stretch ( 2017-09-07 )
  • hyperv VM with a fresh install of ubuntu 16.04 ( 16.04.3-desktop-amd64 )

A first error occur here, about LD_LIBRARY_PATH, resolved by setting it to :
PS /opt/PowerShell> Start-PSBootstrap
Installing PowerShell build dependencies
dotnet not present. Installing dotnet.
Unable to find dotnet installation to remove.
./dotnet-install.sh: line 210: LD_LIBRARY_PATH: unbound variable
Execution of {
curl -sO $obtainUrl/$installScript
bash ./$installScript -c $Channel -v $Version
} failed with exit code 1
At /opt/PowerShell/build.psm1:1750 char:13
+ throw "Execution of {$sb} failed with exit code $LASTEXIT ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Execution of {
...ith exit code 1:String) [], RuntimeException
+ FullyQualifiedErrorId : Execution of {
curl -sO $obtainUrl/$installScript
bash ./$installScript -c $Channel -v $Version
} failed with exit code 1

Then, after overwrite the CoreClr bits, you have to do an extra part to install libunwind8
sudo apt install libunwind8

At the end, powershell is loaded.

On a Rasperry 2 :
Measure-Command { powershell -c "1" } : near 15sec.
CPU Usage at startup : near 40%
Usage memory : near 50MB

Thank you some much !!

@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Sep 22, 2017 •

Copy link
Copy Markdown
Member Author

Flavien MICHALECZEK (@fMichaleczek) Unfortunately https://github.com/dotnet/cli/issues/7698 broke our start-psbootstrap script which is what is also causing the Linux Travis-CI run to fail.

The startup time is slow because crossgen currently doesn't support arm32 which would recompile the .Net IL to native code.

@TravisEz13

Copy link
Copy Markdown
Member

Please fix the spelling issues: https://travis-ci.org/PowerShell/PowerShell/jobs/278410327#L3327

@TravisEz13
Travis Plunk (TravisEz13) merged commit 1c921cd into PowerShell:master Sep 23, 2017
@lwsrbrts

Copy link
Copy Markdown

Steve Lee (@SteveL-MSFT) is it worth raising issues for PowerShell6.0.0-beta8 on a Pi 2?
Issues I walked in to as soon as I got it running were that I couldn't install any modules and Invoke-WebRequest bombed out with a System.Memory cannot find file issue. I didn't dig any further.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Lewis Roberts (@lwsrbrts) You can open new issues for Pi-2, but it's low on our priority list particularly since its a franken-build to get it working

@stefanstranger

Copy link
Copy Markdown

I was able to start pwsh after running:

# We'll make a folder to put latest CoreCLR runtime.
mkdir dotnet
cd dotnet
# Download the latest CoreCLR runtime.
curl -O https://dotnetcli.blob.core.windows.net/dotnet/Runtime/master/dotnet-runtime-latest-linux-arm.tar.gz
# Unpack it.
tar xvf ./dotnet-runtime-latest-linux-arm.tar.gz
# We're going to overwrite the CoreCLR bits we built with newer ones, replace the version named folder below as appropriate.
# If you build a newer version of PowerShell Core, you'll need to make sure you get latest CoreCLR runtime otherwise you may hit a segmentation fault.
cp shared/Microsoft.NETCore.App/2.1.0-preview1-26026-02/* ~/powershell
# Install libunwind8
sudo apt install libunwind8

But soon after PowerShell was started it aborted with the following error:

PowerShell v6.0.0-rc.2-70-gc17a975683a0df639030521777d9cdc764784799
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

FailFast: Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.


   at System.Environment.FailFast(System.String, System.Exception)
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
Aborted

Raspberry Pi 2 info:

pi@raspberrypi:~ $ dmesg | grep "Machine"
[    0.000000] OF: fdt:Machine model: Raspberry Pi 2 Model B Rev 1.1
pi@raspberrypi:~ $

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Stefan Stranger (@stefanstranger) you shouldn't have to install dotnet as it comes with the PSCore6 package. Make sure you follow the updated instructions

@stefanstranger

Copy link
Copy Markdown

That was simple :-) Well lesson learned.

Thanks Steve Lee (@SteveL-MSFT)

/Stefan

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants