Hi, the backup files are there (see below). Perhaps, even though the
renaming and unlinking in strace look it is paired, somewhere between
the renames and unlinks xorriso is called by grub-mkrescue, and the unlinks
only takes place after the run; still, the files get deleted after
unsuccessful run of xorriso, hence they are not seen without your wrapper
script. There is restore_backup_atexit function in grub-install-common.c, which
calls "clean_grub_dir_real". The code is #ifdef HAVE_ATEXIT


Best regards,
Adam



renergy ~ # grub-mkrescue -o output.iso 
--xorriso="$HOME"/xorriso_wrapper_ls_locale
/root/xorriso_wrapper_ls_locale : ls -l /tmp/grub.xrifVw/boot/grub/locale :
total 10960
-rw-r--r-- 1 root root 127089 May 28 10:15 ast.mo
-rw-r--r-- 1 root root 127089 May 28 10:15 ast.mo~
-rw-r--r-- 1 root root 127966 May 28 10:15 ca.mo
-rw-r--r-- 1 root root 127966 May 28 10:15 ca.mo~
-rw-r--r-- 1 root root 119228 May 28 10:15 da.mo
-rw-r--r-- 1 root root 119228 May 28 10:15 da.mo~
-rw-r--r-- 1 root root 150650 May 28 10:15 de.mo
-rw-r--r-- 1 root root 150650 May 28 10:15 de.mo~
-rw-r--r-- 1 root root 226648 May 28 10:15 d...@hebrew.mo
-rw-r--r-- 1 root root 226648 May 28 10:15 d...@hebrew.mo~
-rw-r--r-- 1 root root 150657 May 28 10:15 de_CH.mo
-rw-r--r-- 1 root root 150657 May 28 10:15 de_CH.mo~
-rw-r--r-- 1 root root 188002 May 28 10:15 e...@arabic.mo
-rw-r--r-- 1 root root 188002 May 28 10:15 e...@arabic.mo~
-rw-r--r-- 1 root root 177539 May 28 10:15 e...@cyrillic.mo
-rw-r--r-- 1 root root 177539 May 28 10:15 e...@cyrillic.mo~
-rw-r--r-- 1 root root 177536 May 28 10:15 e...@greek.mo
-rw-r--r-- 1 root root 177536 May 28 10:15 e...@greek.mo~
-rw-r--r-- 1 root root 203723 May 28 10:15 e...@hebrew.mo
-rw-r--r-- 1 root root 203723 May 28 10:15 e...@hebrew.mo~
-rw-r--r-- 1 root root 157104 May 28 10:15 e...@piglatin.mo
-rw-r--r-- 1 root root 157104 May 28 10:15 e...@piglatin.mo~
-rw-r--r-- 1 root root 138592 May 28 10:15 e...@quot.mo
-rw-r--r-- 1 root root 138592 May 28 10:15 e...@quot.mo~
-rw-r--r-- 1 root root  43394 May 28 10:15 eo.mo
-rw-r--r-- 1 root root  43394 May 28 10:15 eo.mo~
-rw-r--r-- 1 root root 130267 May 28 10:15 es.mo
-rw-r--r-- 1 root root 130267 May 28 10:15 es.mo~
-rw-r--r-- 1 root root 132479 May 28 10:15 fi.mo
-rw-r--r-- 1 root root 132479 May 28 10:15 fi.mo~
-rw-r--r-- 1 root root 157703 May 28 10:15 fr.mo
-rw-r--r-- 1 root root 157703 May 28 10:15 fr.mo~
-rw-r--r-- 1 root root 103027 May 28 10:15 gl.mo
-rw-r--r-- 1 root root 103027 May 28 10:15 gl.mo~
-rw-r--r-- 1 root root  91753 May 28 10:15 he.mo
-rw-r--r-- 1 root root  91753 May 28 10:15 he.mo~
-rw-r--r-- 1 root root 130252 May 28 10:15 hr.mo
-rw-r--r-- 1 root root 130252 May 28 10:15 hr.mo~
-rw-r--r-- 1 root root 137952 May 28 10:15 hu.mo
-rw-r--r-- 1 root root 137952 May 28 10:15 hu.mo~
-rw-r--r-- 1 root root  28229 May 28 10:15 id.mo
-rw-r--r-- 1 root root  28229 May 28 10:15 id.mo~
-rw-r--r-- 1 root root 116936 May 28 10:15 it.mo
-rw-r--r-- 1 root root 116936 May 28 10:15 it.mo~
-rw-r--r-- 1 root root  45083 May 28 10:15 ja.mo
-rw-r--r-- 1 root root  45083 May 28 10:15 ja.mo~
-rw-r--r-- 1 root root 156882 May 28 10:15 ka.mo
-rw-r--r-- 1 root root 156882 May 28 10:15 ka.mo~
-rw-r--r-- 1 root root 156029 May 28 10:15 ko.mo
-rw-r--r-- 1 root root 156029 May 28 10:15 ko.mo~
-rw-r--r-- 1 root root   7774 May 28 10:15 lg.mo
-rw-r--r-- 1 root root   7774 May 28 10:15 lg.mo~
-rw-r--r-- 1 root root 100930 May 28 10:15 lt.mo
-rw-r--r-- 1 root root 100930 May 28 10:15 lt.mo~
-rw-r--r-- 1 root root 128143 May 28 10:15 nb.mo
-rw-r--r-- 1 root root 128143 May 28 10:15 nb.mo~
-rw-r--r-- 1 root root 126941 May 28 10:15 nl.mo
-rw-r--r-- 1 root root 126941 May 28 10:15 nl.mo~
-rw-r--r-- 1 root root  61811 May 28 10:15 pa.mo
-rw-r--r-- 1 root root  61811 May 28 10:15 pa.mo~
-rw-r--r-- 1 root root 149584 May 28 10:15 pl.mo
-rw-r--r-- 1 root root 149584 May 28 10:15 pl.mo~
-rw-r--r-- 1 root root 131747 May 28 10:15 pt.mo
-rw-r--r-- 1 root root 131747 May 28 10:15 pt.mo~
-rw-r--r-- 1 root root  86581 May 28 10:15 pt_BR.mo
-rw-r--r-- 1 root root  86581 May 28 10:15 pt_BR.mo~
-rw-r--r-- 1 root root 158375 May 28 10:15 ro.mo
-rw-r--r-- 1 root root 158375 May 28 10:15 ro.mo~
-rw-r--r-- 1 root root 170229 May 28 10:15 ru.mo
-rw-r--r-- 1 root root 170229 May 28 10:15 ru.mo~
-rw-r--r-- 1 root root  93925 May 28 10:15 sl.mo
-rw-r--r-- 1 root root  93925 May 28 10:15 sl.mo~
-rw-r--r-- 1 root root 190584 May 28 10:15 sr.mo
-rw-r--r-- 1 root root 190584 May 28 10:15 sr.mo~
-rw-r--r-- 1 root root 128361 May 28 10:15 sv.mo
-rw-r--r-- 1 root root 128361 May 28 10:15 sv.mo~
-rw-r--r-- 1 root root  83570 May 28 10:15 tr.mo
-rw-r--r-- 1 root root  83570 May 28 10:15 tr.mo~
-rw-r--r-- 1 root root 199280 May 28 10:15 uk.mo
-rw-r--r-- 1 root root 199280 May 28 10:15 uk.mo~
-rw-r--r-- 1 root root 162663 May 28 10:15 vi.mo
-rw-r--r-- 1 root root 162663 May 28 10:15 vi.mo~
-rw-r--r-- 1 root root 139130 May 28 10:15 zh_CN.mo
-rw-r--r-- 1 root root 139130 May 28 10:15 zh_CN.mo~
-rw-r--r-- 1 root root  30315 May 28 10:15 zh_TW.mo
-rw-r--r-- 1 root root  30315 May 28 10:15 zh_TW.mo~

xorriso 1.5.6 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:output.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data,  131g free
Added to ISO image: directory '/'='/tmp/grub.xrifVw'
xorriso : UPDATE :     982 files added in 1 seconds
xorriso : UPDATE :     982 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 512 bytes from file 
'/usr/lib/grub/i386-pc/boot_hybrid.img'
ISO image produced: 13984 sectors
Written to medium : 13984 sectors at LBA 0
Writing to 'stdio:output.iso' completed successfully.

renergy ~ #


On 5/28/25 10:08 AM, Thomas Schmitt wrote:
Hi,

Adam Purkrt wrote:
renergy ~ # grub-mkrescue -o /does_not_exist/output.iso ; ls -a 
/tmp/grub.*/boot/grub/locale
[... no .mo~ files ...]

So we have to watch the situation while grub-mkrescue is still running.

The following script will serve as xorriso in this run.
I put it into my "$HOME", but any otheri location should be ok.
It shall be used like this

   grub-mkrescue -o output.iso --xorriso="$HOME"/xorriso_wrapper_ls_locale

Script text:
-----------------------------------------------------------------------
#!/bin/bash

# grub-mkrescue inquires features by running these arguments
if test "$*" = "-as mkisofs -help"
then
   xorriso "$@"
   exit $?
fi

# Look for the name of the /tmp directory with the GRUB2 files.
# It is the next argument after -r. But as default accept any /tmp/grub.*
next_is_dir=0
dir="."
for i in "$@"
do
   if test x"$i" = x"-r"
   then
     next_is_dir=1
   elif test $next_is_dir = 1
   then
     next_is_dir=0
     if echo "$i" | grep '^/tmp/grub.' >/dev/null 2>&1
     then
       test -d "$i" && dir="$i"
     fi
   elif test "$dir" = "."
   then
     if echo "$i" | grep '^/tmp/grub.' >/dev/null 2>&1
     then
       test -d "$i" && dir="$i"
     fi
   fi
done

if test "$dir" = ""
then
   echo "$0 : Cannot determine the path of the GRUB /tmp directory" >&2
else
   echo "$0 : ls -l $dir/boot/grub/locale :" >&2
   ls -l "$dir"/boot/grub/locale >&2
   echo >&2
fi

# Finally do what grub-mkrescue expects
xorriso "$@"

-----------------------------------------------------------------------

I get as message output on stderr:
-----------------------------------------------------------------------
.../xorriso_wrapper_ls_locale : ls -l /tmp/grub.hNYGI4/boot/grub/locale :
total 4364
-rw-r--r-- 1 thomas thomas 120553 May 28 10:04 ast.mo
-rw-r--r-- 1 thomas thomas 120975 May 28 10:04 ca.mo
...
-rw-r--r-- 1 thomas thomas  82609 May 28 10:04 zh_CN.mo
-rw-r--r-- 1 thomas thomas  29713 May 28 10:04 zh_TW.mo

... messages of real xorriso ...

-----------------------------------------------------------------------

If this script does not show .mo~ files but the ISO does, then i am
out of ideas for now. (Crossing fingers ...)


Have a nice day :)

Thomas



Reply via email to