ARM development: next steps

arm

(Mark Verlinde) #41

getting closer

Install from new repositories :grinning:

hurdles on first site:

  • the already mentioned comps groups, not all modules showing up in software center are available
  • nextcloud being a noarch which differs from x86_64 (remi php72)
  • probably a lot more…

#42

great! :+1:
let me know if i can help in testing…


(Mark Verlinde) #43

well here is problem…

I did import all keys upfront

rpm --import /etc/pki/rpm-gpg/*

a manual install

yum install @nethserver-directory

answering y to all key suggestions and its oke…

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NethServer-7
Importing GPG key 0x39BAF5C1:
 Userid     : "NethServer 7 (NethServer 7 Official Signing Key) <security@nethserver.org>"
 Fingerprint: 594c 3fd8 fae1 8ff5 32fe ae23 9cb2 8ea0 39ba f5c1
 Package    : nethserver-release-7-11.ns7.noarch (@nethserver-arm-base/$releasever)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-NethServer-7
Is this ok [y/N]: y
nethserver-base/7/armhfp/signature                                               | 2.9 kB  00:00:14 !!!
nethserver-updates/7/armhfp/signature                                            |  836 B  00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NethServer-7
Importing GPG key 0x39BAF5C1:
 Userid     : "NethServer 7 (NethServer 7 Official Signing Key) <security@nethserver.org>"
 Fingerprint: 594c 3fd8 fae1 8ff5 32fe ae23 9cb2 8ea0 39ba f5c1
 Package    : nethserver-release-7-11.ns7.noarch (@nethserver-arm-base/$releasever)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-NethServer-7
Is this ok [y/N]: y

After this installs work form the software center too.

cc/@giacomo @davidep


(Davide Principi) #44

Probably uname -m doesn’t work as expected here

https://github.com/DavidePrincipi/nethserver-base/blob/8fa2c83ac6c11acf26e8a4d8d90f9a1e2cff0825/root/etc/e-smith/events/actions/nethserver-base-import-repokeys


(Mark Verlinde) #45

good catch !

# uname -m
armv7l

Did I mention naming of arm32 bit is mess before ? (just kidding although true… :disappointed_relieved:)


(Davide Principi) #46

We need to extract the YUM arch… :thinking:


(Mark Verlinde) #47
# python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
Loaded plugins: fastestmirror, nethserver_events
{'arch': 'armv7hnl',
 'basearch': 'armhfp',
 'contentdir': 'altarch',
 'infra': 'stock',
 'kvariant': 'rpi2',
 'nsrelease': '',
 'releasever': '7',
 'uuid': 'a0cc8187-be28-43ab-a87f-9e05463a0a9b'}

does this help?


#48

or if you have proxmox 5.3, a good server and (a lot of) patience :sweat_smile: you can use proxmox for aarch64, or at least i just managed to install centos 7.6 aarch64… a little bit slow but it seems to work


(Alessio Fattorini) #49

:rainbow:


(Mark Verlinde) #50

To manage this nethserver-arm-epel with exclusive arch armv7hl is provided. To “fool” yum this package provides “epel-release”. This breaks with the old caution not to imply a official epel-release is available. Opted for this to be compatible with nethserver-release.

Since we shifted to zram, we have a noarch package to set zram-swap up. I wonder if this package could live in the x86_64 too? And with this in all repo’s which would make image creation a bit more straight forward. Not a big deal just a bit cleaner…

EDIT:
If we can agree on the above i would like to ship ownership of the git repository’s to nethserver.


(Giacomo Sanchietti) #51

Yes, I think we can put it also on x86_64.
Can you give me the pointer to the RPM or repo, just to make a couple of checks?


(Mark Verlinde) #52

package:
http://packages.nethserver.org/nethserver/7.6.1810/arm-base/armhfp/Packages/zram-0.2-2.ns7.noarch.rpm
source-package:
http://packages.nethserver.org/nethserver/7.6.1810/arm-base/Source/SPackages/zram-0.2-2.ns7.src.rpm


(Giacomo Sanchietti) #53

Something seems broken on my machine:

Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: mkswap: only one device argument is currently supported
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: Usage:
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: mkswap [options] device [size]
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: Options:
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -c, --check               check bad blocks before creating the swap area
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -f, --force               allow swap size area be larger than device
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -p, --pagesize SIZE       specify page size in bytes
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -L, --label LABEL         specify label
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -v, --swapversion NUM     specify swap-space version number
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -U, --uuid UUID           specify the uuid to use
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -V, --version             output version information and exit
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: -h, --help                display this help and exit
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed zramctl:: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed /dev/zram0:: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed failed: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed to: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed reset:: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed Device: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed or: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed resource: No such file or directory
Dec 14 14:54:16 test.local.neth.eu zramstart[4437]: swapon: stat failed busy: No such file or directory

I will spend some time on it and let you know.


(Mark Verlinde) #54

OOPS…, maybe i did over see something :hushed:
We running a quite old kernel on centos (3.10.xx) which may not provide multithreading for zram…will investigate too!


(Giacomo Sanchietti) #55

This is the fix for x86_64:

--- /usr/sbin/zramstart	2018-07-19 17:07:17.000000000 +0000
+++ /usr/sbin/zramstart.new	2018-12-14 15:17:55.589046330 +0000
@@ -12,8 +12,15 @@
 # zram in recent kernels is multitreaded so we don't need to balance across CPUs
 modprobe -q zram num_devices=1
 
+# Lz4 is not supported on CentOS kernel for x86_64
+arch=$(uname -m)
+if [ "$arch" == "x86_64" ]; then
+    algorithm="lzo"
+else
+    algorithm="lz4"
+fi
 # Create ZRAM with first device, lz4 algorithm
-zramdev=$(zramctl --find --algorithm lz4 --size ${zram_size}MB 2>&1)
+zramdev=$(zramctl --find --algorithm $algorithm --size ${zram_size}MB 2>&1)
 # The above returns the device. Use it below
 mkswap $zramdev
 swapon $zramdev
@@ -21,4 +28,10 @@
 # Investigate this and swapiness
 # echo 0 > /proc/sys/vm/page-cluster
 
-echo -e "\nActivated ZRAM swap device of ${zram_size} MB\n"
+if [ $? -gt 0 ]; then
+    echo -e "\nError during $zramdev activation!\n"
+    exit 1
+else
+    echo -e "\nActivated ZRAM swap device of ${zram_size} MB\n"
+    exit 0
+fi

Is there any place where I can open a PR?


(Mark Verlinde) #56

(Giacomo Sanchietti) #57

Doh! I looked for it but I didn’t find before your post :slight_smile:

Pull request done!

Edit:
I know that @filippo_carletti is curious to test it


(Mark Verlinde) #58

Thanx! (merged)

Actually i did doubt very long to use lz4 on arm because of the not fully optimized SIMD instruction-set. But after reading concluded it should be in-par with x86_64 by now… so i went for it as lz4 outperforms lzo…


(Mark Verlinde) #59

In arm-testing:
http://packages.nethserver.org/nethserver/7.6.1810/arm-testing/armhfp/Packages/zram-0.3-1.ns7.noarch.rpm

# rpm -qa | grep zram
zram-0.3-1.ns7.noarch
# uname -m
x86_64
# systemctl status zram-swap
● zram-swap.service - Enable compressed swap in memory using zram
   Loaded: loaded (/usr/lib/systemd/system/zram-swap.service; disabled; vendor preset: disabled)
   Active: active (exited) since Fri 2018-12-14 16:48:07 CET; 1min 40s ago
   Process: 3975 ExecStart=/usr/sbin/zramstart (code=exited, status=0/SUCCESS)
   Main PID: 3975 (code=exited, status=0/SUCCESS)

   .... systemd[1]: Starting Enable compressed swap in memory using zram...
   .... zramstart[3975]: Setting up swapspace version 1, size = 1389648 KiB
   .... havak.lan zramstart[3975]: no label, UUID=610583f7-90a4-46d4-ae66-b983e23d9073
   .... systemd[1]: Started Enable compressed swap in memory using zram.
   .... zramstart[3975]: Activated ZRAM swap device of 1423 MB

(Giacomo Sanchietti) #60

Tested on a production machine (VPS) with low load: it works so far :wink: