Page 1 of 1

problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 2:24 am
by asqwerth
This is a strange issue because my MX23-KDE didn't have this problem, only MX23-XFCE (RC). The problem being that os-prober continues to work even though I said no, using dpkg-reconfigure grub-pc. [the question is phrased as "do you want to ENABLE?" instead of the old setting in /etc/default/grub where you say true or false to DISABLE or-prober.]

Last night after updating my Manjaro install which controls grub, there was an issue booting into Manjaro, so I booted into MX23 Xfce. I decided to update grub, then grub-install MX23 XFCE's grub into sda MBR to make it the controlling grub. However, the update-grub took 15-20 mins because os-prober was searching for my numerous distros on the PC. I was puzzled because I could have sworn I had already followed @fehlix 's instructions here: viewtopic.php?p=726015#p726015

to make sure os-prober was disabled when I first installed MX23 XFCE .

Anyway, after the long wait, the new grub-config was generated and I wrote it to MBR with no issues. I assumed there was some grub package updates that had wiped my os-prober disabling.

Today I booted into MX23KDE (official release). After installing all updates, I ran sudo dpkg-reconfigure grub-pc. The GUI popped up, and the interface gave me a choice (Y and N radio buttons) for whether to enable os-prober or not. I said NO. And true enough, grub was updated and installed showing only the MX23 KDE entries.

I booted back into MX23 XFCE and tried first the CLI command given by fehlix -
echo "grub-pc grub2/enable_os_prober boolean false" | sudo debconf-set-selections

Nope, didn't work and I got another LONG update grub process.

I then ran sudo dpkg-reconfigure grub-pc.
This GUI was slightly different from the one in KDE plasma (are there Qt and gtk versions of dpkg-reconfigure??).

Instead of showing 2 radio buttion options for os-prober as in the KDE version of the GUI, this interface only showing a checkbox for "enable os-prober". So the option is tick the box for enable, and don't tick the box for "don't enable". The interface already showed NO TICK, ie, don't enable, so I clicked further on and update-grub started.

However it still ran os-prober and I had to sit through another LONG update grub process that generated all the other distros' entries.

This is puzzling since MX23KDE was fine.

Was there some difference between the RC and the final release that I may have missed? Or is there a significant difference between the KDE and XFCE version when it comes to grub related stuff? eg the qt version is different from gtk version of the dpkg-reconfigure GUI?

QSI of MX23 XFCE-RC

Code: Select all

System:
  Kernel: 6.1.0-13-amd64 [6.1.55-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-13-amd64 root=UUID=<filter> ro quiet splash
  Desktop: Xfce v: 4.18.1 tk: Gtk v: 3.24.36 info: xfce4-panel wm: Compiz v: 0.8.18 vt: 7
    dm: LightDM v: 1.26.0 Distro: MX-23_x64 Libretto July 24  2023 base: Debian GNU/Linux 12
    (bookworm)
Machine:
  Type: Desktop Mobo: MSI model: H97M-G43(MS-7924) v: 1.0 serial: <superuser required>
    BIOS: American Megatrends v: 2.4 date: 07/22/2014
CPU:
  Info: model: Intel Core i5-4460 bits: 64 type: MCP arch: Haswell gen: core 4 level: v3
    note: check built: 2013-15 process: Intel 22nm family: 6 model-id: 0x3C (60) stepping: 3
    microcode: 0x28
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB
    L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 2300 min/max: 800/3400 scaling: driver: intel_cpufreq governor: ondemand
    cores: 1: 2300 2: 2300 3: 2300 4: 2300 bogomips: 25599
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling status: Not affected
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data status: Unknown: No mitigations
  Type: retbleed status: Not affected
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW, STIBP: disabled, RSB
    filling, PBRSB-eIBRS: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics vendor: Micro-Star MSI
    driver: i915 v: kernel arch: Gen-7.5 process: Intel 22nm built: 2013 ports: active: VGA-1
    empty: DP-1, HDMI-A-1, HDMI-A-2, HDMI-A-3 bus-ID: 00:02.0 chip-ID: 8086:0412 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 compositor: Compiz v: 0.8.18 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: crocus gpu: i915 display-ID: :0.0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22") s-diag: 582mm (22.93")
  Monitor-1: VGA-1 model: Samsung S22F350 serial: <filter> built: 2017 res: 1920x1080 hz: 60
    dpi: 102 gamma: 1.2 size: 477x268mm (18.78x10.55") diag: 547mm (21.5") ratio: 16:9 modes:
    max: 1920x1080 min: 720x400
  API: OpenGL v: 4.6 Mesa 22.3.6 renderer: Mesa Intel HD Graphics 4600 (HSW GT2)
    direct-render: Yes
Audio:
  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Micro-Star MSI
    driver: snd_hda_intel v: kernel bus-ID: 00:03.0 chip-ID: 8086:0c0c class-ID: 0403
  Device-2: Intel 9 Series Family HD Audio vendor: Micro-Star MSI 9 driver: snd_hda_intel
    v: kernel bus-ID: 00:1b.0 chip-ID: 8086:8ca0 class-ID: 0403
  API: ALSA v: k6.1.0-13-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 0.3.65 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI
    driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 1 port: e000 bus-ID: 02:00.0
    chip-ID: 10ec:8168 class-ID: 0200
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Drives:
  Local Storage: total: 5.57 TiB used: 773.05 GiB (13.5%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: A-Data model: SP900 size: 119.24 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> scheme: MBR
  ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital model: WD30EZRX-00D8PB0 size: 2.73 TiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 0A80 scheme: GPT
  ID-3: /dev/sdc maj-min: 8:32 vendor: Western Digital model: WD30EZRX-00D8PB0 size: 2.73 TiB
    block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 5400 serial: <filter>
    rev: 0A80 scheme: GPT
Partition:
  ID-1: / raw-size: 57.74 GiB size: 56.53 GiB (97.91%) used: 15.45 GiB (27.3%) fs: ext4
    dev: /dev/sda1 maj-min: 8:1
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 14.9 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda2
    maj-min: 8:2
Sensors:
  System Temperatures: cpu: 65.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: 2280 pm: dpkg pkgs: 2267 libs: 1153 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 13
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list
    1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb http://it.mxrepo.com/mx/repo/ bookworm main non-free
  Active apt repos in: /etc/apt/sources.list.d/nordvpn.list
    1: deb https://repo.nordvpn.com/deb/nordvpn/debian stable main
  Active apt repos in: /etc/apt/sources.list.d/softmaker.list
    1: deb http://shop.softmaker.com/repo/apt stable non-free
Info:
  Processes: 254 Uptime: 27m wakeups: 1 Memory: 15.49 GiB used: 2.96 GiB (19.1%) Init: SysVinit
  v: 3.06 runlevel: 5 default: graphical tool: systemctl Compilers: gcc: 12 Client: shell wrapper
  v: 5.2.15-release inxi: 3.3.26
Boot Mode: BIOS (legacy, CSM, MBR)
[MX23 KDE is on the same computer, different drive (sdb).]

Terminal output for trying both ways to change the debconf-db flag:

Code: Select all

tuaz@mx23rc3:~
$ echo "grub-pc grub2/enable_os_prober boolean false" | sudo debconf-set-selections
[sudo] password for tuaz:           
tuaz@mx23rc3:~
$ sudo update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-11-amd64
Found initrd image: /boot/initrd.img-6.1.0-11-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
Found Manjaro Linux (23.0.3) on /dev/sda3
Found MX 19.4 patito feo (19.4 ) on /dev/sdb1
Found Artix Linux (rolling) on /dev/sdb11
Found MX 19.4 patito feo (19.4 ) on /dev/sdb15
Found Fedora Linux 37 (Thirty Seven) on /dev/sdb16
Found MX 21.3 Wildflower (21.3) on /dev/sdb18
Found Manjaro Linux (23.0.3) on /dev/sdb2
Found Void Linux on /dev/sdb20
Found MX 21.3 Wildflower (21.3) on /dev/sdb21
Found MX 19.4 patito feo (19.4 ) on /dev/sdb23
Found PCLinuxOS on /dev/sdb4
Found Arch Linux on /dev/sdb5
Found MX 23 Libretto (23) on /dev/sdb6
Found Solus (4.4) on /dev/sdb7
Found KDE neon Testing Edition (22.04) on /dev/sdb8
done

tuaz@mx23rc3:~
$ sudo dpkg-reconfigure grub-pc
grub-pc: Running grub-install ...
Installing for i386-pc platform.
grub-install: warning: File system `ext2' doesn't support embedding.
grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
Installation finished. No error reported.
  grub-install success for /dev/sda1
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-11-amd64
Found initrd image: /boot/initrd.img-6.1.0-11-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
Found Manjaro Linux (23.0.3) on /dev/sda3
Found MX 19.4 patito feo (19.4 ) on /dev/sdb1
Found Artix Linux (rolling) on /dev/sdb11
Found MX 19.4 patito feo (19.4 ) on /dev/sdb15
Found Fedora Linux 37 (Thirty Seven) on /dev/sdb16
Found MX 21.3 Wildflower (21.3) on /dev/sdb18
Found Manjaro Linux (23.0.3) on /dev/sdb2
Found Void Linux on /dev/sdb20
Found MX 21.3 Wildflower (21.3) on /dev/sdb21
Found MX 19.4 patito feo (19.4 ) on /dev/sdb23
Found PCLinuxOS on /dev/sdb4
Found Arch Linux on /dev/sdb5
Found MX 23 Libretto (23) on /dev/sdb6
Found Solus (4.4) on /dev/sdb7
Found KDE neon Testing Edition (22.04) on /dev/sdb8
done
tuaz@mx23rc3:~
$ 


Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 2:39 am
by fehlix
asqwerth wrote: Fri Oct 13, 2023 2:24 am The problem being that os-prober continues to work even though I said no
Maybe post /etc/default/grub.

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 2:57 am
by asqwerth

Code: Select all

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(unset PRETTY_NAME; (. /etc/lsb-release; echo ${PRETTY_NAME:?}) 2>/dev/null || echo Debian)"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

#run dpkg-reconfigure grub-pc to allow toggle of os-prober
#GRUB_DISABLE_OS_PROBER=false

#GRUB_DISABLE_OS_PROBER=false
if [ -e /etc/default/grub.mx-defaults ]; then
     .  /etc/default/grub.mx-defaults
fi
#GRUB_DISABLE_OS_PROBER=false

GRUB_THEME="/boot/grub/themes/mx_linux/theme.txt"

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 3:14 am
by asqwerth
THis is the /etc/default/grub from MX23 KDE

Code: Select all

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(unset PRETTY_NAME; (. /etc/lsb-release; echo ${PRETTY_NAME:?}) 2>/dev/null || echo Debian)"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=1024x768

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

#run dpkg-reconfigure grub-pc to allow toggle of os-prober
#GRUB_DISABLE_OS_PROBER=false

#GRUB_DISABLE_OS_PROBER=false
if [ -e /etc/default/grub.mx-defaults ]; then
     .  /etc/default/grub.mx-defaults
fi
#GRUB_DISABLE_OS_PROBER=false

GRUB_THEME="/boot/grub/themes/mx_linux/theme.txt"

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 4:24 am
by fehlix
OK, some more "questions":

Code: Select all

sudo debconf-get-selections | grep grub2/enable_os_prober

and

Code: Select all

head  /etc/grub.d/30_os-prober

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 4:28 am
by asqwerth

Code: Select all

$ sudo debconf-get-selections | grep grub2/enable_os_prober

[sudo] password for tuaz:           
grub-pc	grub2/enable_os_prober	boolean	false

Code: Select all

$ head  /etc/grub.d/30_os-prober
#! /bin/sh

#tag for mx-system update
#mx-system 20.11.02+4

export LVM_SUPPRESS_FD_WARNINGS=true

if [ "x$(debconf-get-selections |grep  '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then
   export GRUB_DISABLE_OS_PROBER="false"
fi

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 4:58 am
by fehlix
OK, I may see what it is, and guess they changed somewhere their logic a bit.
Assuming you are not needing a quick solution now,
but rather something for the next intended update-grub run,
I'd prefer to run some other tests esp. for cases where a grub-package upgrade comes along.

Otherwise if you want a potential solution now and perhaps in case you are going to help to check this proposed solution:
May be run this - but only once:

Code: Select all

sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n   export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober

The one-liner with change those lines at the beginning of /etc/grub.d/30_os-prober
from

Code: Select all

if [ "x$(debconf-get-selections |grep  '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then
   export GRUB_DISABLE_OS_PROBER="false"
fi
to

Code: Select all

if [ "x$(debconf-get-selections |grep  '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then
   export GRUB_DISABLE_OS_PROBER="false"
else
   export GRUB_DISABLE_OS_PROBER="true"
fi
and by this change probably achieve the intended goal.
Please try it and let us know.
Thanks

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 5:03 am
by asqwerth
No worries, I'll be your guinea pig!

Before I run the commands, the first one says:

sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober

Is it really "aelse" ?

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 5:09 am
by m_pav
asqwerth wrote: Fri Oct 13, 2023 5:03 am Is it really "aelse" ?
Exactly what I thought. Ran todays updates, sure enough it lost the the GRUB Windows entry on my spare dual-boot machine, then manually edited in the changes and gave it a test, all it added was a memtest-64.efi, it did not pick up Windows

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 5:36 am
by fehlix
asqwerth wrote: Fri Oct 13, 2023 5:03 am No worries, I'll be your guinea pig!

Before I run the commands, the first one says:

sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober

Is it really "aelse" ?
yes, in "aelse" the "a" is a sed command, which means: append a new line with all the following text.
which means:
the sed command expression
aelse\n export GRUB_DISABLE_OS_PROBER="true"

appends a new line

else\n export GRUB_DISABLE_OS_PROBER="true"

where \n is also replaced with an addtional new-line
which gives:

Code: Select all

else
   export GRUB_DISABLE_OS_PROBER="true"

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 5:46 am
by m_pav
You may have missed my intent, it didn't fix the missing windows in my test, but I'll have to leave it for now cause it's late at night and check back in the morning

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 5:57 am
by asqwerth
fehlix wrote: Fri Oct 13, 2023 5:36 am
asqwerth wrote: Fri Oct 13, 2023 5:03 am No worries, I'll be your guinea pig!

Before I run the commands, the first one says:

sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober

Is it really "aelse" ?
yes, in "aelse" the "a" is a sed command, which means: append a new line with all the following text.
which means:
the sed command expression
aelse\n export GRUB_DISABLE_OS_PROBER="true"

appends a new line

else\n export GRUB_DISABLE_OS_PROBER="true"

where \n is also replaced with an addtional new-line
which gives:

Code: Select all

else
   export GRUB_DISABLE_OS_PROBER="true"
@fehlix your command works to stop the os-prober from running. An update-grub now only generates the entries for MX23 XFCE itself. Thanks.

@m_pav yours seems to be the opposite problem from mine, in that you want os_prober to be enabled, to run and to detect Windows.

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Fri Oct 13, 2023 6:05 am
by fehlix
asqwerth wrote: Fri Oct 13, 2023 5:57 am
fehlix wrote: Fri Oct 13, 2023 5:36 am
asqwerth wrote: Fri Oct 13, 2023 5:03 am No worries, I'll be your guinea pig!

Before I run the commands, the first one says:

sudo sed -i '/export GRUB_DISABLE_OS_PROBER/aelse\n export GRUB_DISABLE_OS_PROBER="true"' /etc/grub.d/30_os-prober

Is it really "aelse" ?
yes, in "aelse" the "a" is a sed command, which means: append a new line with all the following text.
which means:
the sed command expression
aelse\n export GRUB_DISABLE_OS_PROBER="true"

appends a new line

else\n export GRUB_DISABLE_OS_PROBER="true"

where \n is also replaced with an addtional new-line
which gives:

Code: Select all

else
   export GRUB_DISABLE_OS_PROBER="true"
@fehlix your command works to stop the os-prober from running. An update-grub now only generates the entries for MX23 XFCE itself. Thanks.

@m_pav yours seems to be the opposite problem from mine, in that you want os_prober to be enabled, to run and to detect Windows.
Thanks, for the brave test.

In case some one wants to have the os-prober run always enabled - not disabled - do run

Code: Select all

sudo dpkg-reconfigure grub-pc
and tick the check mark "Run os-prober automatically to detect and boot other OSes?"
followed by "Next" , for BIOS-GRUB the selection of MBR-target for the bios-grub-pc boot loader should be selected.

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Wed Oct 18, 2023 8:55 am
by asqwerth
fehlix wrote: Fri Oct 13, 2023 6:05 am
Thanks, for the brave test.

...
@fehlix

I booted into MX23 XFCE again today and noted that the grub menu list still seemed rather long even though I ran update grub last time after running your command to help disable os_prober.

So I ran your command and then update-grub again, and got this error message in the os_prober script:

Code: Select all

$ sudo update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-11-amd64
Found initrd image: /boot/initrd.img-6.1.0-11-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
/etc/grub.d/30_os-prober: 12: Syntax error: "else" unexpected (expecting "fi")
Anyway, I thought I would install updates while booted into MX23 before I rebooted to check the grub menu, and got even more errors and issues. Looks like because of the error in your command, errors are generated when the updates require the removal of an older kernel. See terminal output below.

Code: Select all

$ sudo apt update
Hit:1 http://deb.debian.org/debian bookworm-updates InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease                                              
Hit:3 http://security.debian.org/debian-security bookworm-security InRelease                       
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease                                      
Hit:5 http://it.mxrepo.com/mx/repo bookworm InRelease                                              
Hit:6 http://shop.softmaker.com/repo/apt stable InRelease                        
Hit:7 https://repo.nordvpn.com/deb/nordvpn/debian stable InRelease         
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
12 packages can be upgraded. Run 'apt list --upgradable' to see them.


$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libbotan-2-19 libclutter-gtk-1.0-0 libgnome-games-support-1-3 libgnome-games-support-common
  libmikmod3 libotr5 libqt6concurrent6 libqt6sql6 libqt6sql6-sqlite libqt6widgets6 librnp0
  libsdl-mixer1.2 libtspi1 linux-headers-6.1.0-11-common
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  linux-headers-6.1.0-11-amd64 linux-image-6.1.0-11-amd64
The following packages will be upgraded:
  gir1.2-javascriptcoregtk-4.0 gir1.2-webkit2-4.0 google-chrome-stable libjavascriptcoregtk-4.0-18
  libjavascriptcoregtk-4.1-0 libwebkit2gtk-4.0-37 libwebkit2gtk-4.1-0 mx-goodies mx-installer
  mx-remaster mx-system timeshift
12 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
Need to get 161 MB of archives.
After this operation, 403 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security bookworm-security/main amd64 gir1.2-webkit2-4.0 amd64 2.42.1-1~deb12u1 [102 kB]
Get:2 http://security.debian.org/debian-security bookworm-security/main amd64 gir1.2-javascriptcoregtk-4.0 amd64 2.42.1-1~deb12u1 [46.8 kB]
Get:3 http://security.debian.org/debian-security bookworm-security/main amd64 libwebkit2gtk-4.0-37 amd64 2.42.1-1~deb12u1 [20.3 MB]
Get:4 https://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 118.0.5993.88-1 [104 MB]
Get:5 http://security.debian.org/debian-security bookworm-security/main amd64 libjavascriptcoregtk-4.0-18 amd64 2.42.1-1~deb12u1 [7,529 kB]
Get:6 http://security.debian.org/debian-security bookworm-security/main amd64 libwebkit2gtk-4.1-0 amd64 2.42.1-1~deb12u1 [20.3 MB]
Get:7 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-remaster all 23.10.01mx23 [170 kB]       
Get:8 http://security.debian.org/debian-security bookworm-security/main amd64 libjavascriptcoregtk-4.1-0 amd64 2.42.1-1~deb12u1 [7,529 kB]
Get:9 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-goodies all 23.09.02 [49.1 kB]           
Get:10 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-installer amd64 23.10.02mx23 [518 kB]
Get:11 http://it.mxrepo.com/mx/repo bookworm/main amd64 mx-system all 23.10.01mx23 [72.9 kB]
Get:12 http://it.mxrepo.com/mx/repo bookworm/main amd64 timeshift amd64 23.07.1-1+mx23+2 [686 kB]
Fetched 161 MB in 3s (63.3 MB/s)    
(Reading database ... 444442 files and directories currently installed.)
Removing linux-headers-6.1.0-11-amd64 (6.1.38-4) ...
Removing linux-image-6.1.0-11-amd64 (6.1.38-4) ...
/etc/kernel/prerm.d/dkms:
dkms: removing: 8812au 5.13.6 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m 8812au -v 5.13.6 -k 6.1.0-11-amd64 -a x86_64
Module 8812au-5.13.6 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

8812au.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: broadcom-sta 6.30.223.271 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m broadcom-sta -v 6.30.223.271 -k 6.1.0-11-amd64 -a x86_64
Module broadcom-sta-6.30.223.271 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

wl.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: rtl8821ce 5.5.2.1+git20230504 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m rtl8821ce -v 5.5.2.1+git20230504 -k 6.1.0-11-amd64 -a x86_64
grep: /lib/modules/6.1.0-11-amd64/build/.config: No such file or directory
Deprecated feature: MODULES_CONF (/var/lib/dkms/rtl8821ce/5.5.2.1+git20230504/source/dkms.conf)
Module rtl8821ce-5.5.2.1+git20230504 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

rtl8821ce.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: rtl8821cu 5.12.0 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m rtl8821cu -v 5.12.0 -k 6.1.0-11-amd64 -a x86_64
Module rtl8821cu-5.12.0 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

8821cu.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
dkms: removing: virtualbox 7.0.10 (6.1.0-11-amd64) (x86_64)
/usr/sbin/dkms.mx remove -m virtualbox -v 7.0.10 -k 6.1.0-11-amd64 -a x86_64
Module virtualbox-7.0.10 for kernel 6.1.0-11-amd64 (x86_64).
Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/6.1.0-11-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.
depmod...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-11-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
/etc/grub.d/30_os-prober: 12: Syntax error: "else" unexpected (expecting "fi")
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-11-amd64 (--remove):
 installed linux-image-6.1.0-11-amd64 package post-removal script subprocess returned error exit sta
tus 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-6.1.0-11-amd64
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)


tuaz@mx23rc3:~
$ sudo dpkg -C
The following packages are only half installed, due to problems during
installation.  The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
 linux-image-6.1.0-11-amd64 Linux 6.1 for 64-bit PCs (signed)


tuaz@mx23rc3:~
$ sudo dpkg --remove linux-image-6.1.0-11-amd64
(Reading database ... 432992 files and directories currently installed.)
Removing linux-image-6.1.0-11-amd64 (6.1.38-4) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.1.0-11-amd64
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found theme: /boot/grub/themes/mx_linux/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-13-amd64
Found initrd image: /boot/initrd.img-6.1.0-13-amd64
Found linux image: /boot/vmlinuz-6.1.0-12-amd64
Found initrd image: /boot/initrd.img-6.1.0-12-amd64
Found linux image: /boot/vmlinuz-6.1.0-10-amd64
Found initrd image: /boot/initrd.img-6.1.0-10-amd64
/etc/grub.d/30_os-prober: 12: Syntax error: "else" unexpected (expecting "fi")
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 2
dpkg: error processing package linux-image-6.1.0-11-amd64 (--remove):
 installed linux-image-6.1.0-11-amd64 package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 linux-image-6.1.0-11-amd64
tuaz@mx23rc3:~
$

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Wed Oct 18, 2023 9:00 am
by asqwerth
Added: I am still able to reboot using the current kernel, but because of the error during kernel removal, the updates are unable to go through.


YIKES! I just realised your original post with the command said to run it only once. So I have now run it once or twice more. That's probably the problem, right?


SOLVED - I edited the os-prober script as root and removed the additional added lines.

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Wed Oct 18, 2023 9:54 am
by fehlix
asqwerth wrote: Wed Oct 18, 2023 8:55 am I booted into MX23 XFCE again today and noted that the grub menu list still seemed rather long even though I ran update grub last time after running your command to help disable os_prober.

So I ran your command and then update-grub again, and got this error message in the os_prober script:
++EDIT+++, ok you fixed it.
#---------
maybe you run the command twice.
Better show how it looks now, with

Code: Select all

head -20 /etc/grub.d/30_os-prober


Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Wed Oct 18, 2023 10:18 am
by asqwerth

Code: Select all

$ head -20 /etc/grub.d/30_os-prober

#! /bin/sh

#tag for mx-system update
#mx-system 20.11.02+4

export LVM_SUPPRESS_FD_WARNINGS=true

if [ "x$(debconf-get-selections |grep  '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then
   export GRUB_DISABLE_OS_PROBER="false"
else
   export GRUB_DISABLE_OS_PROBER="true"
#else
#   export GRUB_DISABLE_OS_PROBER="true"
#else
#   export GRUB_DISABLE_OS_PROBER="true"
fi

set -e
I commented out what I thought were the wrongly-added extra lines (instead of deleting them), to test my solution.

Re: problem disabling os_prober with dpkg-reconfigure grub-pc

Posted: Wed Oct 18, 2023 10:43 am
by fehlix
asqwerth wrote: Wed Oct 18, 2023 10:18 am

Code: Select all

$ head -20 /etc/grub.d/30_os-prober

#! /bin/sh

#tag for mx-system update
#mx-system 20.11.02+4

export LVM_SUPPRESS_FD_WARNINGS=true

if [ "x$(debconf-get-selections |grep  '^grub-pc\sgrub2/enable_os_prober\sboolean\strue' | awk '{print $4}')" = "xtrue" ]; then
   export GRUB_DISABLE_OS_PROBER="false"
else
   export GRUB_DISABLE_OS_PROBER="true"
#else
#   export GRUB_DISABLE_OS_PROBER="true"
#else
#   export GRUB_DISABLE_OS_PROBER="true"
fi

set -e
I commented out what I thought were the wrongly-added extra lines (instead of deleting them), to test my solution.
Seems you have run it three times and added every time a new else clause.