Giter VIP home page Giter VIP logo

gentoo-pinebookpro's Introduction

gentoo-pinebookpro

A collection of scripts to prepare a Gentoo tarball for the pinebook pro

Disclaimer:

I do not recommend Gentoo for people new to Linux.

How to use

READ THE GENTOO HANDBOOK!!! https://wiki.gentoo.org/wiki/Handbook:AMD64

./prepare.sh -h to display usage, this is safe to run in any environment and will not read or write anything.

tarball preparation instructions

Do this on your pbp or another aarch 64 environment, qemu works aswell.

  • Download a Stage 3 arm64 tarball - usually from https://www.gentoo.org/downloads/#arm64
  • Extract the tarball as root, otherwise you'll mess up file permissions!
  • Put the files of this repository into the tarball - preferably into /var/tmp/gentoo-pinebookpro.
    • You can do this with, e.g. git clone https://github.com/Jannik2099/gentoo-pinebookpro /var/tmp/gentoo-pinebookpro (or wget https://github.com/Jannik2099/gentoo-pinebookpro/archive/master.zip -O /tmp/master.zip; unzip /tmp/master.zip -d /var/tmp/gentoo-pinebookpro; rm /tmp/master.zip, if you don't have git but do have wget.)
  • Chroot into the tarball as explained in the Handbook - https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base#Copy_DNS_info
  • Edit your /etc/portage/make.conf to use the desired amount of threads and simultaneous jobs - I recommend MAKEOPTS="-j6 -l8" and EMERGE_DEFAULT_OPTS="--jobs 6 --load-average 8" (each as seperate lines in the file)
  • Execute the script prepare.sh - it is recommended to not change the default options unless you really know what this will do, and what will break if you do.
  • Should the script fail you can run it again without having to unpack a new tarball.

From there on, do the usual tarball installation following the Gentoo Handbook.

Linux Kernel

  • Use sys-kernel/pinebookpro-manjaro-sources as the kernel

To install / update a kernel:

  • Mount /boot. Select it with eselect kernel set.
  • Emerge sys-boot/extlinux and sys-boot/u-boot.
  • Install u-boot to the target block device as instructed.
  • Call genkernel all to compile and install the Kernel.
  • Go to the kernel directory (/usr/src/linux) and do make dtbs && make dtbs_install.
  • Lastly, run u-boot-update.
  • Check /boot/extlinux/extlinux.conf for any obvious mistakes.

It's heavily recommended to run the latest mesa, to do so add media-libs/mesa ~arm64 to your /etc/portage/package.accept_keywords . Similarly, running the latest versions of your DE and the underlying Qt / GTK libs is often a good idea.

Changes to the Gentoo repository

I have changed or added some ebuilds via my overlay pinebookpro-overlay . It is installed by the prepare script via eselect-repository.

  • The Kernel ebuild sys-kernel/pinebookpro-manjaro-sources has been added.
  • virtual/linux-sources has been adapted accordingly.
  • The wifi firmware is packaged as sys-firmware/pinebookpro-firmware, from sys-kernel/linux-firmware only rockchip/dptx.bin is needed, the configuration is done by the script (see /etc/portage/savedconfig/sys-kernel/linux-firmware-yyyymmdd)
  • An ebuild for miscellaneous fixes sys-firmware/pinebookpro-misc has been added. Please emerge this after having booted into Gentoo, it will most likely fail in a chroot. It is required for full functionality.
  • An ebuild that applies profile overrides app-portage/pinebookpro-profile-overrides has been added, this is auto-installed and you really really shouldn't uninstall it.

Useful stuff for people new to Gentoo

Ebuilds (the scripts that configure, compile and install a package) are sometimes not released as stable or not released at all for all architectures. This is called keywording: for example, KEYWORDS="amd64 ~arm64" indicates the ebuild is marked stable for amd64, testing for arm64 and masked for all other architectures. You can and will override this a lot by editing /etc/portage/package.accept_keywords . Adding category/package keyword to this file will emerge the latest version that uses the respective keyword. For example, firefox has all LTS releases marked stable and all others marked testing. www-client/firefox ~arm64 would always select the latest release. Dependencies that require keyword changes can be automatically unmasked and the changes merged with dispatch-conf

Known issues

General:

Issue:	The keyboard / touchpad is unresponsive sometimes
Fix:	Make sure you have updated the keyboard / touchpad firmware, see https://github.com/ayufan-rock64/pinebook-pro-keyboard-updater

Issue:	The PBP charges a lot slower after a while, the charging LED starts blinking
Fix	This is a weird safety feature of the battery controller. It usually goes away after charging to full or restarting

Issue:	Wifi bad
Fix:	The wifi powersave seems to be broken, disable it with `iwconfig wlan0 power off` - what an unfortunate naming

gentoo-pinebookpro's People

Contributors

jannik2099 avatar jonastoth avatar nat-henderson avatar nik-- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gentoo-pinebookpro's Issues

zram0 service doesn't work.

The provided zram service does not work.

$ rc-service zram0 start
 * Configure zram0 as swap...
zramctl: /dev/zram0: failed to set algorithm: Invalid argument
 * ERROR: zram0 failed to start

The algorithm its trying to set is lzo_rle while it should be lzo-rle

Apart from the main issue, I thought zram0 service enabled zram0 as swap as soon as you enable it, but it didn't appear to do so. It will be nice if you can includemkswap /dev/zram0 and swapon -p 32767 /dev/zram0 (-p argument to set the zram to have higher priority than other swap) into the service script.

README.md could be clearer on downloading repo

This is for the top level README.md file.

The instructions gloss over how to get the repo on your PBP;

Put the files of this repository into the tarball - preferably into /var/tmp/gentoo-pinebookpro Chroot into the tarball as 

Also missing a period after /var/tmp/gentoo-pinebookpro

I did figure it out, (my experience with GitHub is limited). I think this would suffice;

Put the files of this repository into the tarball - preferably into /var/tmp/gentoo-pinebookpro. You can download a ZIP file using the Repo "Clone or download" button and select Download ZIP. Put the ZIP file in /var/tmp and un-zip it. Rename it with;
mv gentoo-pinebookpro-master gentoo-pinebookpro

I'll try the rest of the instructions now. But, I figure one problem per issue.

Again, thanks for taking on this project. I really want to use Gentoo on my PBP.

grub2-efi+uboot ..... eventually

``
granted the FS layout GPT or mbr > gpt

/boot/efi/ ,
/boot/efi/overlay sym /boot/overlay for compat for uboot files.
boot containing kernels etc...

debian , and a few others can use. to swap kernels
https://valleymarketblog.com/ju8r6/rockchip-uefi.html

RPI3/4 this is better documented. on the switching boot to run grub as boot loader from uboot.
uboot , grub, kernel or force pick ie old kernel if one you built is a dud.. else renaming kernel in boot card....
and naming x-kernel ... is more a having to rag out of sbc and undo on laptop if it goes all fubar.

rome wasn't built in a day.. however making efi boot from uboot and switching kernels would be a plus.
(eventually ..... hopefully this can be done,)

momentioto the rockpro-64 and chroot is up , and pbook-pro sold out , with rpi4-8gigs hopefully they bump the pbook-pro-
ram up as option also.
so far on rpi4/rock64-pro , gentoo kernels/pentoo pentesting kernel etc build without much issues.
and many downstream SBC fixes can be baked in .

grub.use

sysboot/grub libzfs  nls  efiemu   multislot themes sdl device-mapper truetype mount fonts

## arm64 required efi  dev-embedded/u-boot-tools  must be emerged for grub2 to build. 
sysboot/grub grub_platforms_uboot grub_platforms_efi-arm64 grub_platforms_efi-arm32

## woeusb , ie w10 pc / arrch64 usb w10-pc ... or utils like Winpe ...  on Redteam pb-pro/rpi4... 
## wont build w/o grub anyway...  added for compatibility. 
sysboot/grub grub_platforms_pc  grub_platforms_efi-32  grub_platforms_efi-64

### emulation  qemu zen etc placeholder enable if you need. 
## sysboot/grub grub_platforms_emu  grub_platforms_qemu-mips grub_platforms_qemu  grub_platforms_multiboot 
## sysboot/grub  grub_platforms_loongson
### enable XEN/kvm for qemu/kvm docker etc.. emulation for mips/riscv x86 etc. 
## sysboot/grub  grub_platforms_xen -grub_platforms_xen-32

Add network specific USE flags to the prepare script.

Since there are already parameters in the prepare.sh script that enable specific use flags, why not add network-specific use flags as well, since they are quite desired to have in most cases.

diff --git a/helpfile b/helpfile
index 8b30d8b..07a609b 100644
--- a/helpfile
+++ b/helpfile
@@ -4,4 +4,5 @@ option [default] description:
        -h,--help                                       display this help
        --gles2                 [yes]:                  use gles2 instead of OpenGL where applicable. recommended with panfrost
        --wayland               [no]:                   apply patches to allow use of wayland
+       --network               [no]:                   apply NetworkManager, wifi, bluetooth USE flags to enable network management.
        --zram                  [yes]:                  configure zram as swap. I heavily recommend this for Gentoo usage
diff --git a/prepare.sh b/prepare.sh
index ca12d72..8b2206d 100755
--- a/prepare.sh
+++ b/prepare.sh
@@ -37,6 +37,10 @@ while [ "${i}" -le "${j}" ]; do
                wayland=${2}
                ;;
 
+               --network)
+               network=${2}
+               ;;
+
                --zram)
                zram=${2}
                ;;
@@ -87,6 +91,11 @@ if [ "${wayland}" = "yes" ]; then
        echo "installed wayland profile patches. using wayland is NOT recommended right now!!!"
 fi
 
+if [ "${network}" = "yes" ]; then
+       sed -i "s/USE=\"/USE=\"networkmanager wifi bluetooth /" /etc/portage/make.conf
+       echo "installed network profile patches. You might want to install \"net-wireless/bluez\" for bluetooth management."
+fi
+
 if [ "${zram}" != "no" ]; then
        if [ "${init}" = "systemd" ]; then
                install -Dm 644 "${FILES}"/zram/zram0.service /etc/systemd/system/zram0.service

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.