From f0bea21f16f816004b515826f7b9092f9327d6d3 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 3 Jan 2009 21:09:31 +0000 Subject: [PATCH] Update --- rescue/linux/usb/config | 5 ++ rescue/linux/usb/copy_kubuntu_desktop_to_usb | 57 ++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100755 rescue/linux/usb/copy_kubuntu_desktop_to_usb diff --git a/rescue/linux/usb/config b/rescue/linux/usb/config index 14c2cea..322bf5b 100644 --- a/rescue/linux/usb/config +++ b/rescue/linux/usb/config @@ -5,6 +5,11 @@ CWD=`pwd` +# +# Set your home directory here (do not use $HOME !!!) +# +MY_HOME=/home/xxx + # # The device name of your USB device (e.g. /dev/sda) # You can find it by plugging it in then doing diff --git a/rescue/linux/usb/copy_kubuntu_desktop_to_usb b/rescue/linux/usb/copy_kubuntu_desktop_to_usb new file mode 100755 index 0000000..ed58827 --- /dev/null +++ b/rescue/linux/usb/copy_kubuntu_desktop_to_usb @@ -0,0 +1,57 @@ +#!/bin/sh +# +# If you are running on a Kubuntu desktop and you would like to have +# the same desktop on the usb key, you can do so by running this +# script. You must be root. +# +. ./config + +if [ ! `whoami` = "root" ] ; then + echo "" + echo "You need to be root to run this shell script" + echo "" + exit 1 +fi + +if [ ! -d ${MOUNT_POINT}/home-rw ] ; then + mkdir -p ${MOUNT_POINT}/home-rw + created="yes" +fi +mount ${USB_DEV}3 ${MOUNT_POINT}/home-rw +if [ $? -ne 0 ] ; then + echo "Mount of home-rw USB partition failed." + exit 1 +fi +cd ${MOUNT_POINT}/home-rw +if [ $? -ne 0 ] ; then + echo "Could not cd to home-rw USB partition" + exit 1 +fi + +mkdir -p ubuntu +chown 1000:1000 ubuntu +cd ubuntu +# Do files +for i in .bashrc .bash_logout ; do + if [ -f ${MY_HOME}/$i ] ; then + cp ${MY_HOME}/$i . + chown 1000:1000 $i + fi +done +# +# Special case for .kde +# +echo "Copying .kde ..." +mkdir .kde +cd .kde +cp -a $MY_HOME/.kde/share . +chown -R 1000:1000 .kde +cd .. + +# Do directories +for i in .gnupg .ssh .mozilla ; do + if [ -d ${MY_HOME}/$i ] ; then + cp -a ${MY_HOME}/$i . + chown -R 1000:1000 $i + fi +done -- 2.39.2