Re: Debian on Dell Kace M300
September 18, 2019 05:19PM
> With a random Fat32 USB with a bunch of files on
> it, here is the relevant part of the boot:
>
> 38 to 67 seconds this time, so faster.
>

The more peripherals you have, the quicker it builds up the pool. With an old rootfs, this has not been a problem for me. I think I've seen a delay like 6 seconds is the most. Typically it takes 2 seconds. This box does not have fan, and the SDD is silent :)

For my release basic USB rootfs or HDD rootfs, I have not seen this significant delay. Typically it will take a few seconds on the first boot.

According to a few experts, haveged has not been proven to really works. The only definitive conclusion that people can tell is haveged provides very good PRNG (pseudo). But that was from long ago.

Like 1000001101000 said above, Meltdown/Spectre fix in the compiler did have an effect on CPU source of randomness. But that should have not come in to play with Kirkwood armv5 SoCs (which are not vulnerable to Meltdown/Spectre).

For our purpose, I think haveged is good enough if you want to use it. However, if you run your rootfs long enough to build entrophy, haveged is not needed. For serious purpose, people use HWRNG (hardware).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 18, 2019 06:26PM
In my experience, haveged really helped to one of my systems which used to take very long to start sshd. It is strange the other system doesn't take that long and I didn't do anything special...
Re: Debian on Dell Kace M300
September 18, 2019 06:51PM
David,

> In my experience, haveged really helped to one of
> my systems which used to take very long to start
> sshd. It is strange the other system doesn't take
> that long and I didn't do anything special...

Do you use that system NFS or Samba heavily? That usually empty out your entropy pool very quickly. A lot of buffer I/Os going on with NFS (I think Samba too). You could see it by mounting NFS shares exported by that system.

You could try pluggin in a USB flash drive to do rsync back up, for example. And see the delay reduced.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/18/2019 06:52PM by bodhi.
Re: Debian on Dell Kace M300
September 18, 2019 07:04PM
I set up samba and NFS on both of the systems, but only one of them had the big sshd delay during reboot. After haveged was installed, the sshd delay is not noticed.
Re: Debian on Dell Kace M300
September 19, 2019 04:34PM
I'm trying to boot from the SSD, but I'm having all kinds of problems. Sometimes it boots, sometimes it leaves me in initramfs, sometimes it kernel panics, etc. Even when it does boot, it's very unstable. Here's what I did:

I deleted the partitions on the SSD and created one ext3 partition. I copied my working USB flash file system to the SSD (tar -cpvjf ... to backup, tar xvpjf ... to restore). Then I modified the uboot environment to attempt to boot from USB first and then try IDE.

Original environment:
baudrate=115200
loads_echo=0
rootpath=/mnt/ARM_FS/
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
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:57
run_diag=yes
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=setenv mainlineLinux no; setenv bootargs_console console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=LABEL=root rw
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
mtdparts=mtdparts=spi0.0:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
load_uimage_addr=0x800000
load_initrd_addr=0x02100000
bootargs_console=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=LABEL=root rw
bootargs=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) root=LABEL=root rw
kernel2bootup=no
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

My changes:
Marvell>> setenv load_uimage_ide 'ext2load ide 0:1 $(load_uimage_addr) /boot/uImage'
Marvell>> setenv load_initrd_ide 'ext2load ide 0:1 $(load_initrd_addr) /boot/uInitrd'
Marvell>> setenv bootcmd_ide 'echo Booting IDE .; ide reset; run load_uimage_ide; run load_initrd_ide; bootm $(load_uimage_addr) $(load_initrd_addr)'
Marvell>> setenv load_uimage_usb 'ext2load usb 0:1 $(load_uimage_addr) /boot/uImage'
Marvell>> setenv load_initrd_usb 'ext2load usb 0:1 $(load_initrd_addr) /boot/uInitrd'
Marvell>> setenv bootcmd_usb 'echo Booting USB.; usb reset; run load_uimage_usb; run load_initrd_usb; bootm $(load_uimage_addr) $(load_initrd_addr)'
Marvell>> setenv bootcmd 'run kernel_config; run set_bootargs; run bootcmd_usb; run bootcmd_ide'
Marvell>> run bootcmd
Hopefully I'm just doing something stupid.

-JT
Re: Debian on Dell Kace M300
September 19, 2019 05:01PM
It looks to me like your next to last line should be
bootcmd 'run kernel_config etc
and then remove the last line. Mine never sets bootcmd as a variable, It is only a direct command, if that makes sense.
Re: Debian on Dell Kace M300
September 19, 2019 05:56PM
renojim Wrote:
-------------------------------------------------------
> I'm trying to boot from the SSD, but I'm having
> all kinds of problems. Sometimes it boots,
> sometimes it leaves me in initramfs, sometimes it
> kernel panics, etc. Even when it does boot, it's
> very unstable. Here's what I did:
>
> I deleted the partitions on the SSD and created
> one ext3 partition. I copied my working USB flash
> file system to the SSD (tar -cpvjf ... to backup,
> tar xvpjf ... to restore). Then I modified the
> uboot environment to attempt to boot from USB
> first and then try IDE.
>
> Original environment:
baudrate=115200
> loads_echo=0
> rootpath=/mnt/ARM_FS/
> 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
> 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:57
> run_diag=yes
> 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=setenv mainlineLinux no; setenv
> bootargs_console console=ttyS0,115200
> mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
> root=LABEL=root rw
> 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
> mtdparts=mtdparts=spi0.0:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
> load_uimage_addr=0x800000
> load_initrd_addr=0x02100000
> bootargs_console=console=ttyS0,115200
> mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
> root=LABEL=root rw
> bootargs=console=ttyS0,115200
> mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
> root=LABEL=root rw
> kernel2bootup=no
> 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
>
> My changes:
Marvell>> setenv load_uimage_ide
> 'ext2load ide 0:1 $(load_uimage_addr)
> /boot/uImage'
> Marvell>> setenv load_initrd_ide 'ext2load ide 0:1
> $(load_initrd_addr) /boot/uInitrd'
> Marvell>> setenv bootcmd_ide 'echo Booting IDE .;
> ide reset; run load_uimage_ide; run
> load_initrd_ide; bootm $(load_uimage_addr)
> $(load_initrd_addr)'
> Marvell>> setenv load_uimage_usb 'ext2load usb 0:1
> $(load_uimage_addr) /boot/uImage'
> Marvell>> setenv load_initrd_usb 'ext2load usb 0:1
> $(load_initrd_addr) /boot/uInitrd'
> Marvell>> setenv bootcmd_usb 'echo Booting USB.;
> usb reset; run load_uimage_usb; run
> load_initrd_usb; bootm $(load_uimage_addr)
> $(load_initrd_addr)'
> Marvell>> setenv bootcmd 'run kernel_config; run
> set_bootargs; run bootcmd_usb; run bootcmd_ide'
> Marvell>> run bootcmd
> Hopefully I'm just doing something stupid.
>
> -JT

JT,

Your envs are wrong. The load addresses need to be set up the same way as booting with USB rootfs.

I will create a well organized envs set to boot both USB or SATA.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 01:18AM
> Your envs are wrong. The load addresses need to be
> set up the same way as booting with USB rootfs.
>
> I will create a well organized envs set to boot
> both USB or SATA.

I took it back! the addresses look OK. Will take a closer look.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 01:20AM
bodhi Wrote:
> Your envs are wrong. The load addresses need to be
> set up the same way as booting with USB rootfs.

I thought they were? That was my intention. Of course I was doing this at 4 in the morning...

>
> I will create a well organized envs set to boot
> both USB or SATA.

Great!

-JT
Re: Debian on Dell Kace M300
September 20, 2019 01:44AM
JT,

Your envs look good to me.

Now the possible problem is the rootfs label. You need to plug in a non-system USB drive to test it. And vice versa.

If you want both USB and SATA drive to have the real rootfs on each, then the partition label must be different. They should not be the same (i.e. rootfs). So if the SDD partition label is sata_rootfs, then:

setenv set_bootargs_usb 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv set_bootargs_sata 'setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv bootcmd 'run kernel_config; run set_bootargs_usb; run bootcmd_usb; set_bootargs_sata; run bootcmd_ide'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/20/2019 03:52AM by bodhi.
Re: Debian on Dell Kace M300
September 20, 2019 01:46AM
JT,

See a few posts above.

Now that I recall, this stock u-boot shell is very limited. So a set of orgnanized and robuts envs might not be possible yet.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/20/2019 01:49AM by bodhi.
Re: Debian on Dell Kace M300
September 20, 2019 07:22AM
Quote

If you want both USB and SATA drive to have the real rootfs on each, then the partition label must be different. They should not be the same (i.e. rootfs). So if the SDD partition label is sata_rootfs

Good to know. If they are different, then a rootfs USB can be plugged in while running on the SATA drive. Right? Also, if you do this you have to update fstab as well.

BTW, I now have M300 running with a 120GB SSD; it is really snappy. I'll give an update in a couple of days.
Re: Debian on Dell Kace M300
September 20, 2019 03:39PM
Okay, so I need some advice or direction because I must be doing something wrong. I'm following the instructions on page 7 for Section A, which I have completed through 6, but it will never boot and just gets into a loop.

So what I think I'm doing wrong in both parts 3b and 6 for setting the environment variables, I don't believe I can copy and paste the code correctly. I can't see the full line because of screen wrapping or incorrect terminal settings? I have no idea.

Typically I use a Windows box with a Putty, but something just isn't right, so what is recommended? (OS, terminal program, terminal emulation settings, etc...)

Are you able to copy and paste all code at the same time? Line-by-line? Any help would be appreciated because I've gotten no where on this and have to start over.
Re: Debian on Dell Kace M300
September 20, 2019 03:51PM
So you have serial console connected? Putty with serial? Putty works fine for me, but you need to be careful that the line wraps are "clean". Maybe go full screen with the window.

I usually copy and paste from the forum; you have to drag to the right to get all of the long lines. If you go off to the right, the quote box will scroll right.

I do it one line at a time; there might be a way to do several lines, but it's "dangerous" messing with u-boot so I'm pretty careful. Proof read each line before hitting enter.

You can printenv from serial to list all of them, or printenv parameter to see a single entry. I suggest you printenv to see all and compare to the instructions. If you have it right and it doesn't work, Bohdi or someone will assist.
Re: Debian on Dell Kace M300
September 20, 2019 03:52PM
Mike,

> Good to know. If they are different, then a
> rootfs USB can be plugged in while running on the
> SATA drive. Right? Also, if you do this you have
> to update fstab as well.

With the current envs we defined for this box, yes they can be plugged in at the same time. But I would recommend not to do that. It got confusing real quick. The 2 systems must be different enough (different host name, different kernel,...) so you can tell which one you are running.

In recent Debian versions, fstab is not relevant, as far as root device is concerned. The root device in bootargs always take precedent. The one we we have in fstab right now is like a fallback option.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 09/20/2019 04:02PM by bodhi.
Re: Debian on Dell Kace M300
September 20, 2019 04:00PM
cadre,

> So what I think I'm doing wrong in both parts 3b
> and 6 for setting the environment variables, I
> don't believe I can copy and paste the code
> correctly. I can't see the full line because of
> screen wrapping or incorrect terminal settings? I
> have no idea.
>
> Typically I use a Windows box with a Putty, but
> something just isn't right, so what is
> recommended? (OS, terminal program, terminal
> emulation settings, etc...)

That problem sounds like Putty terminal was not set up correctly. Check if baudrate 115200, no parity, 8 bit, 1 stop bit. And the terminal emulation usually default to some good type in Putty. But try a different one if you can.

Linux is the best OS for this. In Linux run picocom:

picocom --b 115200 --f n --p n --d 8 /dev/ttyUSB0

You can also use MAC OS. Run screen command.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 05:16PM
I use Windows and Putty, so that's probably not the problem. Just make sure you're copying and pasting the whole line and do it one line at a time.

My thought with being able to boot from either USB or SSD was that I'd use the SSD to boot 99.9% of the time. I'd only want to boot from USB to either do a full backup of the SSD or if there was some problem with the SSD. Right now I have pretty much identical USB and SSD drives (same label) and booting from USB works great (I do have one issue, but that can wait for another time). Once booted, I can mount the SSD without issue. It's booting from SSD with no USB drive inserted that's the problem. I thought I must have the boot addresses wrong, but they should be the same. I'm starting to wonder if it's a bad SSD, although that doesn't seem likely. I just got a backup M300, so I'll have to try that one.

-JT
Re: Debian on Dell Kace M300
September 20, 2019 07:18PM
Thanks for the suggestions, I'll try a parted magic live boot next time with picocom and copy one line at a time.

But just one last question about the copy/paste, should I be able to see the whole pasted line in the terminal before I execute it?

Because I sure didn't last time, but I can confirm that the COM settings were matched to what you referenced bodhi.
Re: Debian on Dell Kace M300
September 20, 2019 08:12PM
cadre,

> But just one last question about the copy/paste,
> should I be able to see the whole pasted line in
> the terminal before I execute it?

You should see the whole line. It will wrap around on your terminal. If you cannot see the whole line, then the env was most likey got cut off, so will not work.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 08:59PM
Children should not be allowed to play with this stuff. I tried to set up the SSD sata_rootfs and USB rootfs boot scheme and ran into a problem. It sounds similare to renojim in that the USB boots but the SSD does not.

I changed the label on the SSD to sata-rootfs and made the changes above to setup bootargs_usb and bootargs_sata. USB booted fine. SSD delayed for a while at the end of boot running, I think, local block script and then dropped into busybox with the message that it couldn't find rootfs. Seems like it did not get the sata_rootfs parameter. I also changed the fstab on the SSD to sata_rootfs, but as you noted, that should not matter.

Here is the relevant parts of my environment:

Quote

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_ide2=ide reset; ext2load ide 0:1 $(load_uimage_addr) /boot/uImage; ext2load ide 0:1 $(load_initrd_addr) /boot/uInitrd; bootm $(load_uimage_addr) $(load_initrd_addr)
set_bootargs_usb=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
set_bootargs_sata=setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
bootcmd=run kernel_config; run set_bootargs_usb; run bootcmd_usb; set_bootargs_sata; run bootcmd_ide2
bootcmd_usb=usb start; run load_uimage; run load_initrd; bootm $(load_uimage_addr) $(load_initrd_addr)
mainlineLinux=yes

Here is the serial log for a SSD boot:

Quote

Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ....
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
...a whole bunch of these...
Gave up waiting for root file system device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! LABEL=rootfs does not exist. Dropping to a shell!

BusyBox v1.30.1 (Debian 1:1.30.1-4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

I reused the bootcmd_ide2 for sata boot, it had been working fine, rather than creating a new bootcmd_sata.

Sorry for the bother.



Edited 1 time(s). Last edit at 09/20/2019 09:10PM by mikeh49.
Re: Debian on Dell Kace M300
September 20, 2019 09:19PM
Mike,

I consider that unsatisfactory!

There should not be any difference between these 2 envs:
bootcmd_ide2=ide reset; ext2load ide 0:1 $(load_uimage_addr) /boot/uImage; ext2load ide 0:1 $(load_initrd_addr) /boot/uInitrd; bootm $(load_uimage_addr) $(load_initrd_addr)
setenv load_uimage_ide 'ext2load ide 0:1 $(load_uimage_addr) /boot/uImage'
setenv load_initrd_ide 'ext2load ide 0:1 $(load_initrd_addr) /boot/uInitrd'
setenv bootcmd_ide 'echo Booting IDE .; ide reset; run load_uimage_ide; run load_initrd_ide; bootm $(load_uimage_addr) $(load_initrd_addr)'


Can you try again. Interrupt serial console and

setenv set_bootargs_usb 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv set_bootargs_sata 'setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv bootcmd 'run kernel_config; run set_bootargs_usb; run bootcmd_usb; set_bootargs_sata; run bootcmd_ide'
printenv
boot

and post the serial console log here?

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 10:08PM
Well, I have two sets of M300, one had trouble with 16GB SSD SATA boot before (strange errors, even can not duplicate them.. and sometimes, success!!!??? ), the other M300, same settings, also the 16GB SATA SSD, same rootfs, no trouble at all!!!

I then changed the first set's 16GB SSD to a normal hard drive, also put a blank 64MB usb flash drive on USB port, and I can SATA boot everytime! and the system is stable!!! I put the first set's 16GB SSD on the second set (re-do the root file system) and it seems OK.

This M300 is really weird. As I mentioned, it is VERY picky on usb flash drives, maybe picky on hard drives too. :P

So if you can't do SATA boot, try two things, that might help, haha.

1 change to a "normal" hard drive, not the 16GB SSD.
2 Always put a blank usb drive (just delete all partitions, etc) on the M300 usb port.
Re: Debian on Dell Kace M300
September 20, 2019 10:17PM
Quote

This M300 is really weird. As I mentioned, it is VERY picky on usb flash drives, maybe picky on hard drives too. :P

That's unsurprising, unfortunately :) old stock u-boots sometimes have quirks like that. But it can be overcome with more env scripting. To work around the problems I need to see the serial console log when that occur.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 10:25PM
Not good.

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
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
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_ide2=ide reset; ext2load ide 0:1 $(load_uimage_addr) /boot/uImage; ext2load ide 0:1 $(load_initrd_addr) /boot/uInitrd; bootm $(load_uimage_addr) $(load_initrd_addr)
bootcmd_usb=usb start; run load_uimage; run load_initrd; bootm $(load_uimage_addr) $(load_initrd_addr)
stdin=serial
stdout=serial
stderr=serial
arcNumber=11
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
bootcmd2=ide reset;ext2load ide 0:2 0x1200000 /uImage-kacemini-000-bak;bootm 0x1200000
bootdelay=3
disaMvPnp=no
enaAutoRecovery=yes
pcieTune=no
set_bootargs_usb=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
set_bootargs_sata=setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial
bootcmd=run kernel_config; run set_bootargs_usb; run bootcmd_usb; set_bootargs_sata; run bootcmd_ide
mainlineLinux=yes
mtdparts=mtdparts=spi0.0:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)
load_uimage_addr=0x800000
load_initrd_addr=0x02100000
bootargs=console=ttyS0,115200 mtdparts=spi_flash:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env)

Environment size: 2692/4092 bytes

Marvell>> boot
(Re)start USB...
USB: scanning bus for devices... 1 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 'set_bootargs_sata' - try 'help'

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)


** Unable to read "/uImage" from ide 0:1 **

** Unable to read "/uInitrd" from ide 0:1 **
## Booting image at 00100000 ...
Bad Magic Number

Sleep on it, I'm done for tonight.
Re: Debian on Dell Kace M300
September 20, 2019 11:28PM
Mike,

I was not clear enough up there

https://forum.doozan.com/read.php?2,61344,90454#msg-90454

The full set of envs would be what JT modified as shown in that post.


setenv load_uimage_ide 'ext2load ide 0:1 $(load_uimage_addr) /boot/uImage'
setenv load_initrd_ide 'ext2load ide 0:1 $(load_initrd_addr) /boot/uInitrd'
setenv bootcmd_ide 'echo Booting IDE .; ide reset; run load_uimage_ide; run load_initrd_ide; bootm $(load_uimage_addr) $(load_initrd_addr)'

setenv set_bootargs_usb 'setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv set_bootargs_sata 'setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial'
setenv bootcmd 'run kernel_config; run set_bootargs_usb; run bootcmd_usb; set_bootargs_sata; run bootcmd_ide'
printenv
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 20, 2019 11:37PM
However, as I said, I will post a clean set of envs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Debian on Dell Kace M300
September 21, 2019 03:50AM
You're missing a "run":
setenv bootcmd 'run kernel_config; run set_bootargs_usb; run bootcmd_usb; run set_bootargs_sata; run bootcmd_ide'
Re: Debian on Dell Kace M300
September 21, 2019 10:13AM
Thanks @renojim, good eye. There was another problem on that line as well. Copy-paste difficulties and looked at these lines too many times yesterday. Fixed them and now back to the original problem of booting from a device with LABEL=sata_rootfs. Below is the serial log where it has the problem. It sticks at running /scripts/local-block.
Quote

[ 7.823410][ T1] Run /init as init process
Loading, please wait...
Starting version 241
[ 8.366635][ T164] input: gpio_keys as /devices/platform/gpio_keys/input/input0
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Begin: Waiting for root file system ... Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device. Common problems:
- Boot args (cat /proc/cmdline)
- Check rootdelay= (did the system wait long enough?)
- Missing modules (cat /proc/modules; ls /dev)
ALERT! LABEL=rootfs does not exist. Dropping to a shell!


BusyBox v1.30.1 (Debian 1:1.30.1-4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) ▒

I think this is the problem:
Quote

root@Dell-M300:/etc# cat /proc/cmdline
console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 mtdparts=spi0.0:0x7f000@0(uboot),0x1000@0x7f000(u-boot-env) earlyprintk=serial

Looks like we need to be able to use different values here. Is this picked up from the u-boot environment? A variable? Invoke someplace else? Just give up and use rootfs for all boot capable devices?

But...

Quote

root@Dell-M300:/etc# fw_printenv set_bootargs_sata
set_bootargs_sata=setenv bootargs console=ttyS0,115200 root=LABEL=sata_rootfs rootdelay=10 $(mtdparts) earlyprintk=serial

Should it be bootargs_console? But usb boot works without the underscore. I get lost in the format differences between serial and fw_printenv.

Too many things going on. I found the run still missing in the bootcmd after I thought it was fixed. On reboot, I found the boot_cmd_ide2 line had changed probably from somewhere in the envs that was triggered. It went to an address on the second partition of the stock SSD, probably their backup system. So, I need to not use ide2. I'll work on this later and get back. No need to do anything now, unless there is something really obvious.



Edited 2 time(s). Last edit at 09/21/2019 11:11AM by mikeh49.
Re: Debian on Dell Kace M300
September 21, 2019 04:03PM
I got a successful SSD boot correcting several environment variable at the u-boot Marvell> prompt. I had several errors. But, I'm having trouble getting the settings to "stick". I have not used saveenv in the u-boot shell. Bohdi seems to prefer waiting for the system to boot and then using fw_setenv in debian. I finally remembered that settings made in the u-boot shell do not last beyond the next boot. But setting changed in debian with fw_setenv do persist. When I do fw_printenv in debian, am I getting the environments in RAM or what is the non-volatile memory? When I try to set one of the variables from debian, I get this...

root@Dell-M300:~# fw_setenv bootcmd 'run kernel_config; run set_bootargs_usb; run bootcmd_usb; run set_bootargs_sata; run bootcmd_ide'
root@Dell-M300:~# fw_printenv bootcmd
bootcmd=r[2~un kernel_config; run set_bootargs_usb; run bootcmd_usb; run set_bootargs_sata; run bootcmd_ide2

The garbage character in the first run does not appear in Putty on the serial port in debian. And, it appears the fw_setenv does not work. I cannot see a problem in the format, so what's up?

UPDATE

Got the correct environment settings to stick using savenv in the u-boot shell. Boots on both USB and SATA, and boots USB first if present. However, it looks like environment settings from debian using fw_setenv do not stick. This attempt to "erase" bootcmd2

root@Dell-M300:~# fw_setenv bootcmd2
root@Dell-M300:~# fw_printenv bootcmd2
bootcmd2=ide reset;ext2load ide 0:2 0x1200000 /uImage-kacemini-000-bak;bootm 0x1200000

This is an original stock variable, so perhaps it has extra protection?



Edited 1 time(s). Last edit at 09/21/2019 04:43PM by mikeh49.
Re: Debian on Dell Kace M300
September 21, 2019 04:13PM
Did you do this from one page back?

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
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: