Allow autorun scripts to be located in a folder at the root of the ISO

This commit is contained in:
fdupoux 2022-01-08 17:14:01 +00:00
parent add60264a2
commit bc817e38bb
3 changed files with 7 additions and 1 deletions

0
autorun/.gitkeep Normal file
View file

View file

@ -347,8 +347,13 @@ make_prepare() {
# Build ISO
make_iso() {
# Copy version file
cp ${version_file} ${work_dir}/iso/${install_dir}/
# Copy autorun folder
test -d autorun && cp -r autorun ${work_dir}/iso/
# Copy configuration files
cp -r sysrescue.d/ ${work_dir}/iso/
# Copy SRM modules
(
shopt -s nullglob
rm -vf ${work_dir}/iso/${install_dir}/*.srm
@ -356,6 +361,7 @@ make_iso() {
cp -vf "$srm" ${work_dir}/iso/${install_dir}/
done
)
# Create the ISO image
setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" -A "${iso_application}" -o "${out_dir}" iso "${iso_name}-${iso_version}-${arch/x86_64/amd64}.iso"
}

View file

@ -8,7 +8,7 @@ diff -urN archiso-43-a/archiso/initcpio/hooks/archiso archiso-43-b/archiso/initc
+ if [[ "${copytoram}" == "y" ]]; then
+ if ls -lh /run/archiso/bootmnt/autorun* >/dev/null 2>/dev/null; then
+ msg ":: Copying autorun scripts to RAM ..."
+ if ! cp /run/archiso/bootmnt/autorun* /run/archiso/copytoram/ ; then
+ if ! cp -r /run/archiso/bootmnt/autorun* /run/archiso/copytoram/ ; then
+ echo "ERROR: failed to copy '/run/archiso/bootmnt/autorun*' to '/run/archiso/copytoram/'"
+ launch_interactive_shell
+ fi