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
  Reply
#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"
  Reply
#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.
  Reply
#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
  Reply
#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
  Reply
#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.
  Reply
#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?
  Reply
#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.
  Reply
#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
  Reply
#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.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  postmarketOS/Alpine edge image for the Pinebook Pro MartijnBraam 62 30,841 02-14-2021, 12:25 PM
Last Post: pmjohann
  OpenMandriva to release ARM builds for PineBook Pro and Pi ludix 6 698 02-13-2021, 04:03 PM
Last Post: ludix
  Keyboard issue: Debian PineSupporter 8 352 02-01-2021, 09:57 PM
Last Post: PineSupporter
  Pinebook Pro wifi not working seyo-iv 1 176 02-01-2021, 11:00 AM
Last Post: seyo-iv
  slarm64 (unofficial slackware) Pinebook Pro RK3399 (aarch64) mara 25 3,466 01-30-2021, 11:03 AM
Last Post: mara
  FLOSS pinebook pro linux set-up misha64 3 1,079 01-14-2021, 04:05 PM
Last Post: kuleszdl
  Debian Bullseye installation Baconomics 3 550 01-07-2021, 01:46 PM
Last Post: kuleszdl
  My Debian journey on the Pinebook Pro schwarzwieweiss 32 3,755 01-07-2021, 09:35 AM
Last Post: schwarzwieweiss
  Armbian for the Pinebook Pro [WIP] Luke 41 13,923 01-06-2021, 06:14 PM
Last Post: Idaho
  Gentoo on Pinebook Pro RELEASE jannik2099 48 28,193 01-03-2021, 06:21 AM
Last Post: wdt

Forum Jump:


Users browsing this thread: 1 Guest(s)