pastebin - collaborative debugging tool
rovema.kpaste.net RSS


ctrlx_prep_mount_nfs4_files.bash - collect Debian files for mount.nfs4
Posted by Anonymous on Thu 23rd Nov 2023 16:14
raw | new post

  1. #
  2. # ctrlx_prep_mount_nfs4_files.bash - collect Debian files for mount.nfs4
  3. # so that they work on a CTRL/X ARM64 machine
  4. #
  5. # Written by Roland Mainz <roland.mainz@rovema.de>
  6. #
  7.  
  8. #
  9. # Usage:
  10. # 1. prep tarball with ARM64 binaries using this script
  11. # 2. copy resulting 'ctrlx_mount_nfs4_files.tar.bz2' to target machine
  12. # 3. ssh into target machine
  13. # 4. execute these commands ('$' is user prompt, '#' is root prompt)
  14. #
  15. # $ sudo bash
  16. # # cp 'ctrlx_mount_nfs4_files.tar.bz2' <path-to-root-dir-of-rexroth-deviceadmin-snap>/.
  17. # # snap run --shell rexroth-deviceadmin.web
  18. # # tar --no-same-owner -xf ctrlx_mount_nfs4_files.tar.bz2
  19. # # $ (LD_LIBRARY_PATH=$PWD/ctrlx_files/lib/aarch64-linux-gnu ctrlx_files/sbin/mount.nfs 10.49.20.131:/net_tmpfs /mnt)
  20. # # ls -l /mnt
  21. # total 4
  22. # -rw-r--r-- 1 4294967294 4294967294 48 Nov 22 16:42 secret.txt
  23. # drwxr-xr-x 3 4294967294 4294967294 60 Oct 26 08:39 test1
  24. # # (LD_LIBRARY_PATH=$PWD/ctrlx_files/lib/aarch64-linux-gnu ctrlx_files/sbin/umount.nfs /mnt)
  25. # umount.nfs: /mnt: block devices not permitted on fs
  26. #
  27.  
  28. set -o errexit
  29. set -o xtrace
  30. set -o nounset
  31.  
  32. typeset -a urls=(
  33.         'http://ftp.us.debian.org/debian/pool/main/n/nfs-utils/nfs-common_1.3.4-6_arm64.deb'
  34.         'http://ftp.us.debian.org/debian/pool/main/libt/libtirpc/libtirpc3_1.3.1-1+deb11u1_arm64.deb'
  35.         'http://ftp.us.debian.org/debian/pool/main/libt/libtirpc/libtirpc-common_1.3.1-1+deb11u1_all.deb'
  36. )
  37.  
  38. printf $"# %s: Start.\n" "$0"
  39.  
  40. mkdir -p 'ctrlx_files'
  41.  
  42. for url in "${urls[@]}" ; do
  43.         wget "${url}"
  44. done
  45.  
  46. for deb_ar in *.deb ; do
  47.         ar p "$deb_ar" 'data.tar.xz' | (cd 'ctrlx_files' && tar -xJf -)
  48. done
  49.  
  50. tar -cvf - 'ctrlx_files' | bzip2 -9 >'ctrlx_mount_nfs4_files.tar.bz2'
  51.  
  52. printf $"# %s: Done.\n" "$0"
  53. # EOF.

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at