diff --git a/usr/share/rear/build/GNU/Linux/130_create_dotfiles.sh b/usr/share/rear/build/GNU/Linux/130_create_dotfiles.sh index 434fed3361..ac7d37c741 100644 --- a/usr/share/rear/build/GNU/Linux/130_create_dotfiles.sh +++ b/usr/share/rear/build/GNU/Linux/130_create_dotfiles.sh @@ -1,29 +1,42 @@ -# 200_create_dotfiles.sh +# +# 130_create_dotfiles.sh # # Create some . dot files for Relax-and-Recover # # This file is part of Relax-and-Recover, licensed under the GNU General # Public License. Refer to the included COPYING for full text of license. -# create a simple bash history file, -# use this ruler to make sure the comments stay in a single line: -# the bash prompt is: 'RESCUE $HOSTNAME:~ # -# -----------------------------------------------------80-| -cat < $ROOTFS_DIR/$ROOT_HOME_DIR/.bash_history -: # no more predefined ReaR entries in the bash history -systemctl start sshd.service # start SSH daemon -ip -4 addr # get IPv4 address -dhcpcd eth0 # start DHCP client -nano /var/lib/rear/layout/diskrestore.sh # disk restore -nano /var/lib/rear/layout/disklayout.conf # disk layout -vi /var/lib/rear/layout/diskrestore.sh # disk restore -vi /var/lib/rear/layout/disklayout.conf # disk layout -less /var/log/rear/* # log file(s) -loadkeys -d # default keyboard -rear recover # recover system -: # there are some predefined entries in the bash history -EOF - -chmod $v 0644 $ROOTFS_DIR/$ROOT_HOME_DIR/.bash_history +# Create bash history file or append to an existing one: +Log "Creating or appending to $ROOTFS_DIR/$ROOT_HOME_DIR/.bash_history" +# Use get_path to check if nano and vi are available on the original system +# (and redirect its stdout to stderr to not get its stdout in .bash_history) +# because get_path is also used in build/GNU/Linux/390_copy_binaries_libraries.sh +# where nano and vi may get coiped via PROGS into the ReaR recovery system, +# cf. https://github.com/rear/rear/issues/3151#issuecomment-1941544530 +# and see https://github.com/rear/rear/pull/1306 regarding nano +# and https://github.com/rear/rear/issues/1298 when vi is not available. +# Use the |--...--| ruler below so entries fit in a 80 characters line +# so that it looks OK even on a console with 80 characters per line. +# The ReaR recovery system bash prompt is: 'RESCUE $HOSTNAME:~ # ' +# that has about 20 characters (depending on $HOSTNAME length) +# so about 60 characters are left to show bash history entries +# |------------------------------------------------------------| +{ echo ": # no more predefined ReaR entries in the bash history" + echo "systemctl start sshd.service # start SSH" + echo "ip -4 addr # IPv4 address" + echo "dhcpcd eth0 # start DHCP" + if get_path nano 1>&2 ; then + echo "nano /var/lib/rear/layout/diskrestore.sh # disk restore" + echo "nano /var/lib/rear/layout/disklayout.conf # disk layout" + fi + if get_path vi 1>&2 ; then + echo "vi /var/lib/rear/layout/diskrestore.sh # disk restore" + echo "vi /var/lib/rear/layout/disklayout.conf # disk layout" + fi + echo "less /var/log/rear/* # log file(s)" + echo "loadkeys -d # default keymap" + echo "rear recover # recover system" + echo ": # there are some predefined entries in the bash history" +} >> $ROOTFS_DIR/$ROOT_HOME_DIR/.bash_history -# any other dot files should be listed below +# Other dot files should be listed below: diff --git a/usr/share/rear/skel/default/root/.gitignore b/usr/share/rear/skel/default/root/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/usr/share/rear/skel/default/root/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/usr/share/rear/skel/default/root/.vimrc b/usr/share/rear/skel/default/root/.vimrc new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/usr/share/rear/skel/default/root/.vimrc @@ -0,0 +1 @@ +