An unofficial Debian Installer for Pinebook Pro
#21
I've just landed some changes to the installer.

The biggest is that it will now be using a kernel from an Open Build Service apt repo... this means that apt can be used to keep both the distro and the kernel up to date. Anyone who has an existing install shouldn't need to reinstall, just grab that config files from https://github.com/daniel-thompson/pineb...er/etc/apt and apt-get linux-image-pinebookpro-arm64 .

Perhaps against my better judgement, since I would rather see problems fixed in the right place than concealed with distro hackery, but I have also added some hacks to enable the audio DAC by default and dramatically reduce the boot time.

Cutting the boot time requires a seriously nasty trick to prevent the kernel scheduling anything in the slow clocked cores during boot. This can also be picked up without a reinstall but you'll probably have to go grubbing about in the installer etc directory to figure it out (/etc/default/u-boot and /etc/tmpfiles.d/00-enable-big-cores.conf, make sure the kernel is at least 5.4.2-2 from the open build service and ensure you update the bootloader with u-boot-update).

@Hexxeh: I'm afraid I have tested BT at this point. I recall something about needing to specify the MAC address but I haven't followed up.
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#22
(12-15-2019, 05:35 AM)danielt Wrote: I've just landed some changes to the installer.

The biggest is that it will now be using a kernel from an Open Build Service apt repo...
<snip>
Perhaps against my better judgement, since I would rather see problems fixed in the right place than concealed with distro hackery, but I have also added some hacks to enable the audio DAC by default and dramatically reduce the boot time.
<snip>
Cutting the boot time requires a seriously nasty trick to prevent the kernel scheduling anything in the slow clocked cores during boot
<snip>

Daniel, Kudos due on these efforts. They have the twin effect of advancing utility of the PBP, and of incrementing my impatience for January, when my shipment is due to arrive.


I hope you've patience with a question. In your announcement post, you mentioned that your installer should work to bootstrap alternative Debian-derived distributions, provided they have a relatively complete 64-bit ARM architecture port. I'm assuming that for Ubuntu, as example, this means fetching debootstrap_1.0.116ubuntu2_all.deb from /ubuntu/pool/main/d/debootstrap on archive.ubuntu.com — and that similar should be possible for derivatives Raspian, with your ability to specify an Open Build Source kernel. Is this right?
— Jeremiah Cornelius
"Be the first person not to do some­thing, that no one has thought of not doing before’’
— Brian Eno, "Oblique Strategies"
#23
(12-15-2019, 05:35 AM)danielt Wrote: Cutting the boot time requires a seriously nasty trick to prevent the kernel scheduling anything in the slow clocked cores during boot. This can also be picked up without a reinstall but you'll probably have to go grubbing about in the installer etc directory to figure it out (/etc/default/u-boot and /etc/tmpfiles.d/00-enable-big-cores.conf, make sure the kernel is at least 5.4.2-2 from the open build service and ensure you update the bootloader with u-boot-update).

You've actually found a somewhat clever hack that shouldn't horribly break anything in the long run. When you described it as "seriously nasty" I was expecting something much nastier. Smile

For those who don't want to go grubbing around in the installer /etc directory, the hack is to set maxcpus=4 on the kernel command line to stop the kernel from using the big cores before cpufreq is loaded, then write to /sys/devices/system/cpu/cpuX/online later in boot to enable them again once cpufreq has brought them to a sane clockspeed.
#24
(12-15-2019, 05:35 AM)danielt Wrote: I've just landed some changes to the installer.

[...]
Cutting the boot time requires a seriously nasty trick to prevent the kernel scheduling anything in the slow clocked cores during boot. This can also be picked up without a reinstall but you'll probably have to go grubbing about in the installer etc directory to figure it out (/etc/default/u-boot and /etc/tmpfiles.d/00-enable-big-cores.conf, make sure the kernel is at least 5.4.2-2 from the open build service and ensure you update the bootloader with u-boot-update).
Thanks, Daniel! Works perfectly with the fixes applied manually. I think this is the most modern and usable Linux build on the Pinebook Pro so far (I have been testing mrfixit-debian, ayufan-bionic and manjaro).
Having GNOME and Evolution so snappy is a big plus for me.

I was having trouble with restoring alsa state within the running system, I ended up stopping alsa-state.service and restoring the state manually. Since then, audio worked properly.


Code:
sudo systemctl stop alsa-state.service
sudo install ./var/lib/alsa/asound.state /var/lib/alsa/asound.state
sudo /usr/sbin/alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR=/run/alsa/runtime restore
sudo systemctl start alsa-state.service
#25
Wow. Lots of feedback... awesome!


@Jeremiah Cornelius : My comments about related distros where more about what distro you can install from (this being an installer that needs an existing Linux system to run on). Having said that if you prefer Ubuntu then the concepts from the installer should work just fine but you will have to change a couple of small things: the debootstrap line would have to change and I don't think Ubuntu will like grabbing a package from OBS since the version numbers won't match.

Once you have your PBP I'm quite happy to answer questions (and review any PRs) if you want to try and add support for installing ubuntu systems!


@Solra Bizna : The hack doesn't seem that nasty when you look at how it works... however when you start to think about the consequences then it does get a bit nastier.

When the kernel boots up it reads the status registers of the online CPUs and decided what workarounds it needs to deploy for the CPUs it finds itself running on. If the A72 cores are not online during the boot then the workarounds are not deployed because they are not needed for hte A53 cores that are online. When we try to online to A72 cores the kernel notices there is a workaround missing and refuses to let them boot (and your desktop will feel slow as a result... it needs the big cores to make things smooth). To get the A72s to work we have to turn off workarounds such as HARDEN_EL2_VECTORS in the kernel. Turning off HARDERN_EL2_VECTORS makes it slightly easier to exploit security bugs in the KVM hyypervisor so it is definitely not a good thing. I'm just about OK turning it off on a laptop but things like this cannot be turned off for generic modular distro kernels so I'm still on the lookout for a proper fix.


@siemsenit : Neat trick ;-)
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
#26
(12-16-2019, 05:09 AM)danielt Wrote: @Solra Bizna : The hack doesn't seem that nasty when you look at how it works... however when you start to think about the consequences then it does get a bit nastier.

When the kernel boots up it reads the status registers of the online CPUs and decided what workarounds it needs to deploy for the CPUs it finds itself running on. If the A72 cores are not online during the boot then the workarounds are not deployed because they are not needed for hte A53 cores that are online. When we try to online to A72 cores the kernel notices there is a workaround missing and refuses to let them boot (and your desktop will feel slow as a result... it needs the big cores to make things smooth). To get the A72s to work we have to turn off workarounds such as HARDEN_EL2_VECTORS in the kernel. Turning off HARDERN_EL2_VECTORS makes it slightly easier to exploit security bugs in the KVM hyypervisor so it is definitely not a good thing. I'm just about OK turning it off on a laptop but things like this cannot be turned off for generic modular distro kernels so I'm still on the lookout for a proper fix.

Aha. I can definitely see how that would be a problem. This would also explain why only the most recent kernel actually, successfully, onlined the big cores—it has the workarounds disabled.
#27
(12-04-2019, 03:34 AM)danielt Wrote: I've recently spent a little while hacking together a quick 'n dirty Debian installer for the Pinebook Pro.

https://github.com/daniel-thompson/pineb...-installer

It is not a fully fledged installer... just some code that run on the Pinebook Pro itself using an existing Debian (or maybe Ubuntu) distro. It will install an operating system from scratch to an alternative media. Nevertheless it is a "real" installer in that sense that there is no downloadable image, no default password and you get to choose the keyboard layout, locale, timezone and desktop environment for yourself!

It uses upstream Debian packages for everything except the kernel and bootloaders. Actually... on that subject I deserve no credit for the kernel (which is the v5.4 close-to-mainline kernel that @tsys has has been hacking on) or the bootloaders (which are simply the binaries from @Mrfixit2001 's update repo).

Curious, what are the advantages of this as opposed to the stock Debian build?
#28
(12-16-2019, 06:48 PM)zaius Wrote: Curious, what are the advantages of this as opposed to the stock Debian build?

One of the advantages is you can install a newer release, which gives you newer package versions. This can be important if you require fixes or new functionality found only in a more recent release.

Second, there is educational value in the process of rolling your own distribution.

Third, when you roll your own distribution you know what's in it.

Fourth, you get to make all the design decisions.

But if you are new to Linux, or new to Debian, the default Debian desktop is a fantastic place to start, and learn. Mrfixit and Luke have done a great job putting it together.
#29
Any thoughts what might be causing the following error during the kernel section of the Makefile?  Seems a strange place to break on an install command.


Code:
>>>> kernel

cat etc/default/u-boot.append | sudo tee -a /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/default/u-boot > /dev/null
cat etc/initramfs-tools/modules.append | sudo tee -a /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/initramfs-tools/modules > /dev/null
sudo install etc/initramfs-tools/conf.d/* /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/initramfs-tools/conf.d/
sudo install etc/apt/sources.list.d/kernel-obs.list /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/apt/sources.list.d/
sudo install etc/apt/trusted.gpg.d/* /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/apt/trusted.gpg.d/
sudo install etc/kernel/postinst.d/* /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/kernel/postinst.d/
install: cannot stat 'etc/kernel/postinst.d/*': No such file or directory
Makefile:131: recipe for target 'kernel' failed
make: *** [kernel] Error 1
#30
(12-17-2019, 12:43 AM)acr Wrote: Any thoughts what might be causing the following error during the kernel section of the Makefile?  Seems a strange place to break on an install command.


Code:
>>>> kernel

cat etc/default/u-boot.append | sudo tee -a /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/default/u-boot > /dev/null
cat etc/initramfs-tools/modules.append | sudo tee -a /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/initramfs-tools/modules > /dev/null
sudo install etc/initramfs-tools/conf.d/* /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/initramfs-tools/conf.d/
sudo install etc/apt/sources.list.d/kernel-obs.list /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/apt/sources.list.d/
sudo install etc/apt/trusted.gpg.d/* /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/apt/trusted.gpg.d/
sudo install etc/kernel/postinst.d/* /home/rock/src/pinebook-pro-debian-installer/sysimage/etc/kernel/postinst.d/
install: cannot stat 'etc/kernel/postinst.d/*': No such file or directory
Makefile:131: recipe for target 'kernel' failed
make: *** [kernel] Error 1

The `/home/rock/src/pinebook-pro-debian-installer/sysimage/etc/kernel/postinst.d/` folder doesn't seem to exist, create it beforehand and try again.


Possibly Related Threads…
Thread Author Replies Views Last Post
  Debian on Pinebook Pro u974615 8 449 03-22-2024, 03:57 PM
Last Post: u974615
  Pinebook Pro upgrading from the factory image yamsoup 12 1,126 02-22-2024, 04:02 PM
Last Post: tllim
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 1,921 12-13-2023, 07:22 PM
Last Post: trillobite
  Need Help Recovering Manjaro /boot Contents on Pinebook Pro calinb 6 1,981 12-11-2023, 03:47 AM
Last Post: calinb
  Gentoo on Pinebook Pro RELEASE jannik2099 54 86,673 12-08-2023, 11:25 PM
Last Post: tllim
  Boot Order in Pinebook Pro food 8 994 11-23-2023, 07:37 AM
Last Post: KC9UDX
  install debian on pbp jsch 7 3,834 11-22-2023, 04:22 PM
Last Post: TRS-80
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 7,032 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  PineBook Pro seems to go to deep sleep, but doesn't wake up pogo 11 4,930 08-31-2023, 04:20 PM
Last Post: TRS-80
  Would a Pinebook Pro be good for a Linux newbie? cassado10 6 1,326 08-08-2023, 04:58 AM
Last Post: moobythegoldensock

Forum Jump:


Users browsing this thread: 2 Guest(s)