Quantcast
Channel: Linux Device Hacking - Debian
Viewing all 26616 articles
Browse latest View live

Re: Basic steps in building Linux modules

$
0
0
yuko1225,

I would look at the makefile or the build script of the module source being built. It might be too old. To see more details, I would need actually build it myself.

This is a basic Debian rootfs. So anything more than Debian build-essential, you might need a particular module build set up script or a particular makefile.

Re: Basic steps in building Linux modules

$
0
0
bodhi Wrote:
-------------------------------------------------------
> yuko1225,
>
> I would look at the makefile or the build script
> of the module source being built. It might be too
> old. To see more details, I would need actually
> build it myself.
>
> This is a basic Debian rootfs. So anything more
> than Debian build-essential, you might need a
> particular module build set up script or a
> particular makefile.

The cryptodev module has just released v1.10 this year. It doesn't looks like an abandoned project.
https://github.com/cryptodev-linux/cryptodev-linux
The install instruction is also pretty straight forward. make > make install

In fact, TheFeaR in that thread mentioned if cross-complied it has no problem to build. So something must be missing whatever it is...

I will try to cross-compile it if there is really no other solution.That's gonna be a headache

Re: Basic steps in building Linux modules

$
0
0
> The cryptodev module has just released v1.10 this
> year. It doesn't looks like an abandoned project.
> https://github.com/cryptodev-linux/cryptodev-linux
> The install instruction is also pretty straight
> forward. make > make install

> In fact, TheFeaR in that thread mentioned if
> cross-complied it has no problem to build. So
> something must be missing whatever it is...

Sounds to me the author has made a bad assumption about the build environment. It should be OK to build it natively with a basic Debian debootstrap system where build-essential package was installed. If it is not enough, then there should be a script or some extra steps documented.

Re: Debian Installation on Thecus N2350 (Marvell Armada 385)

$
0
0
Hi bodhi,

Thanks for the Update. I upgraded to your Kernel 5.2.9 and also updated the envs.
I also upgraded to Debian Buster and got the MAC address problem, which has been described in another thread. I just hardcoded the address now.

Otherwise everything works fine. Thanks again!
Cheers, Manuel

Re: Debian Installation on Thecus N2350 (Marvell Armada 385)

$
0
0
Hi Manuel,

> I also upgraded to Debian Buster

Cool!

> and got the MAC
> address problem, which has been described in
> another thread. I just hardcoded the address now.

But the MAC address problem does not show up on my Thecus N2350 :). I have not posted this info because I wanted to track it down on the NAS326.

However, let's compare the system info on our boxes.

Thecus N2350
Linux version 5.2.9-mvebu-tld-1 (root@tldDebianVM) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #1 SMP PREEMPT Mon Aug 19 12:47:39 PDT 2019
Debian 10.0
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial
uboot_version=U-Boot 2013.01 (Nov 12 2018 - 20:56:19) Marvell version: 2015_T1.0p18-tld-4


root@tldDebian:~# dpkg -l | grep udev
ii  libgudev-1.0-0:armel                   232-2                         armel        GObject-based wrapper library for libudev
ii  libudev0:armel                         175-7.2                       armel        libudev shared library
ii  libudev1:armel                         241-5                         armel        libudev shared library
ii  udev                                   241-5                         armel        /dev/ and hotplug management daemon


root@tldDebian:~# dmesg | grep -i mac
[    0.000000] OF: fdt: Machine model: Thecus N2350
[    4.172727] mvneta f1070000.ethernet eth0: Using hardware mac address 00:14:xx:xx:xx:xx
[   25.068216] systemd-udevd[1790]: Could not generate persistent MAC address for ip6tnl0: No such file or directory

Note that ipv6 error is not relevant.

root@tldDebian:~# sysctl -a | grep ipv6 | grep disable
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.all.disable_policy = 0
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.default.disable_policy = 0
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_policy = 0
net.ipv6.conf.ip6tnl0.disable_ipv6 = 1
net.ipv6.conf.ip6tnl0.disable_policy = 0
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.lo.disable_policy = 0
net.ipv6.conf.sit0.disable_ipv6 = 1
net.ipv6.conf.sit0.disable_policy = 0

I got to the point where I think u-boot version seems to be the only difference. But I need to lok at the DTS to see there is difference between the N2350 and NAS326, regarding ethernet.

Re: Basic steps in building Linux modules

$
0
0
bodhi Wrote:
-------------------------------------------------------
> > The cryptodev module has just released v1.10
> this
> > year. It doesn't looks like an abandoned
> project.
> >
> https://github.com/cryptodev-linux/cryptodev-linux
> > The install instruction is also pretty straight
> > forward. make > make install
>
> > In fact, TheFeaR in that thread mentioned if
> > cross-complied it has no problem to build. So
> > something must be missing whatever it is...
>
> Sounds to me the author has made a bad assumption
> about the build environment. It should be OK to
> build it natively with a basic Debian debootstrap
> system where build-essential package was
> installed. If it is not enough, then there should
> be a script or some extra steps documented.


I just cross-compiled it with the kernel source tree on a freshly debootstrap system. No special setup and no issue at all.

The debian on my plug has no issue to build non-kernel related package either. I've already rebuild the openssl and openssh on it.

Re: Basic steps in building Linux modules

$
0
0
yuko1225,

> The debian on my plug has no issue to build
> non-kernel related package either. I've already
> rebuild the openssl and openssh on it.

Please be more specific! which Debian, running which kernel, and which plug?

Re: Basic steps in building Linux modules

$
0
0
Sorry for that.

Pogoplug V4 Mobile. Debian buster. 5.2.9-kirkwood-tld-1.

The debootstrap system was also debian buster, build on debian jessie kernel. The kernel source tree was 5.2.9 applied with the patch in your kernel package.

I tried both way to compile it. Out of the tree and within the tree. Both succeed. The in-tree Makefiles configuration was:
obj-$(CONFIG_CRYPTO_OCF_CRYPTODEV) += cryptodev.o
cryptodev-objs := ioctl.o main.o cryptlib.o authenc.o zc.o util.o
With its own headers file put in the include path.

The out of tree is just pretty much straight forward. Edit the Makefiles to reflect the real kernal path
KERNEL_DIR ?= /usr/src/linux-5.2.9

Set the cross-complie variables
ARCH=arm
CROSS_COMPILE=arm-linux-gnueabi-
Then "make" it.

I'm probably gonna make a new thread about the HW/Crypto on the new debian buster, and share my pre-compiled binary. But it would be great if I can just compile it on device.

Re: Pogoplug V4 lost power, boots but will not get IP address for SSH

$
0
0
This may be a bit off topic.

I have some Android TV Boxes running on CoreELEC OS. If I pull/plug back the power cord, it won't boot any longer (similar to what you explained above). As it turns out, the partition tables (MSDOS and EXT4) got corrupted. Yes, the uboot on an Android TV Box expects an MSDOS partition to contain the SYSTEM image to boot (if I understand correctly). So, I just take the USB memory stick that contains the CoreELEC OS to a Linux desktop computer to clean/remove the dirty bits/inodes. I use the following to clean the dirty bits on the MSDOS partition
/sbin/dosfsck -aw <MSDOS partition>
and
/sbin/fsck.ext4 -fy <EXT4 partition>
to clean the EXT4 partition. When problem like this happens so often, due to power outages, etc., it will become cumbersome. So, I wrote a simple checkdisk shell scripts utility (attached below) to detect the partition type, i.e. ext, ext2, ext3, ext4, and vfat, then use it to select which disk utility to clean the partition. By no means this shell script utility is complete and it does lack an intelligence to check if the partition is mounted or not. I hope such a simple shell script utility will benefit anyone.

Re: Basic steps in building Linux modules

$
0
0
yuko1225,

Thanks very much for the info!

I think mieki test case, and alexr test case, and your test cases are very useful to track down the problem.

Hope I will have sometime to do some further tests.

[EXPERIMENTAL]Hardware Crypto on kickwood device with debian buster

$
0
0
!!WARNING!!


!!EXPERIMENTAL!! This is not a drill. Using these codes/binaries/instructions may result DATA LOSS/DATA CORRUPTION/BRICK DEVICE/SECURITY VULNERABLE etc. USE AT YOUR OWN RISK

This article is not for beginner. You must understand what you are doing.

Skip to the the bottom if you just want the pre-compiled cryptodev binaries for bodhi's 5.2.9 Kirkwood kernel/debian buster.

Marvell CESA support these "usable" offload cipher/digest:
AES128-CBC/AES192-CBC/AES256-CBC
SHA1/SHA256

In debian 10 we have 2 ways to utilize HW Crypto on userland program.
  1. AF_ALG
    Pro: Builtin by debian buster. Somewhat more compatible/reliable than cryptodev.
    Con: Inefficiency.
    Have compatibility issue with latest openssh on debian buster(we will cover that).
     
  2. cryptodev
    Pro: Efficiency. Much lower overhead means MUCH MORE THROUGHPUT and more precious CPU cycles available for other usage. Zero copy is real.
    Con: Additional module required.
    Have compatibility issue with openssh too(WTH openssh?)
Both are disabled by default.

AF_ALG

Install: You can enable AF_ALG by editing the /etc/ssl/openssl.cnf. Make sure you have something like these in the configuration:
openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect
engines = afalg_sect

[afalg_sect]
afalg = afalg_engine_on

[afalg_engine_on]
default_algorithms = ALL
init = 1
Verify: "openssl engine". If you see
(dynamic) Dynamic engine loading support
(afalg) AFALG engine support
then it's working. And you have to use either AES128-CBC/AES192-CBC/AES256-CBC in the specific program's cipher setting. I'm not going to cover those setting.
Quote

BTW I'm not a cryptography expert but as far as I know CBC mode is still "acceptable safe" to date as long as you have all the security patch and TLS ver ≥1.1. This is certainly not the most secure mode anymore and it may become unsafe in the future. You have been warned

Known issue:
You may notice the openssh isn't providing either of those cipher by default...And when you explicit setting it. Boom(I did warned you). Check debian bug#931272 for details.

In short. We need to rebuild openssh without seccomp support(seccomp isn't enforced by default until debian buster. But again these procedure weaken the security a bit)
apt source openssh
cd openssh-x.x.x

# Edit debian/rules and add it to common build options:
confflags += --with-sandbox=no

dpkg-buildpackage -b -us

# After finished. Install the debs and job done
You can freeze the openssh version by "apt-mark hold" to avoid accidently update your openssh.
Just keep in mind this will prevent you from receiving openssh security updates. You have to rebuild on every release for the security.
Or...you could just disable the offload cipher for openssh(default).

cryptodev

It's the most unreliable and yet most speed solution amount these two. If anything there that most are likely to corrupt your data. This is it. Additional modules are required, both kernel and openssl.

Kernel: You have to use the latest source from their github or it won't work on 5.x kernel. And so far it's not compiled on bodhi's headers files for some reason.

I just cross-compiled it. The kernel module binary is on attachment. (cryptodev.zip )

OpenSSL: Until recently you still have to re-compile the whole openssl for the cryptodev support(now called devcrypto). To make matter worse after you done that it become a builtin-engine. YOU COULD NOT DISABLE a builtin-engine unless unload the kernel module. Not even mention it could break your openssh almost entirely...

But luckily openssl source tree has just made it become a module instead a builtin-engine. Some bugs were also fixed(no longer breaking openssh as long as you not using the offloaded cipher). So I backport the module to the buster's openssl1.1.1. which is available in attachment

There are two version of it. devcrypto-with-hash has the offload digest(md5/sha) support, which is straight from official source. devcrypto-wo-hash does not as I strip the digest codes.
Depends on the scenario. Offload digest has the advantage on hashing big files, however its calling overhead is so big it's not suitable for any SSL/TLS application(benchmark #2). You can choose either of them.

Install: Extract and put the "devcrypto.so" directly into "/usr/lib/arm-linux-gnueabi/engines-1.1"
Verify: run "openssl engine devcrypto". If you see:
(devcrypto) /dev/crypto engine
then it's working.

Enable procedure is same as af_alg. Just replace "afalg" with "devcrypto".

Known issue:
It will break openssh connection if you enable this engine with offloaded cipher(i.e. aes128-cbc) setting in sshd_config(which is not default). Unlike af_alg I didn't find any workaround.


Wanna use both? No problem

Openssl support "OPENSSL_CONF" as environment var. You can make another openssl.cnf with different engine. Then pass the file path to the executable with OPENSSL_CONF. For example:
OPENSSL_CONF=/path/to/engine/afalg.cnf sshd


Q&A:
Q. Why there are so many useless blahblah. I just want more specific commands
A. It's not for the beginner and it's EXPERIMENTAL.

Q. My ssh is not working anymore.
A. Remove the configuration and modules.

Q. My encrypted data corrupted.
A. You have been warned.

Special thanks to https://wiki.kobol.io/cesa/ and bodhi

Re: [EXPERIMENTAL]Hardware Crypto on kickwood device with debian buster

$
0
0
Some benchmark data:
afalg
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
md4               2726.01k     9899.47k    28302.85k    53200.55k    71799.18k    72280.75k
md5               2625.19k     9330.60k    25486.68k    45179.90k    58669.01k    58753.02k
sha1              2188.28k     6818.59k    15705.26k    23391.23k    27354.16k    27404.97k
sha256            1840.12k     5431.52k    11735.13k    16643.60k    18844.33k    18939.90k
sha512             778.58k     3122.15k     5083.82k     7319.37k     8358.57k     8415.91k
seed-cbc          5693.44k     7706.43k     8422.74k     8627.54k     8709.82k     8639.83k
rc2-cbc           5224.49k     6622.80k     7093.43k     7194.97k     7252.25k     7214.42k
bf-cbc            7268.60k    10372.84k    11559.94k    11912.53k    12046.90k    11922.09k
des-cbc           4288.39k     5335.16k     5659.48k     5743.96k     5748.10k     5707.09k
des-ede3          1723.80k     1809.87k     1826.56k     1831.59k     1835.67k     1829.55k
aes-128-cbc       2579.47k     5126.40k    37242.09k    93696.00k   472064.00k  1726873.60k
aes-192-cbc       2386.95k     6854.04k    40614.40k    75550.72k  1373798.40k   949335.77k
aes-256-cbc       1830.59k     4253.57k    21097.74k    65055.17k   383561.14k  3215360.00k
camellia-128-cbc     6490.68k     9034.51k     9967.62k    10240.68k    10345.48k    10245.46k
camellia-192-cbc     5506.95k     7239.62k     7821.06k     8010.49k     8055.01k     7989.93k
camellia-256-cbc     5511.83k     7241.08k     7848.07k     7986.86k     8055.01k     7989.93k
rc4              16598.09k    30880.30k    39285.73k    41978.88k    43020.33k    42456.41k
cast5-cbc         7458.77k    10820.39k    12153.51k    12546.39k    12688.01k    12539.22k


cryptodev(w/o hash)
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
md4               2730.04k     9907.48k    28282.45k    53376.77k    71581.70k    72522.49k
md5               2629.28k     9325.29k    25475.84k    45209.77k    58310.66k    58960.48k
sha1              2190.21k     6815.64k    15703.38k    23472.20k    27265.71k    27496.63k
sha256            1844.86k     5449.43k    11740.16k    16647.36k    18741.63k    18939.90k
sha512             779.98k     3122.11k     5082.79k     7326.91k     8355.84k     8415.91k
seed-cbc          5691.25k     7714.28k     8423.68k     8657.95k     8647.73k     8641.33k
rc2-cbc           5223.35k     6607.56k     7082.73k     7198.14k     7233.07k     7216.63k
bf-cbc            7274.26k    10349.31k    11569.23k    11921.21k    11940.12k    11963.62k
des-cbc           4294.40k    11718.76k    56279.04k   363929.60k  4554342.40k  5327257.60k
des-ede3          1727.72k     1806.92k     1828.30k     1831.90k     1830.19k     1830.19k
aes-128-cbc       3035.58k    26244.80k    83916.80k   192630.15k  2557269.33k  6864896.00k
aes-192-cbc       7371.20k    11073.35k    60295.31k   309478.40k         infk         infk
aes-256-cbc       5693.69k    13964.37k    76078.55k   297280.00k  1018616.69k  1241907.20k
camellia-128-cbc     6490.53k     9041.59k    10040.46k    10282.27k    10347.21k    10286.73k
camellia-192-cbc     5527.48k     7243.25k     7824.78k     7959.85k     8027.61k     7989.25k
camellia-256-cbc     5526.06k     7242.85k     7823.41k     7987.54k     8027.61k     7989.25k
rc4              16624.75k    30802.43k    39232.74k    41942.97k    42899.78k    42368.26k
cast5-cbc         7450.82k    10795.54k    12192.90k    12590.05k    12694.85k    12553.76k

cryptodev(w/ hash)
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
md4                897.74k     3469.98k    12148.91k    32712.18k    64413.70k    68253.88k
md5                 87.90k         infk         infk         infk         infk   537559.04k
sha1               148.20k      486.69k         infk         infk         infk         infk
sha256             727.84k     2551.00k     7322.46k    13628.07k    18334.74k    18617.69k
sha512             499.44k     1990.01k     4102.86k     6690.62k     8254.81k     8389.27k
seed-cbc          5683.63k     7685.69k     8455.22k     8661.39k     8714.31k     8670.32k
rc2-cbc           5215.58k     6604.48k     7075.02k     7200.54k     7198.86k     7235.35k
bf-cbc            7264.97k    10384.06k    11610.46k    11959.84k    12051.59k    11969.12k
des-cbc           4646.25k    14082.99k    40109.10k   189227.32k  3036228.27k 10874060.80k
des-ede3          1725.57k     1810.51k     1834.52k     1839.08k     1830.19k     1818.62k
aes-128-cbc       4566.25k    13542.40k    64393.85k   226471.56k  2561092.27k  3304652.80k
aes-192-cbc       5610.67k    13107.20k    64462.77k   164181.33k  1478000.64k         infk
aes-256-cbc       5388.98k    13924.69k    39745.83k   347092.11k         infk  6188236.80k
camellia-128-cbc     6494.38k     9015.95k     9976.89k    10247.53k    10318.08k    10240.00k
camellia-192-cbc     5503.89k     7243.23k     7852.41k     7994.05k     8057.30k     7994.73k
camellia-256-cbc     5508.82k     7221.75k     7826.66k     8017.78k     8023.18k     8015.47k
rc4              16656.05k    31008.67k    39310.09k    42158.56k    43054.73k    42642.38k
cast5-cbc         7443.69k    10798.19k    12192.82k    12596.59k    12649.65k    12553.76k

Re: Debian Installation on Thecus N2350 (Marvell Armada 385)

$
0
0
Hi bodhi,

Quote
bodhi
However, let's compare the system info on our boxes.

How did you get that information?

mjung@vega:~$ dpkg -l | grep udev
ii  libgudev-1.0-0:armhf                 232-2                           armhf        GObject-based wrapper library for libudev
ii  libinput-bin                         1.12.6-2                        armhf        input device management and event handling library - udev quirks
ii  libudev1:armhf                       241-5                           armhf        libudev shared library
ii  udev                                 241-5                           armhf        /dev/ and hotplug management daemon

mjung@vega:~$ dmesg | grep -i mac 
[    0.000000] OF: fdt: Machine model: Thecus N2350
[    4.119846] mvneta f1070000.ethernet eth0: Using random mac address 7e:ee:ba:fa:20:8b
[   17.225243] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)

mjung@vega:~$ sudo sysctl -a | grep ipv6 | grep disable 
net.ipv6.conf.all.disable_ipv6 = 0
net.ipv6.conf.all.disable_policy = 0
net.ipv6.conf.default.disable_ipv6 = 0
net.ipv6.conf.default.disable_policy = 0
net.ipv6.conf.eth0.disable_ipv6 = 0
net.ipv6.conf.eth0.disable_policy = 0
net.ipv6.conf.ip6tnl0.disable_ipv6 = 0
net.ipv6.conf.ip6tnl0.disable_policy = 0
net.ipv6.conf.lo.disable_ipv6 = 0
net.ipv6.conf.lo.disable_policy = 0
net.ipv6.conf.sit0.disable_ipv6 = 0
net.ipv6.conf.sit0.disable_policy = 0

I think it might be possible that i had the problem with random MAC addresses also before the upgrade, but i did not keep the customized hard coded MAC address in the config file, but chose the new one from the package maintainer - not sure about that.

Cheers, Manuel

Re: Debian Installation on Thecus N2350 (Marvell Armada 385)

$
0
0
Manuel,

> How did you get that information?

I have an alias that include all the following commands that I can run to get a summary of system info at a glance.

dmesg | grep -i machine | cut -c40-120
Thecus N2350

uname -a
Linux version 5.2.9-mvebu-tld-1 (root@tldDebianVM) (gcc version 7.4.0 (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1)) #1 SMP PREEMPT Mon Aug 19 12:47:39 PDT 2019

cat /etc/debian_version
Debian 10.0

cat /proc/cmdline
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial

fw_printenv uboot_version  # I usually set u-uboot_version env so I can tell from Debian which version I've installed)
uboot_version=U-Boot 2013.01 (Nov 12 2018 - 20:56:19) Marvell version: 2015_T1.0p18-tld-4


> I think it might be possible that i had the
> problem with random MAC addresses also before the
> upgrade, but i did not keep the customized hard
> coded MAC address in the config file, but chose
> the new one from the package maintainer - not sure
> about that.

I always have persistent MAC address on this Thecus N2350 box since we added the alias eth0 to the DTS!

So it is still a mystery why we have the same box, same kernel but the MAC address behavior is different :)

Re: Debian Installation on Thecus N2350 (Marvell Armada 385)

$
0
0
bodhi Wrote:
-------------------------------------------------------
> Manuel,
>
> dmesg | grep -i machine | cut -c40-120
> Thecus N2350
> 
> uname -a
> Linux version 5.2.9-mvebu-tld-1 (root@tldDebianVM)
> (gcc version 7.4.0 (Ubuntu/Linaro
> 7.4.0-1ubuntu1~18.04.1)) #1 SMP PREEMPT Mon Aug 19
> 12:47:39 PDT 2019
> 
> cat /etc/debian_version
> Debian 10.0
> 
> cat /proc/cmdline
> console=ttyS0,115200 root=LABEL=rootfs
> rootdelay=10
> mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr)
> earlyprintk=serial
> 
> fw_printenv uboot_version  # I usually set
> u-uboot_version env so I can tell from Debian
> which version I've installed)
> uboot_version=U-Boot 2013.01 (Nov 12 2018 -
> 20:56:19) Marvell version: 2015_T1.0p18-tld-4
>

Thecus N2350
Linux vega 5.2.9-mvebu-tld-1 #1 SMP PREEMPT Mon Aug 19 12:47:39 PDT 2019 armv7l GNU/Linux
10.0
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=pxa3xx_nand-0:-(ubifs);spi1.0:0x00400000(uboot),0x00010000@0x00100000(uboot_env),0x00010000@0x00300000(uboot_scr) earlyprintk=serial

> So it is still a mystery why we have the same box,
> same kernel but the MAC address behavior is
> different :)
Yap, weird. I have also no idea at the moment.

Re: Debian on Dell Kace M300

$
0
0
So I've been playing with Nextcloud trying to get it optimized for best performance. It does work much better on this M300 than an E02 for example. The extra memory really helps a lot. The real achilles heel though is the single core CPU. Performance is fairly good until you try to view images, which bogs down the CPU pretty quickly:

top - 12:26:38 up 4 min,  1 user,  load average: 1.52, 0.67, 0.26
Tasks: 100 total,   3 running,  97 sleeping,   0 stopped,   0 zombie
%Cpu(s): 99.0 us,  0.7 sy,  0.0 ni,  0.0 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st
MiB Mem :   1762.2 total,   1427.4 free,    152.4 used,    182.5 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   1559.8 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                      
 1649 www-data  20   0  335920  85740  49260 R  49.5   4.8   0:09.86 php-fpm7.3                                                                                                   
 1647 www-data  20   0  320476  87460  49420 R  49.2   4.8   0:25.76 php-fpm7.3                                                                                                   
 1726 redis     20   0   29916   3324   2548 S   0.3   0.2   0:00.75 redis-server                                                                                                 
 1814 root      20   0    5528   2700   2208 R   0.3   0.1   0:01.01 top                                                                                                          
    1 root      20   0    3452   1576   1448 S   0.0   0.1   0:03.87 init                                                                                                         
    2 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kthreadd                                                                                                     
    3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp                                                                                                       
    4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp                                                                                                   
    5 root      20   0       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0-events                                                                                           
    6 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kworker/0:0H-kblockd                                                                                         
    7 root      20   0       0      0      0 I   0.0   0.0   0:00.01 kworker/u2:0-events_unbound                                                                                  
    8 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 mm_percpu_wq

As can be seen above, memory has plenty of headroom, especially after switching from MariaDB to PostgreSQL.

And this is even with a fairly generous php-fpm process management policy:

# From /etc/php/7.3/fpm/pool.d/nextcloud.conf

pm = dynamic
;; max_children is set dynamically with calculate_max_children()
pm.max_children = 30
pm.start_servers = 8
pm.min_spare_servers = 4
pm.max_spare_servers = 8
pm.max_requests = 500

Still looking at what else I can change to improve cpu performance.

Edit: I wonder if this might help, since I am using SSL encryption which I setup using a cert from let's encrypt. I believe cryptodev has been broken on Arch for awhile now (I've got some pogos that I am delaying updates on because of this).

Neal

Anyone else using Devuan? For NAS I really like it...

$
0
0
Hi guys and gals,

has been quite some time, since I last was active in here.
In short: Life and job had kept me busy and still do.

I was recently working with my old Netgear Readynas Duo V2 ( that one: http://natisbad.org/NAS/index.html ).
Had it setup with classic Debian 9 at the time and wanted to try working with the GPIO buttons with inputlircd and irexec.
That is when I realized, that lirc has several issues with systemd, as it seems.

Anyway, I had tried devuan ( https://devuan.org/ ) before, but never really saw the big upside for full powered X86 machines.
Due to the lirc issues, I now tried it (to be exact the unreleased 3.0 version "beowulf") on the ReadyNAS and I have to say that I really like it.

You have a feeling of more control, as sysV has less a life of its own than systemd.
And you even save on resources.

So, just a heads up for the interested:
Might be worth a try for little ARM-based machines.

And of course, as the title suggests: I would like to know if anyone else is using it, and how the experience is/was so far.

Have fun!
Best regards,
Ingmar

Re: Debian on Dell Kace M300

$
0
0
Neal,

Excellent test! real aplication test is what we want to see how the kernel behaves with memory maxing out.

I'm still taking my time to see if we can install without serial console. But it will be slow coming.

I'm going to post a new installation procedure (with serial console). This time we can use the SPI mtds as intended in Debian. I think the box bring up is now completed.

Debian on Dell Kace M300 - Installation Instruction

$
0
0
Dell Kace M300 Installation

There are 4 sections in this installation instruction. At the moment, installation option B is not yet ready. So make sure you do section A, C, and D.

A. Installation with serial console connected
B. Installation without serial console - TBD
C. Post Installation
D. Upgrade Kernel to utilize 2GB RAM

Requirements

At the moment, a serial console connection is required to install the Dell Kace M300. Please see this post and a couple post before that for serial console port pinouts.


A. Installation with serial console connected

1. Create the USB rootfs using Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 following the instruction from the kernel/rootfs release thread:

Note: Step 4 in the rootfs installation is needed since we are booting with stock u-boot. It should look like:

cd /media/sdb1/boot
cp -a zImage-5.2.9-kirkwood-tld-1  zImage.fdt
cat dts/kirkwood-m300.dtb  >> zImage.fdt
mv uImage uImage.orig
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.2.9-kirkwood-tld-1 -d zImage.fdt  uImage
sync

2. After the USB rootfs preparation is done. Bring it to the M300 and plug in to the USB port in the back.

3. Power up, interrupt serial console and at the u-boot prompt.

3a. Execute the following command to unprotect the SPI flash:

protect off all

3b. And then execute the following commands to set up booting:
setenv kernel_config 'setenv mainlineLinux yes; setenv mtdparts mtdparts=spi0.0:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env); setenv load_uimage_addr 0x800000; setenv load_initrd_addr 0x02100000'
setenv load_uimage 'ext2load usb 0:1 $(load_uimage_addr) /boot/uImage'
setenv load_initrd 'ext2load usb 0:1 $(load_initrd_addr) /boot/uInitrd'
setenv set_bootargs_stock 'console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)'
setenv bootcmd_stock 'echo Booting stock ...; run bootcmd_ide'
setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv bootcmd_exec 'echo Booting Debian …; usb start; run load_uimage; run load_initrd; bootm $(load_uimage_addr) $(load_initrd_addr)'
setenv bootcmd 'run kernel_config; run set_bootargs; run bootcmd_exec; run set_bootargs_stock; run bootcmd_stock'
And then boot:

boot

4. Watch the serial console logging, the Debian prompt will appear when the box finishes booting. Login with root/root credential.

5. In Debian, modify the /etc/fw_config.env to enable access to u-boot envs.

echo "/dev/mtd1 0x0 00001000 0x00001000" > /etc/fw_env.config

6. Save the stock envs for sanity, and then set the booting envs permanently.

fw_printenv > /boot/m300_stock_envs.txt
Also, print out the saved envs to double check if the content of m300_stock_envs.txt look OK.
cat  /boot/m300_stock_envs.txt

Set the booting envs permanently:
fw_setenv kernel_config 'setenv mainlineLinux yes; setenv mtdparts mtdparts=spi0.0:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env); setenv load_uimage_addr 0x800000; setenv load_initrd_addr 0x02100000'
fw_setenv load_uimage 'ext2load usb 0:1 $(load_uimage_addr) /boot/uImage'
fw_setenv load_initrd 'ext2load usb 0:1 $(load_initrd_addr) /boot/uInitrd'
fw_setenv set_bootargs_stock 'console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)'
fw_setenv bootcmd_stock 'echo Booting stock ...; run bootcmd_ide'
fw_setenv set_bootargs 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
fw_setenv bootcmd_exec 'echo Booting Debian …; usb start; run load_uimage; run load_initrd; bootm $(load_uimage_addr) $(load_initrd_addr)'
fw_setenv bootcmd 'run kernel_config; run set_bootargs; run bootcmd_exec; run set_bootargs_stock; run bootcmd_stock'

7. Reboot and let the box boot automatically until finished. Log in through SSH using the host name, or find the dynamic IP that the router has assigned to this box (using scanning app such as Linux nmap or IOS Fing).

ssh root@debian.local

8. Done installation.


B. Installation without serial console - TBD

This section is still a work in progress.


C. Post Installation

After login into Debian, see Note1 of the rootfs Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 installation instruction for further set up to secure your box.

D. Upgrade Kernel to utilize 2GB RAM

The rootfs Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 has kernel linux-5.2.9-kirkwood-tld-1 runnning it it. And this kernel is only capable of utilizing 768MB RAM.

To upgrade the kernel to linux-5.2.9-kirkwood-tld-2 (2GB RAM kernel), please see this post for download link and installation instruction.

Re: Debian on Dell Kace M300

$
0
0
Thanks, Bohdi. Looks great. I'll try it on Saturday.
Viewing all 26616 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>