Merge branch 'autorun-copytoram' into 'master'

Copy autorun scripts to new location when copytoram is enabled

See merge request fdupoux/sysresccd-src!66
This commit is contained in:
Francois Dupoux 2020-07-27 18:18:02 +00:00
commit c9fcee3a1e
7 changed files with 20 additions and 1 deletions

View file

@ -33,7 +33,7 @@ basedir='/var/autorun'
autorunlog=basedir+'/log'
autorunmnt=basedir+'/mnt'
autoruntmp=basedir+'/tmp'
defaultsrc=['/run/archiso/bootmnt','/var/autorun/cdrom','/root','/usr/share/sys.autorun']
defaultsrc=['/run/archiso/bootmnt','/run/archiso/copytoram','/var/autorun/cdrom','/root','/usr/share/sys.autorun']
ar_autoruns=['']+list('0123456789ABCDEF')
cmdline=open('/proc/cmdline').read()
autorunfiles=[]

View file

@ -0,0 +1,19 @@
diff --git a/archiso/initcpio/hooks/archiso b/archiso/initcpio/hooks/archiso
index 3eb7ac7..e4585af 100644
--- a/archiso/initcpio/hooks/archiso
+++ b/archiso/initcpio/hooks/archiso
@@ -247,6 +247,14 @@ archiso_mount_handler() {
_mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sfs" "/run/archiso/sfs/airootfs"
+ if [[ "${copytoram}" == "y" ]] && ls -lh /run/archiso/bootmnt/autorun* >/dev/null; then
+ msg -n ":: Copying autorun scripts to RAM..."
+ if ! cp /run/archiso/bootmnt/autorun* /run/archiso/copytoram/ ; then
+ echo "ERROR: while copy '/run/archiso/bootmnt/autorun*' to '/run/archiso/copytoram/'"
+ launch_interactive_shell
+ fi
+ fi
+
[[ "${loadsrm}" == "y" ]] && _mnt_srm "/run/archiso/bootmnt/${archisobasedir}"
if [[ -f "/run/archiso/sfs/airootfs/airootfs.img" ]]; then