Bug 18552 - some grub2 command removes content from /boot/grub2/fonts/unicode.pf2
Summary: some grub2 command removes content from /boot/grub2/fonts/unicode.pf2
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: High critical
Target Milestone: ---
Assignee: Barry Jackson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 416
  Show dependency treegraph
 
Reported: 2016-05-26 22:05 CEST by Barry Jackson
Modified: 2016-05-27 18:53 CEST (History)
1 user (show)

See Also:
Source RPM: grub2
CVE:
Status comment:


Attachments

Description Barry Jackson 2016-05-26 22:05:18 CEST
Description of problem:
When using drakboot to attempt to change the default boot entry in grub2 in a UEFI system with graphical grub2 menu the process shows no GUI errors, but on next boot the non-graphical menu is used.

After several hours of investigation I found that /boot/grub2/fonts/unicode.pf2 was zero bytes!

After repairing the system I have repeated this several times.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Go to MCC->Boot->Set up boot system
2. Select Grub2 with graphical menu
3. Select default boot device
4. Change the default boot entry to another system
5. Reboot and the graphical menu is now text menu - and the default selection is unchanged.
6. Check that /boot/grub2/fonts/unicode.pf2 is now zero bytes!
7. Check also that grub2-mageia-theme is still installed and that all the other files are still in /boot/grub2/themes/maggy and not zero bytes.
Barry Jackson 2016-05-26 22:08:30 CEST

Priority: Normal => High
Blocks: (none) => 416
Assignee: bugsquad => thierry.vignaud

Comment 1 Thierry Vignaud 2016-05-26 22:46:09 CEST
That's usually symptom of missing fsync...

However there's no code in drakx touching that file.
Drakx only manage grub2 by running std grub2 commands and altering /etc files
Only grub2's tools touch /boot/grub2/fonts

Especially grub2-install looks for /usr/share/unicode.pf2 and since it doesn't exist maybe it's doing garbage with the file packaged by the theme

Don't reassign unless you can probe it's drakxtools fault.
AFAIC it's a grub2 bug.

Assignee: thierry.vignaud => zen25000
Source RPM: drakxtools-curses-17.30-1.mga6 => (none)

Comment 2 Thierry Vignaud 2016-05-26 23:02:07 CEST
And btw you can check what does drakboot by looking at journalctl output...

CC: (none) => thierry.vignaud

Comment 3 Barry Jackson 2016-05-27 01:15:09 CEST
From sudo journalctl|grep drakboot

May 26 23:18:26 jackodesktop drakboot[10201]: ### Program is starting ###
May 26 23:18:26 jackodesktop drakboot[10201]: running: /sbin/modprobe dm_zero
May 26 23:18:26 jackodesktop drakboot[10201]: running: dmraid -s -c -c
May 26 23:18:26 jackodesktop drakboot[10201]: _raid_devices_raw
May 26 23:18:26 jackodesktop drakboot[10201]: running: dmraid -d -s -c -c
May 26 23:18:26 jackodesktop drakboot[10201]: running: dmraid -r -c -c
May 26 23:18:26 jackodesktop drakboot[10201]: dmraid:
May 26 23:18:26 jackodesktop drakboot[10201]: using dmraid on
May 26 23:18:26 jackodesktop drakboot[10201]: HDIO_GETGEO on /dev/sda succeeded: heads=255 sectors=63 cylinders=14593 start=0
May 26 23:18:26 jackodesktop drakboot[10201]: HDIO_GETGEO on /dev/sdb succeeded: heads=255 sectors=63 cylinders=56065 start=0
May 26 23:18:26 jackodesktop drakboot[10201]: HDIO_GETGEO on /dev/sdc succeeded: heads=255 sectors=63 cylinders=56065 start=0
May 26 23:18:26 jackodesktop drakboot[10201]: An error occurred while getting the geometry of block device /dev/sdd: No medium found
May 26 23:18:26 jackodesktop drakboot[10201]: An error occurred while getting the geometry of block device /dev/sde: No medium found
May 26 23:18:26 jackodesktop drakboot[10201]: An error occurred while getting the geometry of block device /dev/sdf: No medium found
May 26 23:18:26 jackodesktop drakboot[10201]: An error occurred while getting the geometry of block device /dev/sdg: No medium found
May 26 23:18:26 jackodesktop drakboot[10201]: An error occurred while getting the geometry of block device /dev/sdh: No medium found
May 26 23:18:26 jackodesktop drakboot[10201]: id2hd:
May 26 23:18:26 jackodesktop drakboot[10201]: id2edd:
May 26 23:18:26 jackodesktop drakboot[10201]: test_for_bad_drives(/dev/sda on sector #62)
May 26 23:18:26 jackodesktop drakboot[10201]: found a gpt partition table on /dev/sda at sector 0
May 26 23:18:26 jackodesktop drakboot[10201]: running: udevadm settle
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda1
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: ext2 01b9e634-0aaa-480d-b042-e72a6b7efa13 master-grub
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda2
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: swap d0402b80-ef19-4956-9064-abe20fe77dc0
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda3
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: vfat 5B89-D9AE ESP
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda4
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: ext4 6e0e6790-c318-4bbe-b3cf-e925391b4d16 mageia5-root
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda5
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: ext4 18c8d8d4-dee6-4219-9dbf-a96d439ea76e mageia6-root
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda6
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: ext4 11a02822-8d84-4b80-8c94-49981b361ab0
May 26 23:18:26 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sda7
May 26 23:18:26 jackodesktop drakboot[10201]: blkid gave: ext4 a5ea7e67-7d24-4ecd-8271-fe662c87f258 sda7
May 26 23:18:26 jackodesktop drakboot[10201]: test_for_bad_drives(/dev/sdb on sector #62)
May 26 23:18:27 jackodesktop drakboot[10201]: found a gpt partition table on /dev/sdb at sector 0
May 26 23:18:27 jackodesktop drakboot[10201]: running: udevadm settle
May 26 23:18:27 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdb1
May 26 23:18:27 jackodesktop drakboot[10201]: blkid gave: ext4 b7356dc3-502a-4449-ba55-43df24a22678 backup
May 26 23:18:27 jackodesktop drakboot[10201]: test_for_bad_drives(/dev/sdc on sector #62)
May 26 23:18:28 jackodesktop drakboot[10201]: found a gpt partition table on /dev/sdc at sector 0
May 26 23:18:28 jackodesktop drakboot[10201]: running: udevadm settle
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc1
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext2 b3c462e9-fb8e-463a-a966-6d1824dee9d3 maingrub
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc2
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext4 2172e860-b9d6-49d0-b4e7-d58e20d50a2d store2
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc5
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: swap 1097bb8c-3820-4b3a-b796-b417c9aa56d8 swapmain
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc6
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext3 477c4865-8724-4457-b473-8079f33408e6 store
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc7
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext4 bc67b413-7b8d-455f-9c4b-226eaf2dec2b mydata
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc9
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext4 358a0880-46cd-4ca2-bdea-19ab73ed8e6a iso
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc10
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext4 8997666d-99c2-4f3c-8890-449b3cc9b484 home-new
May 26 23:18:28 jackodesktop drakboot[10201]: running: blkid -o udev -p /dev/sdc11
May 26 23:18:28 jackodesktop drakboot[10201]: blkid gave: ext4 f3c3c1d6-0ed7-47c6-8e38-6213fe7dc338 VMs
May 26 23:18:29 jackodesktop drakboot[10201]: running: grub2-editenv list
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.15-desktop-2.mga5 (on /dev/sda4) since /boot/vmlinuz-4.1.15-desktop-2.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.15-desktop-2.mga5 (recovery mode) (on /dev/sda4) since /boot/vmlinuz-4.1.15-desktop-2.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.15-desktop-1.mga5 (on /dev/sda4) since /boot/vmlinuz-4.1.15-desktop-1.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.15-desktop-1.mga5 (recovery mode) (on /dev/sda4) since /boot/vmlinuz-4.1.15-desktop-1.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.13-desktop-2.mga5 (on /dev/sda4) since /boot/vmlinuz-4.1.13-desktop-2.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.13-desktop-2.mga5 (recovery mode) (on /dev/sda4) since /boot/vmlinuz-4.1.13-desktop-2.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.12-desktop-1.mga5 (on /dev/sda4) since /boot/vmlinuz-4.1.12-desktop-1.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.12-desktop-1.mga5 (recovery mode) (on /dev/sda4) since /boot/vmlinuz-4.1.12-desktop-1.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.8-desktop-1.mga5 (on /dev/sda4) since /boot/vmlinuz-4.1.8-desktop-1.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 4.1.8-desktop-1.mga5 (recovery mode) (on /dev/sda4) since /boot/vmlinuz-4.1.8-desktop-1.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 3.19.8-desktop-3.mga5 (on /dev/sda4) since /boot/vmlinuz-3.19.8-desktop-3.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia, with Linux 3.19.8-desktop-3.mga5 (recovery mode) (on /dev/sda4) since /boot/vmlinuz-3.19.8-desktop-3.mga5 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.4-desktop-2.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.4-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.4-desktop-2.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.4-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.4-desktop-1.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.4-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.4-desktop-1.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.4-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.2-desktop-2.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.2-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.2-desktop-2.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.2-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.2-desktop-1.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.2-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.2-desktop-1.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.2-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.1-desktop-2.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.1-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.1-desktop-2.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.1-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.1-desktop-1.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.1-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.1-desktop-1.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.1-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.0-desktop-2.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.0-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.0-desktop-2.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.0-desktop-2.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.0-desktop-1.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.0-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.0-desktop-1.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.0-desktop-1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.0-desktop-0.rc8.1.mga6) 6 (on /dev/sda5) since /boot/vmlinuz-4.4.0-desktop-0.rc8.1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: dropping bootloader entry Mageia (4.4.0-desktop-0.rc8.1.mga6) 6 (recovery mode) (on /dev/sda5) since /boot/vmlinuz-4.4.0-desktop-0.rc8.1.mga6 doesn't exist
May 26 23:18:29 jackodesktop drakboot[10201]: running: grub2-editenv list
May 26 23:18:29 jackodesktop drakboot[10201]: perImageAppend is now root=UUID=18c8d8d4-dee6-4219-9dbf-a96d439ea76e ro splash quiet noiswmd resume=UUID=d0402b80-ef19-4956-9064-abe20fe77dc0
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /boot/EFI (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /home/baz/build (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory / (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /backup (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /store2 (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /store (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /mydata (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /iso (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /home (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /VMs (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /proc (and parents if necessary)
May 26 23:18:29 jackodesktop drakboot[10201]: created directory /proc (and parents if necessary)
May 26 23:20:46 jackodesktop drakboot[10201]: running: update-grub2
May 26 23:21:05 jackodesktop drakboot[10201]: running: grub2-editenv list
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /boot/EFI (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /home/baz/build (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory / (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /backup (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /store2 (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /store (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /mydata (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /iso (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /home (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /VMs (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /proc (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: created directory /proc (and parents if necessary)
May 26 23:21:15 jackodesktop drakboot[10201]: running: /sbin/chkconfig --list --type xinetd
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/mountpoint -q /sys/fs/cgroup/systemd
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/systemctl enable --no-reload acpi.service
May 26 23:21:15 jackodesktop drakboot[10201]: running: /sbin/chkconfig --list --type xinetd
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/mountpoint -q /sys/fs/cgroup/systemd
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/systemctl enable --no-reload acpid.service
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/mountpoint -q /sys/fs/cgroup/systemd
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/systemctl --quiet is-active acpid.service
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/mountpoint -q /sys/fs/cgroup/systemd
May 26 23:21:15 jackodesktop drakboot[10201]: running: /bin/systemctl --no-block restart acpid.service
May 26 23:21:16 jackodesktop drakboot[10201]: fs::get::device2part: unknown device <</dev/sda>>
May 26 23:21:16 jackodesktop drakboot[10201]: moved file /etc/default/grub to /etc/default/grub.old
May 26 23:21:16 jackodesktop drakboot[10201]: modified file /etc/default/grub
May 26 23:21:16 jackodesktop drakboot[10201]: moved file /boot/grub2/grub.cfg to /boot/grub2/grub.cfg.old
May 26 23:21:16 jackodesktop drakboot[10201]: running: update-grub2
May 26 23:21:34 jackodesktop drakboot[10201]: update-grub2 logs: mesg: ttyname failed: Inappropriate ioctl for device
May 26 23:21:34 jackodesktop drakboot[10201]: copied recursively /boot/grub2/grubenv to /boot/grub2/grubenv.old
May 26 23:21:34 jackodesktop drakboot[10201]: running: grub2-set-default Mageia (4.6.0-desktop-1.mga6) 6 (on /dev/sda5)
May 26 23:21:34 jackodesktop drakboot[10201]: created file /boot/.enough_space
May 26 23:21:34 jackodesktop drakboot[10201]: removed files/directories /boot/.enough_space
May 26 23:21:34 jackodesktop drakboot[10201]: moved file /boot/grub2/install.sh to /boot/grub2/install.sh.old
May 26 23:21:34 jackodesktop drakboot[10201]: running: sh /boot/grub2/install.sh
May 26 23:21:44 jackodesktop drakboot[10201]: removed files/directories /boot/grub2/drakboot.conf
May 26 23:21:44 jackodesktop drakboot[10201]: ### Program is exiting ###
---------------------------------------------

Creating a symlink:
/bin/ln -sf /boot/grub2/fonts/unicode.pf2 /usr/share/grub/unicode.pf2
or
/bin/ln -sf /boot/grub2/fonts/unicode.pf2 /usr/share/unicode.pf2
makes no difference.

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

The file gets clobbered right at the end of the process when running /usr/bin/drakboot from CLI just when this gets written to output:

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.

Failed to execute operation: No such file or directory

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

      If you want to list systemd services use 'systemctl list-unit-files'.
      To see services enabled on particular target use
      'systemctl list-dependencies [target]'.
Comment 4 Thierry Vignaud 2016-05-27 10:55:04 CEST
If you can reproduce it, just use "strace -f -e file ..." and you'll identify the culprit
Comment 5 Barry Jackson 2016-05-27 13:33:28 CEST
Last night it was fully reproducible but today it's just not happening.
I thought it was strace that was fixing it (timing?) but testing without strace it's now running without affecting unicode.pf2.

It does look from the strace that something is looking for unicode.pf2 in /usr/share/...  It seems that in certain situations when there is likelihood that the filesystem may not be readable at boot by grub2, grub2 tries to make a copy of unicode.pf2 from the usr/share/grub/ location to /boot/grub2/ and I'm guessing that it somehow was copying it over as an empty file. (although why it would in my system I have no idea (ext4))
I will add a copy in /usr/share/grub in the -common package.

However there is another issue with drakboot when changing the default.
It currently puts an entry in /boot/grub2/grubenv to be used when GRUB_DEFAULT=saved IIUC.
From my testing it appears not to add GRUB_DEFAULT=saved to /etc/default/grub.
Doing this manually and running update-grub2 throws a warning and the new default fails to work.

[baz@jackodesktop grub2]$ update-grub2
Password: 
Generating grub configuration file ...
Found theme: /boot/grub2/themes/maggy/theme.txt
Found linux image: /boot/vmlinuz-4.6.0-desktop-1.mga6
Found initrd image: /boot/initrd-4.6.0-desktop-1.mga6.img
Found linux image: /boot/vmlinuz-4.6.0-desktop-0.rc7.1.mga6
Found initrd image: /boot/initrd-4.6.0-desktop-0.rc7.1.mga6.img
Found linux image: /boot/vmlinuz-4.6.0-desktop-0.rc6.2.mga6
Found initrd image: /boot/initrd-4.6.0-desktop-0.rc6.2.mga6.img
Found linux image: /boot/vmlinuz-4.6.0-desktop-0.rc6.1.mga6
Found initrd image: /boot/initrd-4.6.0-desktop-0.rc6.1.mga6.img
Found linux image: /boot/vmlinuz-4.6.0-desktop-0.rc5.2.mga6
Found initrd image: /boot/initrd-4.6.0-desktop-0.rc5.2.mga6.img
Found linux image: /boot/vmlinuz-4.6.0-desktop-0.rc5.1.mga6                                                                    Found initrd image: /boot/initrd-4.6.0-desktop-0.rc5.1.mga6.img                                                                Found linux image: /boot/vmlinuz-4.6.0-desktop-0.rc4.1.mga6                                                                    Found initrd image: /boot/initrd-4.6.0-desktop-0.rc4.1.mga6.img                                                                Found linux image: /boot/vmlinuz-4.4.6-desktop-1.mga6                                                                          Found initrd image: /boot/initrd-4.4.6-desktop-1.mga6.img                                                                      Found linux image: /boot/vmlinuz-4.4.5-desktop-1.mga6                                                                          Found initrd image: /boot/initrd-4.4.5-desktop-1.mga6.img                                                                      Found linux image: /boot/vmlinuz-desktop                                                                         Found initrd image: /boot/initrd-desktop.img                                                                     Found Mageia 5 (5) on /dev/sda4                                                                       Found Mageia 6 (6) on /dev/sda5                                                                                                            
Warning: Please don't use old title âMageia (4.6.0-desktop-1.mga6) 6 (on /dev/sda5)â for GRUB_DEFAULT, use âAdvanced options for Mageia 6 (6) (on /dev/sda5)>Mageia (4.6.0-desktop-1.mga6) 6 (on /dev/sda5)â (for versions before 2.00) or âgnulinux-advanced-18c8d8d4-dee6-4219-9dbf-a96d439ea76e>gnulinux---18c8d8d4-dee6-4219-9dbf-a96d439ea76eâ (for 2.00 or later)                                                          
done

The head of /boot/grub2/grubenv is:

# GRUB Environment Block
saved_entry=Mageia (4.6.0-desktop-1.mga6) 6 (on /dev/sda5)
##########################################################---snip

I'm really wondering if trying to change the default from drakboot is worth the effort. Would it not be simpler to just remove the option to do it and leave users to use grub-customizer or read the grub2-manual?
Comment 6 Thierry Vignaud 2016-05-27 13:45:08 CEST
There's also a place where it looks for /boo/grub2/unicode.pf2 (w/o the "fonts/" part)

As for default entry: don't mix several issues inside
We can parse menuentry_id_option and save it in the config file instead.
But please open a new bug report for that
Comment 7 Barry Jackson 2016-05-27 15:21:30 CEST
Before adding /usr/share/grub/unicode.pf2) to grub2-common package:

$ sudo strace -f -o drakboot_strace.txt -e trace=file /usr/bin/drakboot

$ cat drakboot_strace.txt | grep "unicode.pf2"
27215 stat("/usr/share/grub/unicode.pf2", 0x7fffa5cbce10) = -1 ENOENT (No such file or directory)
27215 stat("/boot/grub2/unicode.pf2", 0x7fffa5cbce10) = -1 ENOENT (No such file or directory)
27215 stat("/usr/share/grub/unicode.pf2", 0x7fffa5cbce10) = -1 ENOENT (No such file or directory)
6640  stat("/usr/share/grub/unicode.pf2", 0x7ffdc4588dd0) = -1 ENOENT (No such file or directory)
6640  stat("/boot/grub2/unicode.pf2", 0x7ffdc4588dd0) = -1 ENOENT (No such file or directory)
6640  stat("/usr/share/grub/unicode.pf2", 0x7ffdc4588dd0) = -1 ENOENT (No such file or directory)
17963 open("/usr/share/grub/unicode.pf2", O_RDONLY) = -1 ENOENT (No such file or directory)

After adding /usr/share/grub/unicode.pf2) to grub2-common package:

$ cat drakboot_strace3.1.txt | grep "unicode.pf2"
23693 stat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
23707 execve("/usr/sbin/grub2-probe", ["/usr/sbin/grub2-probe", "-t", "fs", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
23707 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
23707 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
23739 execve("/usr/sbin/grub2-probe", ["/usr/sbin/grub2-probe", "-t", "abstraction", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
23739 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
23739 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
23772 execve("/usr/sbin/grub2-probe", ["/usr/sbin/grub2-probe", "--target=device", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
23772 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
23772 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
24002 execve("/usr/bin/grub2-mkrelpath", ["/usr/bin/grub2-mkrelpath", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
24002 lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2645  stat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2658  execve("/usr/sbin/grub2-probe", ["/usr/sbin/grub2-probe", "-t", "fs", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
2658  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2658  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2690  execve("/usr/sbin/grub2-probe", ["/usr/sbin/grub2-probe", "-t", "abstraction", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
2690  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2690  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2723  execve("/usr/sbin/grub2-probe", ["/usr/sbin/grub2-probe", "--target=device", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
2723  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
2723  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
3028  execve("/usr/bin/grub2-mkrelpath", ["/usr/bin/grub2-mkrelpath", "/usr/share/grub/unicode.pf2"], [/* 63 vars */]) = 0
3028  lstat("/usr/share/grub/unicode.pf2", {st_mode=S_IFREG|0644, st_size=2560080, ...}) = 0
13835 open("/usr/share/grub/unicode.pf2", O_RDONLY) = 5
13835 open("/boot/grub2/fonts/unicode.pf2", O_WRONLY|O_CREAT|O_TRUNC, 0644) = 6
Comment 8 Thierry Vignaud 2016-05-27 15:29:07 CEST
Please never put big chunks of logs as comments.
This make bug reports unreadable and they usually get wrapped by bugzilla.

There's indeed a subprocess that open the /boot/grub/fonts/unicode.of2 in RW mode. You should be able to identify it by looking for execve + 13835 what are the processes such as 13835 that open the font in RW mode.

Note that BTW Fedora does package this font in /usr/share/grub/unicode.pf2 and not in /boot/grub2/fonts.
It's obviously the job of some grub2 code to update /boot/grub2/fonts...

Summary: drakboot removes content from /boot/grub2/fonts/unicode.pf2 => some grub2 command removes content from /boot/grub2/fonts/unicode.pf2
Source RPM: (none) => grub2

Comment 9 Thierry Vignaud 2016-05-27 15:29:51 CEST
And BTW why os-prober(?) calls grub2-probe on the font...
Comment 10 Barry Jackson 2016-05-27 16:00:06 CEST
[baz@jackodesktop ~]$ cat drakboot_strace3.1.txt | grep 13835|grep execve
13835 execve("/sbin/grub2-install", ["grub2-install", "/dev/sda"], [/* 26 vars */]) = 0
Comment 11 Barry Jackson 2016-05-27 16:38:25 CEST
OK looking at grub2-install code it seems that it now copies /boot/grub2/fonts/unicode.pf2 from /usr/share/grub/unicode.pf2 when it is run, this was not always the case.

I will remove it from the theme package and do more testing later.
Comment 12 Barry Jackson 2016-05-27 18:53:54 CEST
Updated grub2 submitted to Cauldron with unicode.pf2 moved to /usr/share/grub.

Closing

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.