From 03b3d68733e178d12c2471e5414a18a5c422efe2 Mon Sep 17 00:00:00 2001 From: Dan Puttick Date: Wed, 25 Oct 2017 16:30:04 -0400 Subject: [PATCH] Update shell_utils * Add copy_metadata for copying files and including their metadata - sometimes useful for copying individual files into a mounted image without using rsync. * Remove out of date install lines from prepare_rPI.sh --- shell_utils/copy_metadata.sh | 14 ++++++++++++++ shell_utils/prepare_rPI.sh | 6 ------ 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 shell_utils/copy_metadata.sh diff --git a/shell_utils/copy_metadata.sh b/shell_utils/copy_metadata.sh new file mode 100644 index 0000000..3a5656f --- /dev/null +++ b/shell_utils/copy_metadata.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Filename: cp-metadata + +myecho=echo +src_path="$1" +dst_path="$2" + +find "$src_path" | + while read src_file; do + dst_file="$dst_path${src_file#$src_path}" + $myecho chmod --reference="$src_file" "$dst_file" + $myecho chown --reference="$src_file" "$dst_file" + $myecho touch --reference="$src_file" "$dst_file" + done diff --git a/shell_utils/prepare_rPI.sh b/shell_utils/prepare_rPI.sh index a55eedc..2b9fc9b 100755 --- a/shell_utils/prepare_rPI.sh +++ b/shell_utils/prepare_rPI.sh @@ -3,15 +3,9 @@ # change locales to en_US.UTF-8 dpkg-reconfigure locales -sed -i "s/wheezy/jessie/" /etc/apt/sources.list apt-get update apt-get dist-upgrade apt-get autoremove -apt-get install libreoffice p7zip-full libfontforge1 timidity freepats pmount -dpkg -i pdf2htmlex*.deb - -# Disable swap -dphys-swapfile uninstall # enable rc.local systemctl enable rc-local.service