xblax / flashforge_ad5m_klipper_mod

Unoffical mod for Flashforge Adventurer 5M (Pro) 3D printers to run Moonraker, custom Klipper, Mainsail & Fluidd
GNU General Public License v3.0
82 stars 4 forks source link

Installation failing #58

Open Sunflex616 opened 2 months ago

Sunflex616 commented 2 months ago

Hey! I just tried to install the mod onto my A5 Pro. Unfortunately, both images fail with the same error message displayed in the log. Is there anything obvious I'm missing or have I just stumbled upon something?

klipper_mod_install.log

+ '[' Adventurer5MPro '!=' Adventurer5M ']'
+ '[' Adventurer5MPro '!=' Adventurer5MPro ']'
+ '[' 0024 '!=' 0023 ']'
+ '[' 0024 '!=' 0024 ']'
++ uname -m
+ '[' armv7l '!=' armv7l ']'
++ cat /root/version
+ FF_VERSION=2.4.5
+ '[' 2.4.5 '!=' 2.4.5 ']'
+ MOD_INIT_FILE=/etc/init.d/S00klipper_mod
+ MOD_INIT_FILE_OLD=/etc/init.d/S90klipper_mod
+ MOD_DIR=/data/.klipper_mod
+ CHROOT_DIR=/data/.klipper_mod/chroot
+ xzcat /data/update/img/install_start.img.xz
+ rm -f /etc/init.d/S00klipper_mod
+ rm -f /etc/init.d/S90klipper_mod
+ rm -rf /data/.klipper_mod/chroot
++ df /data
++ tail -1
++ tr -s ' '
++ cut '-d ' -f4
+ FREE_SPACE=5056072
+ MIN_SPACE=524228
+ '[' 5056072 -lt 524228 ']'
+ mkdir -p /data/.klipper_mod/chroot
+ tar -xf - -C /data/.klipper_mod/chroot
+ xz -dc /data/update/chroot.tar.xz
xz: corrupted data
tar: short read
+ '[' 1 -eq 0 ']'
+ error_handler
+ xzcat /data/update/img/install_fail_error.img.xz
+ sync
+ exit 0
xblax commented 2 months ago
  • xz -dc /data/update/chroot.tar.xz xz: corrupted data tar: short read

This might indicate the update file is corrupted. Maybe try to again download and copy it to the USB drive. Use the 'safely remove' mechanism.

Sunflex616 commented 2 months ago

I actually tried that multiple times. I tried downloading straight to the USB, copying it from the HDD as well as safely ejecting it. It's the Cruzer Blade, which came with the printer. I'll give it a try using a different USB stick. Is there any hash for the valid files so I could check at which point the corruption seems to happen?

Edit: Tried a different USB Stick (SanDisk Ultra USB 3.0) - unfortunately, the issue persists.

KaruroChori commented 2 months ago

Can you compare the md5 between the file you downloaded and the one on the USB? Please, link the one you selected so that I can compute the hash on it and check if they are the same.

xblax commented 2 months ago
md5sum Adventurer5M-KlipperMod-v00.03-beta.tgz
8a059ec1e4cbcc81fcc54f59ca69d3eb  Adventurer5M-KlipperMod-v00.03-beta.tgz

Just checked the file as I locally built it and downloaded again from GitHub to confirm it's the same.

Did you maybe try to unpack the archive? Just the 'Adventurer5M-KlipperMod-v00.03-beta.tgz' should go on the the flash drive. You also can unpack it if you want to but be ware that this is just a tar file despite the name (required due to flashforge compatibility). Then if you check the chroot.tar.xz it should be

6b493cea6c36bd9f741493fd0d1c4f71  chroot.tar.xz
Sunflex616 commented 2 months ago

Can you compare the md5 between the file you downloaded and the one on the USB? Please, link the one you selected so that I can compute the hash on it and check if they are the same.

Sure thing! I used the Adventurer5M-KlipperMod-v00.03-pre-alpha-klipperscreen.tgz for my most recent try. The MD5 of the files downloaded & the one residing on the USB is

d59f160202d7507b09a635bb62c79c79

Did you maybe try to unpack the archive? Just the 'Adventurer5M-KlipperMod-v00.03-beta.tgz' should go on the the flash drive.

No - just downloaded it from the releases-tab (multiple times by now), Added the "Pro" to the name and copied it to the USB stick.

KaruroChori commented 2 months ago

d59f160202d7507b09a635bb62c79c79 as well. There were others which were able to install it on the m5 pro, so I really have no clue.

xblax commented 2 months ago

d59f160202d7507b09a635bb62c79c79

Can also confirm this. Did just now test install the KlipperScreen variant. That worked without issues. It it the same checksum after you unplugged the flash drive?

Try to unpack the archive and copy the contents to the usb drive, that works as well. Then you have:

chroot.tar.xz
flashforge_init.sh
img

If it still fails you can edit flashforge_init.sh to run md5sum just before unpacking the archive. Than we see the checksum in the log.

Sunflex616 commented 2 months ago

If it still fails you can edit flashforge_init.sh to run md5sum just before unpacking the archive. Than we see the checksum in the log.

Alright I unpacked the archive and moved it's content to the USB stick. Installation still fails due to the same reason. Could you give me a hint how to properly include the result of md5sum into the log? Guess its more than just running md5sum chroot.tar.xz after the script is checking free space?

xblax commented 2 months ago

Try:

mkdir -p $CHROOT_DIR md5sum $WORK_DIR/chroot.tar.xz xz -dc $WORK_DIR/chroot.tar.xz | tar -xf - -C $CHROOT_DIR sync

xblax commented 2 months ago

For the KlipperScreen variant that should show 144d2723027c639afa731abcdea87de3 chroot.tar.xz

Sunflex616 commented 2 months ago

Okay I have no clue what happened now. After the last failed try, I removed the USB stick from the printer, edited the flashforge_init.,sh right where it is, saved it and re-inserted the stick. and the installation succeeded for some reason?! I really don't get it but as far as I can tell, it is working now and booted successfuly.

If it is of any help to you - the install log:

+ '[' Adventurer5MPro '!=' Adventurer5M ']'
+ '[' Adventurer5MPro '!=' Adventurer5MPro ']'
+ '[' 0024 '!=' 0023 ']'
+ '[' 0024 '!=' 0024 ']'
++ uname -m
+ '[' armv7l '!=' armv7l ']'
++ cat /root/version
+ FF_VERSION=2.4.5
+ '[' 2.4.5 '!=' 2.4.5 ']'
+ MOD_INIT_FILE=/etc/init.d/S00klipper_mod
+ MOD_INIT_FILE_OLD=/etc/init.d/S90klipper_mod
+ MOD_DIR=/data/.klipper_mod
+ CHROOT_DIR=/data/.klipper_mod/chroot
+ xzcat /mnt/img/install_start.img.xz
+ rm -f /etc/init.d/S00klipper_mod
+ rm -f /etc/init.d/S90klipper_mod
+ rm -rf /data/.klipper_mod/chroot
++ df /data
++ tr -s ' '
++ tail -1
++ cut '-d ' -f4
+ FREE_SPACE=5459952
+ MIN_SPACE=524228
+ '[' 5459952 -lt 524228 ']'
+ mkdir -p /data/.klipper_mod/chroot
+ md5sum /mnt/chroot.tar.xz
144d2723027c639afa731abcdea87de3  /mnt/chroot.tar.xz
+ tar -xf - -C /data/.klipper_mod/chroot
+ xz -dc /mnt/chroot.tar.xz
+ sync
+ /data/.klipper_mod/chroot/etc/init/S00klipper_mod setup
+ mod_dir=/data/.klipper_mod
+ chroot_dir=/data/.klipper_mod/chroot
+ log_file=/root/mod_init.log
+ log_file_debug=/root/mod_init_debug.log
+ mod_marker_skip=/data/.klipper_mod/chroot/root/.reboot_stock_once
+ mod_marker_remove=/data/.klipper_mod/chroot/root/.reboot_and_remove
+ usb_marker_skip=klipper_mod_skip
+ usb_marker_remove=klipper_mod_remove
+ usb_marker_debug=klipper_mod_debug
+ usb_debug_script=mod_debug.sh
+ case "$1" in
+ setup
+ prepare_chroot
+ '[' '!' -d /dev/pts ']'
+ for dir in /dev /dev/pts /proc /sys /run /tmp
+ mount -o bind /dev /data/.klipper_mod/chroot/dev
+ for dir in /dev /dev/pts /proc /sys /run /tmp
+ mount -o bind /dev/pts /data/.klipper_mod/chroot/dev/pts
+ for dir in /dev /dev/pts /proc /sys /run /tmp
+ mount -o bind /proc /data/.klipper_mod/chroot/proc
+ for dir in /dev /dev/pts /proc /sys /run /tmp
+ mount -o bind /sys /data/.klipper_mod/chroot/sys
+ for dir in /dev /dev/pts /proc /sys /run /tmp
+ mount -o bind /run /data/.klipper_mod/chroot/run
+ for dir in /dev /dev/pts /proc /sys /run /tmp
+ mount -o bind /tmp /data/.klipper_mod/chroot/tmp
+ mount -o bind /data /data/.klipper_mod/chroot/mnt/data
+ mount -o bind / /data/.klipper_mod/chroot/mnt/orig_root
+ mount -o bind,remount,ro /data/.klipper_mod/chroot/mnt/orig_root
+ mount -o bind /mnt /data/.klipper_mod/chroot/media
+ chroot /data/.klipper_mod/chroot /etc/init/setup_chroot.sh
+ fallocate -l 128M /mnt/swap
+ mkswap /mnt/swap
Setting up swapspace version 1, size = 134213632 bytes
+ chmod 0600 /mnt/swap
+ static_dir=/mnt/data/.klipper_mod/static
+ mkdir -p /mnt/data/.klipper_mod/static
+ setup_static_data /etc/hostname
+ '[' '!' -e /mnt/data/.klipper_mod/static//etc/hostname ]
+ dirname /etc/hostname
+ mkdir -p /mnt/data/.klipper_mod/static//etc
+ mv /etc/hostname /mnt/data/.klipper_mod/static//etc/hostname
+ rm -rf /etc/hostname
+ ln -s /mnt/data/.klipper_mod/static/etc/hostname /etc/hostname
+ setup_static_data /var/lib/iwd
+ '[' '!' -e /mnt/data/.klipper_mod/static//var/lib/iwd ]
+ dirname /var/lib/iwd
+ mkdir -p /mnt/data/.klipper_mod/static//var/lib
+ mv /var/lib/iwd /mnt/data/.klipper_mod/static//var/lib/iwd
+ rm -rf /var/lib/iwd
+ ln -s /mnt/data/.klipper_mod/static/var/lib/iwd /var/lib/iwd
+ setup_static_data /etc/network/interfaces
+ '[' '!' -e /mnt/data/.klipper_mod/static//etc/network/interfaces ]
+ dirname /etc/network/interfaces
+ mkdir -p /mnt/data/.klipper_mod/static//etc/network
+ mv /etc/network/interfaces /mnt/data/.klipper_mod/static//etc/network/interfaces
+ rm -rf /etc/network/interfaces
+ ln -s /mnt/data/.klipper_mod/static/etc/network/interfaces /etc/network/interfaces
+ rm -f /etc/dropbear
+ mkdir -p /etc/dropbear
+ setup_static_data /etc/dropbear
+ '[' '!' -e /mnt/data/.klipper_mod/static//etc/dropbear ]
+ dirname /etc/dropbear
+ mkdir -p /mnt/data/.klipper_mod/static//etc
+ mv /etc/dropbear /mnt/data/.klipper_mod/static//etc/dropbear
+ rm -rf /etc/dropbear
+ ln -s /mnt/data/.klipper_mod/static/etc/dropbear /etc/dropbear
+ mkdir -p /root/.ssh
+ chmod 700 /root/.ssh
+ setup_static_data /root/.ssh
+ '[' '!' -e /mnt/data/.klipper_mod/static//root/.ssh ]
+ dirname /root/.ssh
+ mkdir -p /mnt/data/.klipper_mod/static//root
+ mv /root/.ssh /mnt/data/.klipper_mod/static//root/.ssh
+ rm -rf /root/.ssh
+ ln -s /mnt/data/.klipper_mod/static/root/.ssh /root/.ssh
+ mkdir -p /root/printer_data/database
+ setup_static_data /root/printer_data/database
+ '[' '!' -e /mnt/data/.klipper_mod/static//root/printer_data/database ]
+ dirname /root/printer_data/database
+ mkdir -p /mnt/data/.klipper_mod/static//root/printer_data
+ mv /root/printer_data/database /mnt/data/.klipper_mod/static//root/printer_data/database
+ rm -rf /root/printer_data/database
+ ln -s /mnt/data/.klipper_mod/static/root/printer_data/database /root/printer_data/database
+ mkdir -p /root/printer_data/gcodes
+ setup_static_data /root/printer_data/gcodes
+ '[' '!' -e /mnt/data/.klipper_mod/static//root/printer_data/gcodes ]
+ dirname /root/printer_data/gcodes
+ mkdir -p /mnt/data/.klipper_mod/static//root/printer_data
+ mv /root/printer_data/gcodes /mnt/data/.klipper_mod/static//root/printer_data/gcodes
+ rm -rf /root/printer_data/gcodes
+ ln -s /mnt/data/.klipper_mod/static/root/printer_data/gcodes /root/printer_data/gcodes
+ '[' -d /media/klipper_mod/ ]
+ umount /media
+ exit 0
+ audio midi -m /usr/share/midis/getitem.mid
+ exit 0
+ sync
+ cp /data/.klipper_mod/chroot/etc/init/S00klipper_mod /etc/init.d/
+ sync
+ xzcat /mnt/img/install_ok.img.xz
Loading /usr/share/midis/getitem.mid ...
Track:  Some_decent_tune
KaruroChori commented 2 months ago

Loading /usr/share/midis/getitem.mid ... Track: Game: Zelda, Link's Awakening

I can already see nintendo lawyers DMCAing this repository out of existence :(.

xblax commented 2 months ago

That looks normal now. Seems to be Schroedingers USB drive. Behaves differently when you look ... No clue at the moment what could cause this. I think I had noticed a corrupted chroot.tar.xz once during development, but not sure if related.

Sunflex616 commented 2 months ago

I can already see nintendo lawyers DMCAing this repository out of existence :(.

Hushhhh - I won't mention anything, you won't mention anything - deal? ;P

No clue at the moment what could cause this. I think I had noticed a corrupted chroot.tar.xz once during development, but not sure if related.

Yeh me neither. Literally tried it ~20 times until it somehow finally worked. Sorry for not really being able pinpoint the actual issue. Glad that it works now! Thanks for your help :)

consp commented 2 months ago

I can already see nintendo lawyers DMCAing this repository out of existence :(.

File was in a free to use repo, so should be fine since midi's are considered new expressions if the source was not the same midi file. If it's a problem I'll write a new one myself which is most definitely free to use. Just have to find my midi setup somewhere in a box somewhere 😆

xblax commented 2 months ago

Added md5sum calculation to the install script. Checksum will be printed in the log by default with the next release. Maybe that helps us to understand the issue better if it should appear again.

@Sunflex616 Maybe you can let us know if it's still a reoccurring issue for you.