Clean OS (Debian), OpenMediaVault and other "firmwares"

Hi. Sorry for delay. Of course i can share the kernel. GDrive-Link. This Kernel is build from offical marvel arm source Kernel 3.10.70+ and has enabled Posix ACL Support and SATA LED support. USB is only working, if usb device is connectec beforde poweron myCloud Device.

Hi there. After i finished to compile my own kernel, ramdisk and Jessie Root-FS, my next goal is to activate iscsi-target support. At the moment i’m not able to install either openmediavault-iscsitarget (which requires an ungetable linux-headers-armhf package nor to install the iscsitarget-dkms package (which requires the right kernel headers
iscsitarget-dkms (1.4.20.3+svn502-1) wird eingerichtet …

Creating symlink /var/lib/dkms/iscsitarget/1.4.20.3+svn502/source ->
                 /usr/src/iscsitarget-1.4.20.3+svn502

DKMS: add completed.
Error! Your kernel headers for kernel 3.10.70+ cannot be found.
Please install the linux-headers-3.10.70+ package,
or use the --kernelsourcedir option to tell DKMS where it's located

So my next steps are to try to integrate iscsitarget module directy into kernel or to generate the deb package with the corrent headers, as i must have the correct headers because i can compile the kernel.

Maybe you have some ideas to get iscsitarget to work.

Best Regards from Germany
Flo

Update (1): With make CROSS_COMPILE=toolchain/bin/arm-marvell-linux-gnueabi- ARCH=arm deb-pkg LOCALVERSION=-falcot KBUILD_DEBARCH=armhf KDEB_PKGVERSION=$(make kernelversion)+ i can create a deb package with kernel headers. But building DKMS Module for iscsitarget still doesnt work. It seems iscsitarget doesn’t accept this headers. Must do further research.

Yes, need modify linux-headers package (Just change /lib/modules/3.10.70+/kernel link to your kernel sources). Also possible to use Debian’s deb package (Its safe for our device, but still need modify link).

I success build this module for Gen1 (Present as module in kernel and in sources) and its work good.
But need edit OMV package or dpkg database (Add record for this package as “Installed”)

Sorry if this has already been discussed, but is there a way to update a G1 3TB currently running DSM 5.x to a more recent version of DSM (e.g… 6.x) without formatting my drive ? Or, at least without losing my data ?

For G1 need new kernel. Im trying to build one, but without success.

Bummer, well thanks again Fox_exe

Has anybody built the gen2 kernel? If so what is the procedure? I’m having trouble understanding the
instructions include in the GPL source.

Hi Fox, thank you for your informationen. I will try the idea with the kernel symlink. Do i need the full source tree from kernel build? The kernel in source are approx. 900 MB big.

merge tool? You mean tool for build firmware? No, there is no sources for this tool, only my explain about firmware file format and patched version of merge tool (For support upto 5MB kernel/ramdisk).

Merge tool for MyCloud Gen2
Merge tool for MyCloud Mirror Gen1
Merge tool for MyCloud Mirror Gen2 (Its sources for DSM6, merge tool inside)

Hellow Fox_exe!
Thank you for your great works on the firmware. But the samba transfer speed is about 40% slower than the official firmware here. Can you give me more detail about Samba Optimization? How can I change port from WD sources or use Samba from "WD GPL Source code archive?

I am using Debian/jessie on a Gen1, all is ok but USB, because all NTFS disks I connect are not readable:

[  969.179771] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[  969.202156] usb 1-1: New USB device found, idVendor=25ee, idProduct=0004
[  969.208917] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  969.216117] usb 1-1: Product: MIMOBOT
[  969.219817] usb 1-1: Manufacturer: MIMOCO
[  969.223850] usb 1-1: SerialNumber: UT261444000000BC
[  969.231154] scsi2 : usb-storage 1-1:1.0
[  970.230959] scsi 2:0:0:0: Direct-Access              MIMOBOT          0.00 PQ: 0 ANSI: 4
[  970.241674] sd 2:0:0:0: Attached scsi generic sg1 type 0
[  970.248002] sd 2:0:0:0: [sdb] 15773696 512-byte logical blocks: (8.07 GB/7.52 GiB)
[  970.258507] sd 2:0:0:0: [sdb] Write Protect is off
[  970.263375] sd 2:0:0:0: [sdb] Mode Sense: 23 00 00 00
[  970.269246] sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[  970.286487]  sdb: sdb1

I run:

mount /dev/sdb2 /media/sdb1

mount gives:

/dev/sdb1 on /media/sdb1 type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096)

but:

root@MyCloud:/tmp# ls /media/sdb1
ls: cannot access /media/sdb1: Input/output error

What am I missing here?

Thanks

Kernel module for NTFS support are brocken in WD firmware. Use ntfs-3g (Software driver) if available (Maybe from chroot?)

I swapped the original firmware for your Debian jessie, is NTFS kernel support broken in that as well?

Sounds great, is it difficult to “change” the Kernel?
What do you think about additional “Samba Tuning” or is this already done with this?
Sorry if stupid Questions :smiley:

no luck…

root@MyCloud:~# ntfs-3g /dev/sdb1 /media/sdb1/
root@MyCloud:~# ls /media/sdb1
ls: cannot access /media/sdb1: Input/output error
root@MyCloud:~# umount /media/sdb1

Hi Fox,
i tried the way you recommend and i get a little further. But i cannot build iscsitarget dkms module at all.
root@wdmc:/var/lib/dkms/iscsitarget/1.4.20.3+svn502/source# dkms build iscsitarget/1.4.20.3+svn502

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area....
make KERNELRELEASE=3.10.70+ -C /lib/modules/3.10.70+/build M=/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build.....(bad exit status: 2)
Error! Bad return status for module build on kernel: 3.10.70+ (armv7l)
Consult /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/make.log for more information.


root@wdmc:/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build# cat make.log 
DKMS make.log for iscsitarget-1.4.20.3+svn502 for kernel 3.10.70+ (armv7l)
Di 2. Mai 19:33:45 UTC 2017
make: Entering directory '/mnt/mc2kernel'
  LD      /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/built-in.o
  LD      /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/built-in.o
  CC [M]  /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.o
In file included from include/linux/sched.h:15:0,
                 from include/linux/blkdev.h:4,
                 from /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/iscsi.h:11,
                 from /var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.c:7:
/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.c: In function ‘tio_add_data’:
include/linux/kernel.h:663:17: warning: comparison of distinct pointer types lacks a cast
  (void) (&_min1 == &_min2);  \
                 ^
/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.c:75:25: note: in expansion of macro ‘min’
  const size_t to_copy = min(tio->pg_cnt * PAGE_SIZE - iter->size, len);
                         ^
include/linux/kernel.h:663:17: warning: comparison of distinct pointer types lacks a cast
  (void) (&_min1 == &_min2);  \
                 ^
/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.c:82:18: note: in expansion of macro ‘min’
   size_t chunk = min(PAGE_SIZE - iter->pg_off, residual);
                  ^
scripts/basic/fixdep: 2: scripts/basic/fixdep: Syntax error: newline unexpected
scripts/Makefile.build:308: recipe for target '/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.o' failed
make[2]: *** [/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel/tio.o] Error 2
scripts/Makefile.build:455: recipe for target '/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel' failed
make[1]: *** [/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build/kernel] Error 2
Makefile:1226: recipe for target '_module_/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build' failed
make: *** [_module_/var/lib/dkms/iscsitarget/1.4.20.3+svn502/build] Error 2
make: Leaving directory '/mnt/mc2kernel'

Did you had the same problems at compiling iscsitarget ? What about enabling iscsitarget function in kernel as build-in? Actually it switched to module.

I finally get iscsitarget to work.
You have to crosscompile the kernel module. I used the mc2kernel archiv and downloaded the iscsitarget trunk from svn

svn checkout svn://svn.code.sf.net/p/iscsitarget/code/trunk iscsitarget-code

Now the mc2kernel directory looks like

Within the iscsitarget directory you compile the kernel via

make CROSS_COMPILE=/home/florian/DevWDMyCloud/framework/mc2kernel/toolchain/bin/arm-marvell-linux-gnueabi- ARCH=arm KSRC=/home/florian/DevWDMyCloud/framework/mc2kernel/ kernel
Important: Use the absolute path!

This process will create the ./iscsitarget-root/kernel/iscsi_trgt.ko

Copy this kernel module to your WDMyCloud. In my case the destination is
/lib/modules/3.10.70+/kernel/iscsi and do chmod 644

After that you must install userland tools (ietd, ietadm). The easiest way is to install iscsitarget.
apt-get install iscsitarget

Via insmod command, i loaded the iscsi_trgt.ko into kernel
insmod /lib/modules/3.10.70+/kernel/iscsi/iscsi_trgt.ko

Now you can try to restart the iscsitarget service

To get openmediavault-iscsitarget installed, you must use force. I did it this way

apt-get download openmediavault-iscsitarget
dpkg --ignore-depends=linux-headers-armhf -i openmediavault-iscsitarget_3.1.6_all.deb

That’s all. My iSCSI Target is now running.

Next step is to provide a single partition as an iscsi target.

Good work!
it worked well with me but i run up with 502 Bad Gateway error (nginx) when i restart my cloud, but i can visit my files through smb in windows and ssh.

I did clear cache but that didn’t work. so could you please help me figure out what’s the problem?
best

Hi Fox_exe,

many thanks for your work on giving the mycloud a useful system instead of the outdated and insecure firmware.
But how to install clean debian on EX4100? Is it possible? I found files on your google drive but no explanation.
I cant find “Autoinstall” folder and “Recovery” folder mentioned in the first post on google drive.
And is it possible to have the debian running from an usb pen drive without touching the firmware?

to bad this could not be combined into a simple .deb update file.

personally with all the failures with wd updates i am thinking about doing this. i just wish a better step by step english guide existed my linux skills are nowhere near up to snuff