pivpn icon indicating copy to clipboard operation
pivpn copied to clipboard

[BUG] Script attempts to install x64 packages on ARM

Open hoaxlayer opened this issue 6 years ago • 12 comments

In raising this issue, I confirm the following:

{please fill the checkboxes, e.g: [X]}

  • [X] I have read and understood the contributors guide.
  • [X] The issue I am reporting can be replicated.
  • [X] The issue I am reporting can be is directly related to the pivpn installer script.
  • [X] The issue I am reporting isn't a duplicate (see FAQs, closed issues, and open issues).

Describe the bug When attempting to install on ARMbian, the installer script attempts to install amd64 dependencies and packages, making the installation fail.

To Reproduce Steps to reproduce the behavior:

  1. Have an ARMbian installation
  2. Attempt to install using PiVPN script
  3. Select Wireguard as VPN provider
  4. Installation fails with the following messages:
::: Using VPN: WireGuard
::: Installing WireGuard from Debian package...
::: Adding Debian repository...
::: Updating package cache...
:::    Checking for linux-headers-amd64... not installed!
:::    Checking for qrencode... already installed!
:::    Checking for wireguard... not installed!
:::    Checking for wireguard-tools... already installed!
:::    Checking for wireguard-dkms... not installed!
:::    Failed to install linux-headers-amd64!
:::    Failed to install wireguard!
:::    Failed to install wireguard-dkms!

Expected behavior Installer script installs ARM dependencies for the corresponding ARM platform

Screenshots N/A

Desktop (please complete the following information): N/A

Smartphone (please complete the following information): N/A

Additional context

Output of uname -a: Linux tinkerboard 5.4.20-rockchip #20.02.1 SMP PREEMPT Mon Feb 17 05:51:52 CET 2020 armv7l GNU/Linux

Pasting the entire output of the script:

::: sudo will be used for the install.
::: Hostname length OK
::: Verifying free disk space...
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...
[sudo] password for hector:
:::    Checking for git... already installed!
:::    Checking for tar... already installed!
:::    Checking for wget... already installed!
:::    Checking for curl... already installed!
:::    Checking for grep... already installed!
:::    Checking for dnsutils... already installed!
:::    Checking for whiptail... already installed!
:::    Checking for net-tools... already installed!
:::    Checking for bsdmainutils... already installed!
:::    Checking for iptables-persistent... already installed!
::: Using interface: eth0
::: Using User: hector
:::
::: Checking for existing base files...
:::    Checking /etc/.pivpn is a repo...:::    Cloning https://github.com/pivpn/pivpn.git into /etc/.pivpn... done!
::: Using VPN: WireGuard
::: Installing WireGuard from Debian package...
::: Adding Debian repository...
::: Updating package cache...
:::    Checking for linux-headers-amd64... not installed!
:::    Checking for qrencode... already installed!
:::    Checking for wireguard... not installed!
:::    Checking for wireguard-tools... already installed!
:::    Checking for wireguard-dkms... not installed!
:::    Failed to install linux-headers-amd64!
:::    Failed to install wireguard!
:::    Failed to install wireguard-dkms!

hoaxlayer avatar Feb 20 '20 06:02 hoaxlayer

can comfirm this is happening on armbian, i might work on a fix for this today or over the weekend.

this is happening because /ets/os-release identifies armbian as Debian 9 and the script threats it as a regular debian system.

root@rpi04:~# curl -L install.pivpn.io | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     5  100     5    0     0     37      0 --:--:-- --:--:-- --:--:--    37
100   162  100   162    0     0    399      0 --:--:-- --:--:-- --:--:-- 81000
100 81925  100 81925    0     0   109k      0 --:--:-- --:--:-- --:--:--  109k
:::
::: You are root.
::: Hostname length OK
::: Verifying free disk space...
:::
::: Checking apt-get for upgraded packages.... done!
:::
::: Your system is up to date! Continuing with PiVPN installation...
:::    Checking for git... already installed!
:::    Checking for tar... already installed!
:::    Checking for wget... already installed!
:::    Checking for curl... already installed!
:::    Checking for grep... already installed!
:::    Checking for dnsutils... already installed!
:::    Checking for whiptail... already installed!
:::    Checking for net-tools... already installed!
:::    Checking for bsdmainutils... already installed!
:::    Checking for apt-transport-https... already installed!
:::    Checking for iptables-persistent... not installed!
:::    Package iptables-persistent successfully installed!
::: Using User: f0rs3ti
:::
::: Checking for existing base files...
:::    Checking /etc/.pivpn is a repo...:::    Cloning https://github.com/pivpn/pivpn.git into /etc/.pivpn... done!
::: Using VPN: WireGuard
::: Installing WireGuard from Debian package... 
::: Adding Debian repository... 
::: Updating package cache...
:::    Checking for linux-headers-amd64... not installed!
:::    Checking for qrencode... already installed!
:::    Checking for wireguard... not installed!
:::    Checking for wireguard-tools... not installed!
:::    Checking for wireguard-dkms... not installed!
:::    Failed to install linux-headers-amd64!
:::    Failed to install wireguard!
:::    Failed to install wireguard-tools!
:::    Failed to install wireguard-dkms!
root@rpi04:~# uname -a 
Linux rpi04 4.19.62-sunxi #5.92 SMP Wed Jul 31 22:07:23 CEST 2019 armv7l GNU/Linux
root@rpi04:~# cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
VERSION_CODENAME=stretch
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@rpi04:~# 

So untill we make it work, armbian is not a supported os.

To support armbian the best approach is probably pickup the architecture

A way to identify an armbian system would be on debian systems, look `/etc/armbian-release file .. if it exists then its an armbian os.

root@rpi04:~# cat /etc/armbian-release 
# PLEASE DO NOT EDIT THIS FILE
BOARD=bananapim2ultra
BOARD_NAME="Banana Pi M2U"
BOARDFAMILY=sun8i
VERSION=5.69
LINUXFAMILY=sunxi
BRANCH=next
ARCH=arm
IMAGE_TYPE=stable
BOARD_TYPE=csc
INITRD_ARCH=arm
KERNEL_IMAGE_TYPE=zImage

maybe using the architecture as a second point of decision can be good as well.

root@rpi04:~# uname -m
armv7l

edit:

lsb_release also makes tricks the script into thinking its a debian system.

root@rpi04:~# lsb_release -si
Debian
root@rpi04:~# lsb_release -sc
stretch

Guess we might have to start using the architecture as well to better check for the supported OS.

coolapso avatar Feb 20 '20 09:02 coolapso

@hoaxlayer with the limited time i have right now i tried to find a workaround to make it work in the meantime .. The suggestion i had was to remove lsb_release and hack os-relase file however, removing lsb_release will break some dependencies for armbian as well ... so its not really an option.

Guess you will have to wait till me or @orazioedoardo have time to apply the fix for this. I MIGHT have time to do this later today ( I am on CET Time )

coolapso avatar Feb 20 '20 09:02 coolapso

@4s3ti While I think we could help the user installing PiVPN, I'm not sure about officially supporting armbian. From a quick glance (correct me if I'm wrong) I saw a lot of variability between installations, different boards, kernel-headers, architectures.

I don't have a compatible board to test (only raspberry pi) by the way.

orazioedoardo avatar Feb 20 '20 11:02 orazioedoardo

@orazioedoardo I kind of agree with you and gave some thoughts about it as well ... maybe limit the support to armbian on the same arm architectures as the raspberry pis? this way it will work with most "standard" boards and we can still test it on our hardware.

I also have a bananapi running armbian but i can't use it for tests .. however if we make it work on armbian on raspberry it will work as well as long as we stick the support to those architectures.

coolapso avatar Feb 20 '20 12:02 coolapso

I also have a bananapi running armbian but i can't use it for tests .. however if we make it work on armbian on raspberry it will work as well as long as we stick the support to those architectures.

Is there an armbian build for raspberry?

I kind of agree with you and gave some thoughts about it as well ... maybe limit the support to armbian on the same arm architectures as the raspberry pis? this way it will work with most "standard" boards and we can still test it on our hardware.

Well, are kernel headers the same package on all armvsomething builds? Or it depends on the CPU?

orazioedoardo avatar Feb 20 '20 12:02 orazioedoardo

hmm .. yeah .. things might get nasty ...

0rs3ti@rpi04:~$ apt search linux-headers
Sorting... Done
Full Text Search... Done
linux-headers-4.19.0-0.bpo.6-all/stretch-backports 4.19.67-2+deb10u2~bpo9+1 armhf
  All header files for Linux 4.19 (meta-package)

linux-headers-4.19.0-0.bpo.6-all-armhf/stretch-backports 4.19.67-2+deb10u2~bpo9+1 armhf
  All header files for Linux 4.19 (meta-package)

linux-headers-4.19.0-0.bpo.6-armmp/stretch-backports 4.19.67-2+deb10u2~bpo9+1 armhf
  Header files for Linux 4.19.0-0.bpo.6-armmp

linux-headers-4.19.0-0.bpo.6-armmp-lpae/stretch-backports 4.19.67-2+deb10u2~bpo9+1 armhf
  Header files for Linux 4.19.0-0.bpo.6-armmp-lpae

linux-headers-4.19.0-0.bpo.6-common/stretch-backports 4.19.67-2+deb10u2~bpo9+1 all
  Common header files for Linux 4.19.0-0.bpo.6

linux-headers-4.19.0-0.bpo.6-common-rt/stretch-backports 4.19.67-2+deb10u2~bpo9+1 all
  Common header files for Linux 4.19.0-0.bpo.6-rt

linux-headers-4.19.0-0.bpo.6-rt-armmp/stretch-backports 4.19.67-2+deb10u2~bpo9+1 armhf
  Header files for Linux 4.19.0-0.bpo.6-rt-armmp

linux-headers-4.9.0-11-all/oldstable 4.9.189-3+deb9u2 armhf
  All header files for Linux 4.9 (meta-package)

linux-headers-4.9.0-11-all-armhf/oldstable 4.9.189-3+deb9u2 armhf
  All header files for Linux 4.9 (meta-package)

linux-headers-4.9.0-11-armmp/oldstable 4.9.189-3+deb9u2 armhf
  Header files for Linux 4.9.0-11-armmp

linux-headers-4.9.0-11-armmp-lpae/oldstable 4.9.189-3+deb9u2 armhf
  Header files for Linux 4.9.0-11-armmp-lpae

linux-headers-4.9.0-11-common/oldstable 4.9.189-3+deb9u2 all
  Common header files for Linux 4.9.0-11

linux-headers-4.9.0-11-common-rt/oldstable 4.9.189-3+deb9u2 all
  Common header files for Linux 4.9.0-11-rt

linux-headers-4.9.0-12-all/oldstable 4.9.210-1 armhf
  All header files for Linux 4.9 (meta-package)

linux-headers-4.9.0-12-all-armhf/oldstable 4.9.210-1 armhf
  All header files for Linux 4.9 (meta-package)

linux-headers-4.9.0-12-armmp/oldstable 4.9.210-1 armhf
  Header files for Linux 4.9.0-12-armmp

linux-headers-4.9.0-12-armmp-lpae/oldstable 4.9.210-1 armhf
  Header files for Linux 4.9.0-12-armmp-lpae

linux-headers-4.9.0-12-common/oldstable 4.9.210-1 all
  Common header files for Linux 4.9.0-12

linux-headers-4.9.0-12-common-rt/oldstable 4.9.210-1 all
  Common header files for Linux 4.9.0-12-rt

linux-headers-4.9.0-4-common-grsec/stretch-backports 4.9.65-2+grsecunoff1~bpo9+1 all
  Common header files for Linux 4.9.0-4-grsec

linux-headers-5.4.0-4-all/unstable 5.4.19-1 armhf
  All header files for Linux 5.4 (meta-package)

linux-headers-5.4.0-4-all-armhf/unstable 5.4.19-1 armhf
  All header files for Linux 5.4 (meta-package)

linux-headers-5.4.0-4-armmp/unstable 5.4.19-1 armhf
  Header files for Linux 5.4.0-4-armmp

linux-headers-5.4.0-4-armmp-lpae/unstable 5.4.19-1 armhf
  Header files for Linux 5.4.0-4-armmp-lpae

linux-headers-5.4.0-4-common/unstable 5.4.19-1 all
  Common header files for Linux 5.4.0-4

linux-headers-5.4.0-4-common-rt/unstable 5.4.19-1 all
  Common header files for Linux 5.4.0-4-rt

linux-headers-5.4.0-4-rt-armmp/unstable 5.4.19-1 armhf
  Header files for Linux 5.4.0-4-rt-armmp

linux-headers-armmp/oldstable 4.9+80+deb9u10 armhf
  Header files for Linux armmp configuration (meta-package)

linux-headers-armmp-lpae/oldstable 4.9+80+deb9u10 armhf
  Header files for Linux armmp-lpae configuration (meta-package)

linux-headers-cubox/stretch 5.98 armhf
  Linux kernel headers for 4.9.179-cubox on armhf

linux-headers-current-imx6/stretch 20.02.1 armhf
  Linux kernel headers for 5.4.20-imx6 on armhf

linux-headers-current-meson/stretch 20.02.1 armhf
  Linux kernel headers for 5.4.20-meson on armhf

linux-headers-current-mvebu/stretch 20.02.1 armhf
  Linux kernel headers for 4.19.104-mvebu on armhf

linux-headers-current-odroidxu4/stretch 20.02.1 armhf
  Linux kernel headers for 5.4.19-odroidxu4 on armhf

linux-headers-current-rockchip/stretch 20.02.1 armhf
  Linux kernel headers for 5.4.20-rockchip on armhf

linux-headers-current-sunxi/stretch 20.02.1 armhf
  Linux kernel headers for 5.4.20-sunxi on armhf

linux-headers-legacy-mt7623/stretch 20.02.1 armhf
  Linux kernel headers for 4.19.104-mt7623 on armhf

linux-headers-legacy-mvebu/stretch 20.02.1 armhf
  Linux kernel headers for 4.14.171-mvebu on armhf

linux-headers-legacy-odroidxu4/stretch 20.02.1 armhf
  Linux kernel headers for 4.14.170-odroidxu4 on armhf

linux-headers-legacy-rockchip/stretch 20.02.1 armhf
  Linux kernel headers for 4.4.213-rockchip on armhf

linux-headers-legacy-sunxi/stretch 20.02.1 armhf
  Linux kernel headers for 4.19.104-sunxi on armhf

linux-headers-meson/stretch 5.26 armhf
  Linux kernel headers for 3.10.104-meson on armhf

linux-headers-mvebu/stretch 5.91 armhf
  Linux kernel headers for 4.14.135-mvebu on armhf

linux-headers-next-cubox/stretch 5.98 armhf
  Linux kernel headers for 5.3.1-cubox on armhf

linux-headers-next-mvebu/stretch 5.91 armhf
  Linux kernel headers for 4.19.63-mvebu on armhf

linux-headers-next-odroidc1/stretch 5.90 armhf
  Linux kernel headers for 5.1.15-odroidc1 on armhf

linux-headers-next-odroidxu4/stretch 5.99 armhf
  Linux kernel headers for 4.14.150-odroidxu4 on armhf

linux-headers-next-rockchip/stretch 5.95 armhf
  Linux kernel headers for 4.19.69-rockchip on armhf

linux-headers-next-sunxi/stretch 5.92 armhf
  Linux kernel headers for 4.19.62-sunxi on armhf

linux-headers-next-udoo/stretch 5.90 armhf
  Linux kernel headers for 4.4.167-udoo on armhf

linux-headers-odroidc1/stretch 5.38 armhf
  Linux kernel headers for 3.10.107-odroidc1 on armhf

linux-headers-odroidxu4/stretch 5.99 armhf
  Linux kernel headers for 4.14.150-odroidxu4 on armhf

linux-headers-rockchip/stretch 5.95 armhf
  Linux kernel headers for 4.4.190-rockchip on armhf

linux-headers-rt-armmp/stretch-backports 4.19+105+deb10u1~bpo9+1 armhf
  Header files for Linux rt-armmp configuration (meta-package)

linux-headers-s500/stretch 5.26 armhf
  Linux kernel headers for 3.10.105-s500 on armhf

linux-headers-sun4i/stretch 5.38 armhf
  Linux kernel headers for 3.4.113-sun4i on armhf

linux-headers-sun5i/stretch 5.31 armhf
  Linux kernel headers for 3.4.113-sun5i on armhf

linux-headers-sun7i/stretch 5.85 armhf
  Linux kernel headers for 3.4.113-sun7i on armhf

linux-headers-sun8i/stretch 5.85 armhf
  Linux kernel headers for 3.4.113-sun8i on armhf

linux-headers-udoo/stretch 5.38 armhf
  Linux kernel headers for 3.14.79-udoo on armhf

linux-headers-udoo-neo/stretch 5.35 armhf
  Linux kernel headers for 3.14.79-udoo-neo on armhf

Also:

f0rs3ti@rpi04:~$ uname -a
Linux rpi04 4.19.62-sunxi #5.92 SMP Wed Jul 31 22:07:23 CEST 2019 armv7l GNU/Linux

coolapso avatar Feb 20 '20 13:02 coolapso

Removing bug tag as this is not really a bug!

coolapso avatar Feb 20 '20 13:02 coolapso

@orazioedoardo with this latest outputs ... guess i have to agree with you on not supporting armbian at all ... will add a lot of complexity that we can't handle at the moment...

lots of different variables.. lots of different boards which we can't really test. =/

coolapso avatar Feb 20 '20 13:02 coolapso

@orazioedoardo nope .. after a quick scan seems there is no armbian for raspberry pi.

Having this said... @hoaxlayer I am sorry, but after checking and investigating ...

We cannot support armbian at this point ... to many variables for us to support it on top of the requirement for hardware.

each board a different firmware therefore different kernel headers lots of logic to support behind that.

I am sorry for this and thank you for understanding.

Closing the issue.

coolapso avatar Feb 20 '20 19:02 coolapso

By the way @hoaxlayer, you should be able to continue the installation by editing the script from “ linux-headers-amd64” to the correct kernel headers package for your device.

orazioedoardo avatar Feb 21 '20 08:02 orazioedoardo

yeah .. will pick that info and put it on the wiki latter on about armbian so people can at least hack the thing around.

coolapso avatar Feb 21 '20 08:02 coolapso

For anybody coming here from trying to use the script with armbian, and installing wireguard, on a random sbc board, you just have to edit line 1298 from the script:

1296                 if [ "$WIREGUARD_BUILTIN" -eq 0 ]; then
1297                         # Explicitly install the module if not built-in
1298                         PIVPN_DEPS+=(linux-headers-current-sunxi wireguard-dkms)
1299                 fi

Make sure that you put the correct headers (in my case was -sunxi), looking for what kernel are you using (uname -r).

sucotronic avatar Dec 01 '20 09:12 sucotronic