Oh, and I nearly forgot about the following (another small issue):
In my setup, I have no USB mass storage device connected (yet) to my NanoPC-T3 (only SD/mmc). The current default fstab is set up to have /mnt/usb_1 enabled as type autofs, and this causes all attempts to access this directory to completely hang (I noticed this when running “du -k /”) the shell/tty, because autofs seems to think it can mount “something” (even though there is no mass storage connected to my USB ports) while it indeed must not - and hangs on accessing the mount path…
So for my image, I have patched /etc/fstab to comment out the line for /mnt/usb1 (as default).
We use the x-systemd.automount feature to allow the user to have 1 USB drive automatically mounted, without any need for configuration changes.
Its also used for automatic mounting when using the dietpi-drive_manager. All those usb_x entries are enabled when the script is run, then disables any unactive drive mounts at exit.
The downside is, if usb_1 is not attached, systemD will hang all commands that involve the target /mnt/usb_1. so ls -lha /mnt/usb_1 will hang in a endless loop.
I’ve been unable to find a timeout option or any workarounds, without disabling the mount entirely.
Please note that I think I have found a small bug: During disable, you’ll also need to stop and disable the systemd bluetooth service first, and not only/simply force unload “modprobe -rf” the modules…
I need to remove the dependency of the systemd “brcm_patchram_plus.service” to “syslog.service”, because a systemd service for logging does not seem to exist with DietPi - am I correct?
Only remove it if it causes “brcm_patchram_plus.service” to fail, if “syslog.service” is not started/available.
DietPi-Ramlog has an option to have full logging which installs rsyslog. So our users can add/remove syslog to their system at any time.
If you find some time, can you please also check whether (with an updated service file as stated above) my brcm_patchram_plus service does indeed also make Bluetooth work for NanoPi-M2/NanoPC-T2 (and possibly, BPi M2+ as you mentioned)?
But please be warned that on NanoPi-M2/NanoPC-T2 and NanoPi-M3/NanoPC-T3 (and probably also on the BananaPi using AP6212), you will also need to add the files from my Bluetooth patch tarball (i.e. /bin/bumpRTSCTS, /bin/brcm_patchram_plus, /etc/init.d/brcm_patchram_plus, /lib/systemd/system/brcm_patchram_plus.service) to the respective image.
I will do so for my NanoPi-M3/NanoPC-T3 image, but I will wait for the official release of v134 (including the above change) before I rebuild my image based on the final v134 release. Otherwise, my image would be “mostly” v133 with one file from v134 and not be based on an officially released DietPi version, which could create confusion about the exact versions of files included in the image and cause trouble on subsequent DietPi updates.
It is indeed necessary to remove the references (After, Requires) to the syslog service - changing “Requires” to “Wants” does not help, as even “Wants” causes brcm_patchram_plus service not to be started even though enabled, as no syslog service is running…
Please be warned that the code as listed above is outdated (IIRC, this is the original defunct code that FriendlyARM included with their image) and will not work. When looking into fixing the Bluetooth issue, please use the code from my updated tarball at the FriendlyARM forum: http://www.friendlyarm.com/Forum/viewtopic.php?f=44&t=312#p958
and edit the systemd service description “brcm_patchram_plus.service” to remove all dependencies to the syslog service (After and Requires) - note that this change is only needed for DietPi, where no syslog service exists by default. The tarball is correct for Debian and Ubuntu.
Looking forward to the release of v134 (do you already have a target date?)…
I’ll probably release v134 as soon as your image is ready. Could be a few days delay, depends if any bug reports are sent in the mean time that need investigating. Either way, I can shuffle tickets around if needed to release v134.
Ran out of time today (apologies), so, I’ve made a note, will go through your post in detail tomorrow and get back to you with a full response.
I have a working DietPi installation on my SD card (that I used for testing) for the meantime, and the new final NanoPC-T3 v134 image (which is “ready” except that I need the DietPi v134 files from the master branch) can perfectly wait until you’re finished with the release…
When testing on BPi M2+, please be warned that you most probably need to change the BT UART device port to something different from /dev/ttySAC1 (on the NanoPC-T series, the second UART port is used for Bluetooth).
Phew - v134 image for NanoPi-M3/NanoPC-T3 successfully created and uploaded to your Dropbox. Wifi and Bluetooth working fine.
But still two small issues:
a) new timing issue with dietpi-banner on tty1 being called too early after each boot, i.e. before the eth0 link becomes ready (IP address not yet available) - have not seen this with the kernel from the FriendlyARM June image
b) I probably need to update the initramfs to include fsck.ext4 and force a fsck after resize, as resize2fs consistently results in corrupt size counts after expanding the root filesystem, which will cause bad corruption on the long run…
So unfortunately this still is not the final image. Will try to resolve b) myself. But what shall we do with regards to a)?
Not much we can do with A. Unless we delay the boot (which i’am not keen on) to wait for DHCP ack to finish, before we launch the banner.
No IP wont occur all the time in banner, it really depends on the users network and how quickly DHCP offers are acknowledged by their router.
Personally, if the user is watching tty1, its most likely they are setting up the device locally, rather than over SSH. In which case, not knowing the IP at that time shouldn’t be an issue.
as resize2fs consistently results in corrupt size counts after expanding the root filesystem
Yes, exactly. I will try to create a script that does the job of patching /boot/root.img.gz (initramdisk - have already located where it executes resize2fs), such that you can also apply it to the NanoPi-M2/T2 image (for which I am almost 100% certain it will also be needed).
Debian Jessie comes with e2fsprogs 1.42.12-2 (Debian -- Error)
resize2fs in “offline” mode (i.e. doing the resize while the partition is not mounted) is clearly buggy in 1.42.12, but possibly even in the most recent 1.43.3 (http://e2fsprogs.sourceforge.net/)
fsck.ext4 as of 1.42.12 does NOT even uncover the “size count” inconsistency directly after resize2fs, but only after some write access to the SD card and a subsequent reboot.
I then tried to update the initramfs with most recent 1.43.3 e2fsprog binaries. Seemed to work fine, but the build/initramfs update was complex, and also I did not want to include more recent e2fsprogs binaries into the root filesystem image than the Debian release it builds on…
I have now patched the initramdisk file to use online resizing and additionally force a file system check afterwards, while staying with Debian release version 1.42.12-2
From my testing, I could not reproduce any more “size count” corruptions with this setup (but I’ve only tested with two different SD cards (8GB and 64GB)
So I have now uploaded my final v134 build of DietPi (including the patched initramfs) to your Dropbox Shared Folder (md5sum included). Feel free to release it any time you like (maybe in beta at first until we have some reports from other users that it also works fine for them?)…
I have also uploaded the script that I used to patch the initramfs to the Dropbox, as I think you should also apply it to your NanoPi-M2/NanoPC-T2 image, which most probably uses the same initramdisk file (/boot/root.img.gz). Call the script as follows:
nanopi_fix_initramfs.sh <path-to-root-img.gz>
providing the compressed ramdisk image as the single parameter. The script will backup the original file (to end with “.orig”) and patch the initramdisk file in place in the same directory.
Finally, I have also uploaded a terminfo file that you may want to install using “tic” which resolves the issue of an invisible softcursor in any NanoPi/NanoPC framebuffer text console (“tput cnorm” to activate, can be nicely put into a script in /etc/rc.local.d).
Thanks again for your support in making DietPi run on my device!
Please be warned that the NanoPC-T3 build still cannot be considered final:
Trying to move my DietPi install from SD card to the built-in emmc, one more time, I ran into resize2fs issues, this time with online resizing:
resize2fs 1.42.12 (29-Aug-2014)
Filesystem at /dev/mmcblk0p2 is mounted on /root; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mmcblk0p2 to 1892096 (4k) blocks.
resize2fs: Invalid argument While trying to add group #25
resize2fs exited with status code 1
[ 163.892000] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:882: reserved block 128 not at offset 127
[ 164.216000] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:882: reserved block 128 not at offset 127
[ 197.584000] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:882: reserved block 128 not at offset 127
[ 197.712000] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:882: reserved block 128 not at offset 127
I will now try to update the initramfs with the most recent e2fsprogs - hoping that a current 1.43.3 dated Sept, 2016 fixes the issue (1.42.12 is dated Aug, 2014)…
Yep, it happens lol
Looks like you got one of the worst to implement so far, Rhkean did our Pine A64 which was also a nightmare, lots of little issues kept cropping up.
Wish I could help (let me know how I can), but you seem to have it covered, hopefully not far till the end now
So the resize issue is caused by the fact that FriendlyARM, in the same way like people in the thread cited above, seem to use Android’s make_ext4fs tool to create ext4 sparse images, when they should rather use mkfs.ext4 plus ext2simg…
My take on this so far is: Due to FriendlyARM having used the “wrong” (i.e., buggy) tool to create the root file system, the root file system of the FriendlyARM Debian image (which I have based my DietPi image on) was already non standard compliant (aka corrupt) from the very beginning, even though fsck.ext4 does not report any issues, but later attempts to resize2fs an image after lots of write accesses clearly uncovered them… Ouch!
I will now try to validate this theory (using fsarchiver to backup and restore FriendlyARM’s rootfs.img content into a new partition created by the “real” mkfs.ext4), and then make a sparse image from this, and see whether the resulting ext4 image can be used by resize2fs in both online and offline mode without issues.
Unfortunately, that would mean that most probably, the NanoPi-M2/NanoPC-T2 image is affected by the exact same issue. Have you seen any issues with it during file system resize (resize2fs) before?
Stay tuned - I hope to have a truly valid image by the end of tomorrow…
Hard to believe, as I strongly doubt that they use mkfs.ext4/ext2img to create the S5P4418 image, and the buggy make_ext4fs to create the S5P6818 image…
And while I agree that read/write errors or kernel hangs/oops point to faulty SDs, any of the two types of errors that I have seen clearly points to software issues:
resize2fs: Invalid argument While trying to add group #25
[ 197.712000] EXT4-fs warning (device mmcblk0p2): reserve_backup_gdb:882: reserved block 128 not at offset 127
Have you tried different size SD cards? The issue I uncovered gets more likely (1) the larger the target partition (SD/EMMC) is and (2) the more write accesses you made between image install and resize.
Unfortunately, fsck.ext4 even in the most recent release, is unable to detect the “non-conformance” (aka corruption) of the resulting file system - you will only notice on the attempt to resize (resize2fs) - or possibly fatal corruption only after quite some time when you happened to fill the filesystem close to its capacity…
The wiki headline is misleading: They talk about compiling u-boot and kernel on your own, but not the rootfs image (with device tree and Debian arm base image). In order to make this a full image, I would exactly have to copy an existing Debian root file system infrastructure from “somewhere”, so IMHO fsarchiver clearly is the way to go…