Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a 'paste' command to write a local file to the terminal #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Feb 6, 2021

  1. mux: move BUFSIZE definition into header file

    This definition can be useful in other parts of the code too.
    
    Signed-off-by: Roland Hieber <[email protected]>
    rohieb committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    5106a21 View commit details
    Browse the repository at this point in the history
  2. commands: improve 'execute' help text

    Make clear that this is meant as batch processing for CLI commands
    instead of executing e.g. an external shell script.
    
    Signed-off-by: Roland Hieber <[email protected]>
    rohieb committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    aad92f9 View commit details
    Browse the repository at this point in the history
  3. commands: add 'paste' command to write a local file to the terminal

    This command can be useful as replacement for the clipboard, e.g. when working
    remotely over SSH, and when file transfer to the target is not available
    otherwise.
    
    Usage example (glados is my host machine, RPi3 is the target, non-printable key
    presses in angle brackets):
    
        rohieb@glados:~ $ cat apparmor-profile
        #include <tunables/global>
        profile /usr/bin/rauc {
          #include <abstractions/base>
    
          capability sys_rawio,
    
          /usr/bin/rauc mr,
          /usr/bin/barebox-state cx,
          /usr/sbin/unsquashfs cx,
          /usr/bin/busybox.nosuid cx,
          /run/rauc/bundle/hook.sh Ux,
          /tmp/** rw,
          /mnt/updatebundle.rauc rk,
          /etc/rauc/* r,
          /proc/cmdline r,
          /proc/*/fd/ r,
          /proc/*/mountinfo r,
          /run/rauc/** rw,
          /dev/mmcblk* rw,
          /sys/devices/**/mmcblk*/mmcblk*boot*/force_ro rw,
          /etc/ssl/openssl.cnf r,
        }
    
        rohieb@glados:~ $ microcom  -s 115200 /dev/ttyUSB0
        root@RPi3:~ cat /usr/share/apparmor/usr.bin.rauc
        cat: can't open '/usr/share/apparmor/usr.bin.rauc': No such file or directory
        root@RPi3:~ cat > /usr/share/apparmor/usr.bin.rauc
        <Ctrl-\>
        Enter command. Try 'help' for a list of builtin commands
        -> paste apparmor-profile
    
        ----------------------
        #include <tunables/global>
        profile /usr/bin/rauc flags=(attach_disconnected) {
          #include <abstractions/base>
    
          capability sys_rawio,
    
          /usr/bin/rauc mr,
          /usr/bin/barebox-state cx,
          /usr/sbin/unsquashfs cx,
          /usr/bin/busybox.nosuid cx,
          /run/rauc/bundle/hook.sh Ux,
          /tmp/** rw,
          /mnt/updatebundle.rauc rk,
          /etc/rauc/* r,
          /proc/cmdline r,
          /proc/*/fd/ r,
          /proc/*/mountinfo r,
          /run/rauc/** rw,
          /dev/mmcblk* rw,
          /sys/devices/**/mmcblk*/mmcblk*boot*/force_ro rw,
          /etc/ssl/openssl.cnf r,
        }
        <Ctrl-D>
        root@RPi3:~ ls -l /usr/share/apparmor/usr.bin.rauc
        -rw-r--r--    1 root     root           521 Sep  1 00:12 /usr/share/apparmor/usr.bin.rauc
    
    Signed-off-by: Roland Hieber <[email protected]>
    rohieb committed Feb 6, 2021
    Configuration menu
    Copy the full SHA
    503ffc8 View commit details
    Browse the repository at this point in the history