Skip to content

Commit

Permalink
Add autosourcing
Browse files Browse the repository at this point in the history
  • Loading branch information
matejmatuska committed Dec 20, 2022
1 parent 99eb87f commit 6af4df8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# script read at startup by login shells
# in the initramfs this is read for example by the emergency shell

# set the environment file, containing shell commands to execute at startup of
# interactive shells
if [ -f "$HOME/.shrc" ]; then
ENV="$HOME/.shrc"; export ENV
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

# shell commands to execute on interactive shell startup
. leapp_debug_tools.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# library containing some useful functions for debugging in initramfs

# mounts the sysroot
Expand Down Expand Up @@ -29,10 +30,12 @@ leapp_dbg_chroot() {

for dir in /sys /run /proc /dev /dev/pts; do
mount --bind $dir "$NEWROOT$dir"
done || { echo "Failed to mount some directories" || return 1 }
done || {
echo "Failed to mount some directories" || return 1
}

chroot $NEWROOT sh -c "mount -a; /bin/bash"
chroot "$NEWROOT" sh -c "mount -a; /bin/bash"
for dir in /sys /run /proc /dev/pts /dev; do
umount $NEWROOT$dir
umount "$NEWROOT$dir"
done
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ install() {
"${generatordir}/initrd-system-upgrade-generator"

inst_script "${_moddir}/leapp_debug_tools.sh" "/bin/leapp_debug_tools.sh"
inst_script "${_moddir}/.profile" "/.profile"
inst_script "${_moddir}/.shrc" "/.shrc"

## upgrade shell service
#sysinit_wantsdir="${_initdir}${unitdir}/sysinit.target.wants"
Expand Down

0 comments on commit 6af4df8

Please sign in to comment.