Welcome! Log In Create A New Profile

Advanced

Debian on Dell Kace M300

Posted by JDS420 
Re: Debian on Dell Kace M300
August 31, 2019 07:29PM
Looks like there is an sshd running:

root@gilrain:~# ps -ef | grep sshd
root       725     1  0 16:36 ?        00:00:00 /usr/sbin/sshd
root     22517 21824  0 23:32 ttyS0    00:00:00 grep sshd
root@gilrain:~#

If you kill it and restart it with -ddd to get some debug info you can see it is listening on port 22 but it's binding to loopback only:

root@gilrain:/usr/sbin# /usr/sbin/sshd -ddd                                                                                                                                     
debug2: load_server_config: filename /etc/ssh/sshd_config                                                                                                                       
debug2: load_server_config: done config len = 688                                                                                                                               
debug2: parse_server_config: config /etc/ssh/sshd_config len 688                                                                                                                
debug3: /etc/ssh/sshd_config:5 setting Port 22                                                                                                                                  
debug3: /etc/ssh/sshd_config:7 setting ListenAddress ::1                                                                                                                        
debug3: /etc/ssh/sshd_config:8 setting ListenAddress 127.0.0.1
debug3: /etc/ssh/sshd_config:10 setting Protocol 2
debug3: /etc/ssh/sshd_config:12 setting HostKey /etc/ssh/ssh_host_rsa_key
debug3: /etc/ssh/sshd_config:13 setting HostKey /etc/ssh/ssh_host_dsa_key
debug3: /etc/ssh/sshd_config:15 setting UsePrivilegeSeparation yes
debug3: /etc/ssh/sshd_config:18 setting KeyRegenerationInterval 3600
debug3: /etc/ssh/sshd_config:19 setting ServerKeyBits 768
debug3: /etc/ssh/sshd_config:22 setting SyslogFacility AUTH
debug3: /etc/ssh/sshd_config:23 setting LogLevel INFO
debug3: /etc/ssh/sshd_config:26 setting LoginGraceTime 120
debug3: /etc/ssh/sshd_config:27 setting PermitRootLogin yes
debug3: /etc/ssh/sshd_config:28 setting StrictModes yes
debug3: /etc/ssh/sshd_config:30 setting RSAAuthentication yes
debug3: /etc/ssh/sshd_config:31 setting PubkeyAuthentication yes
debug3: /etc/ssh/sshd_config:35 setting IgnoreRhosts yes
debug3: /etc/ssh/sshd_config:37 setting RhostsRSAAuthentication no
debug3: /etc/ssh/sshd_config:39 setting HostbasedAuthentication no
debug3: /etc/ssh/sshd_config:44 setting PermitEmptyPasswords no
debug3: /etc/ssh/sshd_config:48 setting ChallengeResponseAuthentication no
debug3: /etc/ssh/sshd_config:63 setting X11Forwarding yes
debug3: /etc/ssh/sshd_config:64 setting X11DisplayOffset 10
debug3: /etc/ssh/sshd_config:65 setting PrintMotd no
debug3: /etc/ssh/sshd_config:66 setting PrintLastLog yes
debug3: /etc/ssh/sshd_config:67 setting TCPKeepAlive yes
debug3: /etc/ssh/sshd_config:74 setting AcceptEnv LANG LC_*
debug3: /etc/ssh/sshd_config:76 setting Subsystem sftp /usr/lib/openssh/sftp-server
debug3: /etc/ssh/sshd_config:87 setting UsePAM yes
debug1: sshd version OpenSSH_5.5p1 Debian-6
debug3: Not a RSA1 key file /etc/ssh/ssh_host_rsa_key.
debug1: read PEM private key done: type RSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: private host key: #0 type 1 RSA
debug3: Not a RSA1 key file /etc/ssh/ssh_host_dsa_key.
debug1: read PEM private key done: type DSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-ddd'
debug3: oom_adjust_setup
Set /proc/self/oom_adj from 0 to -17
debug2: fd 3 setting O_NONBLOCK
debug1: Bind to port 22 on 127.0.0.1.
Server listening on 127.0.0.1 port 22.
socket: Address family not supported by protocol

If you comment these two lines out in /etc/ssh/sshd_config and restart it you can then log in:

# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::1
#ListenAddress 127.0.0.1

Of course this doesn't really help us get access to a pristine box without serial console.

Neal



Edited 1 time(s). Last edit at 08/31/2019 07:42PM by nwestfal.
Re: Debian on Dell Kace M300
August 31, 2019 08:23PM
Good work, Neal!

OK, got ssh working in stock OS per the above, but also had to edit the /etc/network/interfaces file to set the the eth0 interface to dhcp. It was static 192.168.2.1 or something like that. My network is 192.168.1.x.



Edited 2 time(s). Last edit at 08/31/2019 09:09PM by mikeh49.
Re: Debian on Dell Kace M300
August 31, 2019 09:30PM
Neal,

> Of course this doesn't really help us get access
> to a pristine box without serial console.

Right :)

Is port 23 open?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
August 31, 2019 09:41PM
U-boot tools seem to be in stock OS as fw_printenv works.

Summarizing where we are:

-Prepare a USB with bohdi's latest 5.2.9-tld-2 kernel and file system
-Connect serial to M300
-Boot into bohdi's file system setting u-boot commands through serial
-Change root password in stock OS by mounting internal SSD and using CHROOT
-Edit /etc/ssh/sshd_config to enable listening in other addresses
-Edit /etc/network/interfaces to set eth0 to DHCP (maybe)
-Reboot stock OS with ssh

Clearly, more detailed instructions are needed.
Re: Debian on Dell Kace M300
August 31, 2019 09:43PM
Only ports 22 and 80 are open.
Re: Debian on Dell Kace M300
August 31, 2019 10:23PM
mikeh49 Wrote:
-------------------------------------------------------
> Good work, Neal!
>
> OK, got ssh working in stock OS per the above, but
> also had to edit the /etc/network/interfaces file
> to set the the eth0 interface to dhcp. It was
> static 192.168.2.1 or something like that. My
> network is 192.168.1.x.

Oh yes I had forgotten that I had done that earlier. I have since gone through the configuration wizard in the web UI and it sets it up for static again using the IP you give it.

I really didn’t find anything in the web UI to assist. I’m guessing somehow that tether key temporarily enables ssh access by changing the sshd_config. It otherwise seems like a normal OpenSSH install.

Neal
Re: Debian on Dell Kace M300
September 01, 2019 07:16AM
Neal,

> Oh yes I had forgotten that I had done that
> earlier. I have since gone through the
> configuration wizard in the web UI and it sets it
> up for static again using the IP you give it.
>

So you can change the IP to anything you want through the web page (from the original 192.168.2.100) ?

> I really didn’t find anything in the web UI to
> assist. I’m guessing somehow that tether key
> temporarily enables ssh access by changing the
> sshd_config. It otherwise seems like a normal
> OpenSSH install.

I think we close to exhaust the possibilities of how to access the box without serial console.

Albeit, I have thought and finalized (in my mind) of another procedure to install on the internal SATA module. As JT mention, there are only 2 screws to remove. And that can be put inside a SATA enclosure or using a SATA-USB cable.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 09/01/2019 07:17AM by bodhi.
Re: Debian on Dell Kace M300
September 01, 2019 08:07AM
bodhi Wrote:

> So you can change the IP to anything you want
> through the web page (from the original
> 192.168.2.100) ?

Yes. I guess the idea is for initial configuration you hook it up direct to an unused ethernet port that you configure to 192.168.2.x, then access the web page via 192.168.2.100. So at least you can do that to get it on your network. Not sure why they didn't just configure it to use DHCP for initial setup. Probably makes it easier having it at a known address.

> I think we close to exhaust the possibilities of
> how to access the box without serial console.

I really don't mind that, it was easy enough to access the serial console.

> Albeit, I have thought and finalized (in my mind)
> of another procedure to install on the internal
> SATA module. As JT mention, there are only 2
> screws to remove. And that can be put inside a
> SATA enclosure or using a SATA-USB cable.

There's probably enough room in the box to put a 3.5 inch SATA drive in there and attaching to the SATA port with a short SATA cable. Going SATA-USB you would lose some performance since I believe these are only USB 2.0 ports.

Neal
Re: Debian on Dell Kace M300
September 01, 2019 08:44AM
nwestfal Wrote:
-------------------------------------------------------
> bodhi Wrote:
>
> > So you can change the IP to anything you want
> > through the web page (from the original
> > 192.168.2.100) ?
>
> Yes. I guess the idea is for initial
> configuration you hook it up direct to an unused
> ethernet port that you configure to 192.168.2.x,
> then access the web page via 192.168.2.100. So at
> least you can do that to get it on your network.
> Not sure why they didn't just configure it to use
> DHCP for initial setup. Probably makes it easier
> having it at a known address.

It is actually very common to use known address like that. Most of wireless bridges in the market use a known address. There is pros and cons between that and dynamic IP, as far as installation is concerned.

>
> > I think we close to exhaust the possibilities
> of
> > how to access the box without serial console.
>
> I really don't mind that, it was easy enough to
> access the serial console.

For more experienced users, we always connect serial console. But It would make the box more popular for beginners if serial console is not needed for installation.


> > Albeit, I have thought and finalized (in my
> mind)
> > of another procedure to install on the internal
> > SATA module. As JT mention, there are only 2
> > screws to remove. And that can be put inside a
> > SATA enclosure or using a SATA-USB cable.
>
> There's probably enough room in the box to put a
> 3.5 inch SATA drive in there and attaching to the
> SATA port with a short SATA cable. Going SATA-USB
> you would lose some performance since I believ
> these are only USB 2.0 ports.

I did not mean we want a SATA drive inside this box :) The SATA-USB connection is outside and temporary, only during the installation of the new rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
September 01, 2019 10:37AM
My quick reaction is that pulling the SSD doesn't seem easier than setting up serial. If someone is comfortable with pulling the SSD and has an adapter, they probably have a USB serial adapter as well. Especially if they're into these little boxes. But, if the SSD approach is a better/easier technical solution, then of course that's the way to go.

Getting into the Pogo plugs with SSH from the get-go, was a good deal.
Re: Debian on Dell Kace M300
September 01, 2019 10:52AM
mikeh49 Wrote:

> Getting into the Pogo plugs with SSH from the
> get-go, was a good deal.

Even then it only worked because Pogoplug made it doable through their web site. Now that they're gone, the only way to hack a stock pogo is through serial.

Neal
Re: Debian on Dell Kace M300
September 01, 2019 10:57AM
bodhi Wrote:
-------------------------------------------------------

> For more experienced users, we always connect
> serial console. But It would make the box more
> popular for beginners if serial console is not
> needed for installation.

True that.

> I did not mean we want a SATA drive inside this
> box :) The SATA-USB connection is outside and
> temporary, only during the installation of the
> new rootfs.

Ah, I see. But partly I'm thinking ahead for my own uses :)

Neal
Re: Debian on Dell Kace M300
September 01, 2019 09:43PM
This M300 is pretty picky on usb flash drives. I have some Kingston / Lexar / xxx brand flash drives which worked fine on Dockstar / Pogo E02 / etc, but those won't work on the M300. Only two 4GB sandisk flash drives worked.



Edited 1 time(s). Last edit at 09/01/2019 09:43PM by daviddyer.
Re: Debian on Dell Kace M300
September 02, 2019 11:25AM
Looks like M300 has a pretty "strong" CPU...

https://www.softprayog.in/troubleshooting/how-to-get-the-value-of-pi-in-bc-calculations

apt-get install bc

time echo "scale=4000; 4*a(1)" | bc -l


=================================

1.2GHz

goflexhome		1m7.236s

Dockstar		1m7.026s

dreamplug		1m3.545s

=================================

2.0GHz

Kace M300		0m38.069s

=================================

1.2GHz

Mirabox		        1m8.176s

=================================

1.0 GHz

Rpi 0 w			1m23.440s

=================================

1.2GHz

Rpi 3B			0m43.348s

=================================

3.1GHz

i3-2100			0m11.850s



Edited 1 time(s). Last edit at 09/02/2019 12:45PM by daviddyer.
Re: Debian on Dell Kace M300
September 02, 2019 04:27PM
> Looks like M300 has a pretty "strong" CPU...

Yes indeed :)

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
September 04, 2019 11:36AM
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



Edited 1 time(s). Last edit at 09/04/2019 11:50AM by nwestfal.
Re: Debian on Dell Kace M300
September 04, 2019 03:49PM
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.

-bodhi
===========================
Forum Wiki
bodhi's corner
Debian on Dell Kace M300 - Installation Instruction
September 04, 2019 10:22PM
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) root=/dev/sda1 rw'
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) root=/dev/sda1 rw'
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.

And also see this post for a new DTB file that supports LED control.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 3 time(s). Last edit at 09/13/2019 03:25AM by bodhi.
Re: Debian on Dell Kace M300
September 05, 2019 08:45AM
Thanks, Bohdi. Looks great. I'll try it on Saturday.
Re: Debian on Dell Kace M300
September 05, 2019 07:14PM
mikeh49 Wrote:
-------------------------------------------------------
> Thanks, Bohdi. Looks great. I'll try it on
> Saturday.

Mike,

Try compiling something and watch the memory.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
September 07, 2019 01:41PM
Set up booting Debian from USB without serial and it went well and reliably boots into Debian from the usb. After upgrading, I had to rebuild the uInitrd, and that was really snappy. Shorter that I remember from building it the first time.

Then I tried booting into stock with the Debian usb removed, and this doesn't work:

Quote

Diag completed
Hit any key to stop autoboot: 0
Booting Debian …
(Re)start USB...
USB: scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
Unknown command 'console=ttyS0,115200' - try 'help'
Booting stock ...

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
Device 0 @ 0 0:
Model: TS16GSSD25H-M Firm: 20100712 Ser#: 20110423421602036222
Type: Hard Disk
Supports 48-bit addressing
Capacity: 15272.0 MB = 14.9 GB (31277056 x 512)


2415724 bytes read

2401050 bytes read
## Booting image at 00100000 ...
Image Name: Linux-2.6.31.8-kacemini-1.7
Created: 2011-04-21 13:52:21 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2415660 Bytes = 2.3 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 01100000 ...
Image Name: Debian ramdisk
Created: 2011-04-21 14:00:48 UTC
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2400986 Bytes = 2.3 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux.................................................................................................................................................... done, booting the kernel.

I can't see a problem with the fw environments, they match the instructions above. Here they are:

Quote

baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
kernel2bootup=no
usiversion=kacemini-1.5
console=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
bootargs=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
stdin=serial
stdout=serial
stderr=serial
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
filesize=728c0
fileaddr=1200000
netmask=255.255.255.0
ipaddr=192.168.58.233
serverip=192.168.58.188
ethaddr=18:03:73:41:db:3e
run_diag=yes
mainlineLinux=no
bootargs_console=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
bootcmd_ide=run bootcmd_ideload; setenv bootargs $(bootargs_console); bootm 0x100000 0x01100000
bootcmd_ideload=ide reset; ext2load ide 0:1 0x100000 /uImage; ext2load ide 0:1 0x01100000 /uInitrd
bootcmd2=ide reset; ext2load ide 0:2 0x100000 /kbox/bin/uImage.bak; ext2load ide 0:1 0x01100000 /uInitrd;bootm 0x100000 0x01100000
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
load_uimage=ext2load usb 0:1 $(load_uimage_addr) /boot/uImage
load_initrd=ext2load usb 0:1 $(load_initrd_addr) /boot/uInitrd
set_bootargs_stock=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
bootcmd_stock=echo Booting stock ...; run bootcmd_ide
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
bootcmd_exec=echo Booting Debian …; usb start; run load_uimage; run load_initrd; bootm $(load_uimage_addr) $(load_initrd_addr)
bootcmd=run kernel_config; run set_bootargs; run bootcmd_exec; run set_bootargs_stock; run bootcmd_stock

I was wondering about this line that has 2 set_bootargs commands:

Quote

bootcmd=run kernel_config; run set_bootargs; run bootcmd_exec; run set_bootargs_stock; run bootcmd_stock

set_bootargs_stock is missing this:

Quote

root=/dev/sda1 rw

that is in the bootargs line near the top of the list.

Too many bootargs lines for me to follow. :)

I'll leave the serial connected until this is fixed, if it's supposed to be able to boot the stock OS with no Debian USB connected.

Thanks for the work on this, Bohdi. Good instructions.



Edited 2 time(s). Last edit at 09/07/2019 03:21PM by mikeh49.
Re: Debian on Dell Kace M300
September 07, 2019 06:52PM
mikeh49,

Thanks! I'll take a look.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
September 07, 2019 10:43PM
Hi Mike,

You're right!

I looked closely again, there was a bug in stock envs, and I inherited it :)

So the envs should be changed to this in serial console,

setenv set_bootargs_stock 'console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw'

And later after booting into Debian, it should be:

fw_setenv set_bootargs_stock 'console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw'

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
September 08, 2019 10:41AM
I thought you had it, but it still won't boot into stock:

Quote


__ __ _ _
| \/ | __ _ _ ____ _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| | | | (_| | | \ V / __/ | |
|_| |_|\__,_|_| \_/ \___|_|_|
_ _ ____ _
| | | | | __ ) ___ ___ | |_
| | | |___| _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
\___/ |____/ \___/ \___/ \__| ** LOADER **
** MARVELL BOARD: DB-88F6282A-BP LE

U-Boot 1.1.4 (Jun 20 2011 - 13:16:26) Marvell version: 3.4.27
USISH-SMB Ver: kacemini-1.5

U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CDBC0

Soc: MV88F1155 Rev 1 (DDR3)
CPU running @ 2000Mhz L2 running @ 500Mhz
SysClock = 500Mhz , TClock = 200Mhz

DRAM (DDR3) CAS Latency = 7 tRP = 7 tRAS = 20 tRCD=7
DRAM CS[0] base 0x00000000 size 512MB
DRAM CS[1] base 0x20000000 size 512MB
DRAM CS[2] base 0x40000000 size 512MB
DRAM CS[3] base 0x60000000 size 512MB
DRAM Total size 2GB 16bit width
Addresses 8M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (8M - 7M): Done
[512kB@f8000000] Flash: 512 kB
Good CRC!

CPU : Marvell Feroceon (Rev 1)

Streaming disabled
Write allocate disabled


USB 0: host mode
PEX 0: interface detected no Link.
Net: egiga0 [PRIME]


Running diagnostics ...

DDR3 data bus test PASSED

DDR3 address bus test PASSED

DDR3 device test PASSED

Diag completed
Hit any key to stop autoboot: 0
Booting Debian …
(Re)start USB...
USB: scanning bus for devices... 2 USB Device(s) found
Waiting for storage device(s) to settle before scanning...
0 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
Unknown command 'console=ttyS0,115200' - try 'help'

Booting stock ...

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode (6)
Device 0 @ 0 0:
Model: TS16GSSD25H-M Firm: 20100712 Ser#: 20110423421602036222
Type: Hard Disk
Supports 48-bit addressing
Capacity: 15272.0 MB = 14.9 GB (31277056 x 512)


2415724 bytes read

2401050 bytes read
## Booting image at 00100000 ...
Image Name: Linux-2.6.31.8-kacemini-1.7
Created: 2011-04-21 13:52:21 UTC
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2415660 Bytes = 2.3 MB
Load Address: 00008000
Entry Point: 00008000
Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 01100000 ...
Image Name: Debian ramdisk
Created: 2011-04-21 14:00:48 UTC
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 2400986 Bytes = 2.3 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux.................................................................................................................................................... done, booting the kernel.

And the uboot environment:

Quote

Marvell>> printenv
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
kernel2bootup=no
usiversion=kacemini-1.5
console=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
CASset=min
MALLOC_len=1
ethprime=egiga0
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
bootargs=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
ethact=egiga0
filesize=728c0
fileaddr=1200000
netmask=255.255.255.0
ipaddr=192.168.58.233
serverip=192.168.58.188
ethaddr=18:03:73:41:db:3e
run_diag=yes
bootargs_console=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
bootcmd_ide=run bootcmd_ideload; setenv bootargs $(bootargs_console); bootm 0x100000 0x01100000
bootcmd_ideload=ide reset; ext2load ide 0:1 0x100000 /uImage; ext2load ide 0:1 0x01100000 /uInitrd
bootcmd2=ide reset; ext2load ide 0:2 0x100000 /kbox/bin/uImage.bak; ext2load ide 0:1 0x01100000 /uInitrd;bootm 0x100000 0x01100000
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
load_uimage=ext2load usb 0:1 $(load_uimage_addr) /boot/uImage
load_initrd=ext2load usb 0:1 $(load_initrd_addr) /boot/uInitrd
bootcmd_stock=echo Booting stock ...; run bootcmd_ide
set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
bootcmd_exec=echo Booting Debian …; usb start; run load_uimage; run load_initrd; bootm $(load_uimage_addr) $(load_initrd_addr)
bootcmd=run kernel_config; run set_bootargs; run bootcmd_exec; run set_bootargs_stock; run bootcmd_stock
set_bootargs_stock=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw
stdin=serial
stdout=serial
stderr=serial
mainlineLinux=no
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
netbsd_en=no
vxworks_en=no
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no

It looks like the attempt to boot debian perhaps fails uncleanly and leaves wreckage before trying to boot stock. That said, it does find the internal drive and load the kernel and ramdisk but then goes off the rails.
Re: Debian on Dell Kace M300
September 08, 2019 02:00PM
Well, I don't think I want to run the stock system ever again ... so I just fdisk / format the SSD when the usb booted successfully. I then removed the 16GB SSD and put one 320GB 2.5" hard drive there, transferred debian to the hard drive and tuned the uboot env to boot directly from hard drive. My cat likes to step on the flash drive...


1 Uboot is kind of old, so use MBR, not GPT on the hard drive, otherwise it won't load.
2 Uboot env is still write protected. To write, we still need to do "protect off all" in uboot before we boot debian. run "protect off all" in uboot then saveenv won't help.
Re: Debian on Dell Kace M300
September 08, 2019 02:48PM
I'm thinking this:

setenv set_bootargs_stock 'console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw'

Should be this:

setenv set_bootargs_stock 'setenv bootargs console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw'

Except that doesn't solve it either. Something seems to be getting messed up for stock after the "run kernel_config" is executed which is not corrected by executing set_bootargs_stock. If you interrupt boot and just type "run bootcmd_stock" it works fine.
Re: Debian on Dell Kace M300
September 08, 2019 04:17PM
David,

> Well, I don't think I want to run the stock system
> ever again ... so I just fdisk / format the SSD
> when the usb booted successfully.

That's what I would do, too. At this point it is academic to boot stock (just for fun, no profit).

You can also install the basic rootfs Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 in the stock 16GB drive too, and use it as rescue system. But it would be a waste of the SATA capability to do that.


> I then removed
> the 16GB SSD and put one 320GB 2.5" hard drive
> there, transferred debian to the hard drive and
> tuned the uboot env to boot directly from hard
> drive. My cat likes to step on the flash drive...

:))

> 1 Uboot is kind of old, so use MBR, not GPT on the
> hard drive, otherwise it won't load.

Usually u-boot this old does not have GPT.

> To write, we
> still need to do "protect off all" in uboot before
> we boot debian. run "protect off all" in uboot
> then saveenv won't help.

Right! so the instruction tell people to do it in Debian.


Now if you can take a pic of your mod, it would be nice. If not, no biggie.

Is it obvious how the SATA replacement would be done or is there hardware mod to mount the 2.5" HDD?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: Debian on Dell Kace M300
September 08, 2019 04:20PM
@Neal,

> Something
> seems to be getting messed up for stock after the
> "run kernel_config" is executed

Correct. I have not given it serious debugging time but I am sure that's one of the reason.

@Mike,

Stock u-boot shell is very limited. So what you saw (in red) above is how it behaves, unfortunately. I would need to work around the limitation a little more.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 09/08/2019 04:23PM by bodhi.
Re: Debian on Dell Kace M300
September 08, 2019 04:55PM
kernel_config sets mainlineLinux to yes, the stock OS has it set no. Also the stock boot commands load the kernel and ramdisk to different addresses than set in kernel_config. Debian uses the addresses in kernel_config. I tried the to use these addresses for stock, but no-go. From what I can tell, bootcmd runs before anything else and runs kernel_config first. Thus, mainlineLinux is yes when the stock OS tries to start.



Edited 1 time(s). Last edit at 09/08/2019 06:31PM by mikeh49.
Re: Debian on Dell Kace M300
September 08, 2019 05:45PM
It boots into stock by adding this to the set_bootargs_stock environment:

Quote

setenv mainlineLinux no

The whole thing is:

Quote

set_bootargs_stock 'console=ttyS0,115200; setenv mainlineLinux no; mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=/dev/sda1 rw

I don't know if this is the best place to do this, but it works.

I think it's a good idea to have a fallback if the primary boot doesn't work. So, with debian on USB, the fallback is stock on the internal drive. When we get debian on the internal drive, the fallback would be debian on a USB, I guess then it would be USB boot first then internal drive.

I'd like to see the u-boot environments for internal drive booting. :)

I'm ready to put the cover on.



Edited 4 time(s). Last edit at 09/08/2019 09:23PM by mikeh49.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: