Syntax errors on grub dotfiles

Since some days ago, when I update something, and the GRUB creates a new config for adding the new snapshot, I get syntax errors. I didn't edit any dotfile. Does not say which dotfile is, only says

/usr/bin/grub-probe: warning: unknown device type nvme0n1.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 238
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

I tried the option of Repair GRUB config file on Garuda's boot repair tool, but I got the same as above. I attach all files in /etc/grub.d/, and in /etc/grub.d/proxifiedScripts with more of 238 lines.
Thanks for helping me!


/etc/grub.d/00_header
/etc/grub.d/20_linux_xen
/etc/grub.d/42_snapshots-btrfs
/etc/grub.d/proxifiedScripts/linux
/etc/grub.d/proxifiedScripts/os-prober

Post the result of

inxi -Fxxxza

Here.

1 Like
System:    Kernel: 5.10.4-107-tkg-bmq x86_64 bits: 64 compiler: gcc v: 10.2.0
           parameters: intel_pstate=passive BOOT_IMAGE=/@/boot/vmlinuz-linux-tkg-bmq
           root=UUID=04d7ae17-7f52-478d-b833-a6ef3032c868 rw rootflags=subvol=@ quiet splash
           rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1
           loglevel=3
           Console: tty 0 wm: kwin_x11 DM: SDDM Distro: Garuda Linux
Machine:   Type: Laptop System: ASUSTeK product: ROG Strix G531GT_G531GT v: 1.0 serial: <filter>
           Mobo: ASUSTeK model: G531GT v: 1.0 serial: <filter> UEFI: American Megatrends v: G531GT.306
           date: 03/11/2020
Battery:   ID-1: BAT0 charge: 42.2 Wh condition: 43.1/50.5 Wh (85%) volts: 12.5/12.5
           model: ASUSTeK ASUS Battery type: Li-ion serial: N/A status: Not charging
           Device-1: hidpp_battery_0 model: Logitech Wireless Keyboard serial: <filter>
           charge: 55% (should be ignored) rechargeable: yes status: Discharging
           Device-2: hidpp_battery_1 model: Logitech Wireless Mouse serial: <filter>
           charge: 55% (should be ignored) rechargeable: yes status: Discharging
CPU:       Info: 6-Core model: Intel Core i7-9750H socket: BGA1440 (U3E1) note: check bits: 64
           type: MT MCP arch: Kaby Lake note: check family: 6 model-id: 9E (158) stepping: A (10)
           microcode: DE L1 cache: 384 KiB L2 cache: 12 MiB L3 cache: 11.7 MiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 62469
           Speed: 2482 MHz min/max: 800/2600 MHz base/boost: 2475/8300 volts: 0.8 V ext-clock: 100 MHz
           Core speeds (MHz): 1: 2482 2: 2558 3: 2600 4: 2600 5: 2591 6: 2513 7: 2594 8: 2600 9: 1249
           10: 1541 11: 1840 12: 2553
           Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled
           Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT vulnerable
           Type: mds mitigation: Clear CPU buffers; SMT vulnerable
           Type: meltdown mitigation: PTI
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
           Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, IBRS_FW, STIBP:
           conditional, RSB filling
           Type: srbds mitigation: Microcode
           Type: tsx_async_abort status: Not affected
Graphics:  Device-1: Intel UHD Graphics 630 vendor: ASUSTeK driver: i915 v: kernel bus ID: 00:02.0
           chip ID: 8086:3e9b
           Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q] vendor: ASUSTeK driver: nvidia
           v: 460.27.04 alternate: nouveau,nvidia_drm bus ID: 01:00.0 chip ID: 10de:1f91
           Display: server: X.Org 1.20.10 compositor: kwin_x11 driver: modesetting,nvidia
           alternate: fbdev,intel,nouveau,nv,vesa display ID: :0 screens: 1
           Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1013x285mm (39.9x11.2")
           s-diag: 1052mm (41.4")
           Monitor-1: eDP-1 res: 1920x1080 hz: 60 dpi: 142 size: 344x194mm (13.5x7.6")
           diag: 395mm (15.5")
           Monitor-2: HDMI-1-0 res: 1920x1080 hz: 60 dpi: 82 size: 598x336mm (23.5x13.2")
           diag: 686mm (27")
           OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 20.3.2
           direct render: Yes
Audio:     Device-1: Intel Cannon Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel v: kernel
           alternate: snd_soc_skl,snd_sof_pci bus ID: 00:1f.3 chip ID: 8086:a348
           Sound Server: ALSA v: k5.10.4-107-tkg-bmq
Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel port: 5000
           bus ID: 00:14.3 chip ID: 8086:a370
           IF: wlo1 state: up mac: <filter>
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK
           driver: r8169 v: kernel port: 3000 bus ID: 03:00.0 chip ID: 10ec:8168
           IF: eno2 state: down mac: <filter>
Drives:    Local Storage: total: 476.94 GiB used: 29.72 GiB (6.2%)
           ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Micron model: 2200V MTFDHBA512TCK
           size: 476.94 GiB block size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4
           serial: <filter> rev: P1MA0V4 temp: 45.9 C
           SMART: yes health: PASSED on: 18d 4h cycles: 2,138 read-units: 17,852,009 [9.14 TB]
           written-units: 15,602,916 [7.98 TB]
Partition: ID-1: / raw size: 454.18 GiB size: 454.18 GiB (100.00%) used: 29.62 GiB (6.5%) fs: btrfs
           block size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
           ID-2: /boot/efi raw size: 300 MiB size: 299.4 MiB (99.80%) used: 107.4 MiB (35.9%) fs: vfat
           block size: 512 B dev: /dev/nvme0n1p1 maj-min: 259:1
           ID-3: /home raw size: 454.18 GiB size: 454.18 GiB (100.00%) used: 29.62 GiB (6.5%)
           fs: btrfs block size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
           ID-4: /var/log raw size: 454.18 GiB size: 454.18 GiB (100.00%) used: 29.62 GiB (6.5%)
           fs: btrfs block size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
           ID-5: /var/tmp raw size: 454.18 GiB size: 454.18 GiB (100.00%) used: 29.62 GiB (6.5%)
           fs: btrfs block size: 4096 B dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:      Kernel: swappiness: 10 (default 60) cache pressure: 75 (default 100)
           ID-1: swap-1 type: partition size: 19.53 GiB used: 0 KiB (0.0%) priority: -2
           dev: /dev/nvme0n1p4 maj-min: 259:3
           ID-2: swap-2 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram0
           ID-3: swap-3 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram1
           ID-4: swap-4 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram2
           ID-5: swap-5 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram3
           ID-6: swap-6 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram4
           ID-7: swap-7 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram5
           ID-8: swap-8 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram6
           ID-9: swap-9 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram7
           ID-10: swap-10 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram8
           ID-11: swap-11 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767 dev: /dev/zram9
           ID-12: swap-12 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767
           dev: /dev/zram10
           ID-13: swap-13 type: zram size: 1.29 GiB used: 0 KiB (0.0%) priority: 32767
           dev: /dev/zram11
Sensors:   System Temperatures: cpu: 66.0 C mobo: N/A
           Fan Speeds (RPM): cpu: 5700
Info:      Processes: 365 Uptime: 2h 22m wakeups: 35 Memory: 15.48 GiB used: 5.4 GiB (34.9%)
           Init: systemd v: 247 Compilers: gcc: 10.2.0 clang: 11.0.0 Packages: pacman: 1732 lib: 531
           Shell: Zsh (sudo) v: 5.8 default: Bash v: 5.1.4 running in: alacritty inxi: 3.2.01

Try reinstalling GRUB

Like this?

Let me guess - you used GRUB Customizer and now your GRUB configuration is broken?

Time to use an older snapshot...

1 Like

Oh, yes. I used grub customizer on my Arch Linux 1 year and I didn't have any problem, so I installed it in Garuda too. A big error. Anyway, my snapshots are newer than when I used customizer, so I'll have to reinstall grub.

2 Likes

When doing that, I get this error. What should I do?

Installing for i386-pc platform.
grub-install: warning: your core.img is unusually large.  It won't fit in the embedding area.
grub-install: error: filesystem `btrfs' doesn't support blocklists.

When installing it on ESP I got that error of the dotfile

/usr/bin/grub-probe: warning: unknown device type nvme0n1.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 238
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

I'm going to try to install it manually with

sudo grub-install --efi-directory=/boot/efi --target=x86_64-efi /dev/nvme0n1

The installation was successful. Now I'm going to run a mkconfig and see what happens. I got the same syntax error. Should I execute

sudo rm -rf /etc/grub.d/*

???

No.
Delete only the ones not owned by grub

bash -c 'for conf in /etc/grub.d/* ; do pacman -Qo $conf ; done'
3 Likes

The dotfile syntax error persists after doing that, reinstalling the bootloader and mkconfing.

What exactly?

1 Like

What you told me to do,

bash -c 'for conf in /etc/grub.d/* ; do pacman -Qo $conf ; done'

Can't you read the terminal? This only shows what package owns each file, so you know what to delete (those not owned by grub).


I am getting older every day. I feel I lose my patience more easily... :frowning_face:

2 Likes

Ah, sorry. I'm going to delete what that command told me. I'm a little stressed these days and I want to do the things as fast as possible, so I not read as minutely as I should the terminal sometimes.

Ugh. After deleting files owned by GRUB, reinstalling and mkconfing I got the error of the dotfile, but in a different line.

/usr/bin/grub-probe: warning: unknown device type nvme0n1.
error: syntax error.
error: Incorrect command.
error: syntax error.
Syntax error at line 120
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

It also happens to me.

@petsam If you think you could help me, find easily where's the problem and do the things faster, I could create you a user with sudo privileges and let you SSH into my computer.

Do you have enough money to pay? :dollar:

Please stop thinking like a loser. These instructions are easy to accomplish.

5 Likes

Seriously - I'll do remote support if I'm paid for it. :joy:

5 Likes

Ugggh... :man_facepalming:

Here we go again.

Can I get someone to do remote house cleaning for me, I hate vacuuming and doing windows, so I'd really like someone to perform these chores for me.Well, let me rephrase that I actually just really hate Windows, so I can't bear to to even touch Windows.

So can someone please do that for me. I'd really appreciate that.

5 Likes

I didn't respond because I had some troubles with my ISP.
One thing is if they're easy (because they are). The Other thing is if they work. If you don't want to help me, just don't do it. I told you what happened after executing the commands you told me. I said you to SSH into my computer for finding something that we could miss, and because I know you are experienced with this. If you don't want to do that, tell me "no". You are supposed to be here for helping the people because you want, not to be profited with that.

I solved the problem by removing manually all the syntax errors on the generated grub.cfg.new and replacing with it the grub.cfg. In the grub.cfg.new appeared a lot of random ^M. Was just a simple :%s/^M//g on vim. If you are reading this, and you have the same issue, remember that the ^M must be entered with ctrl+v ctrl+m, because vim will treat different a manually entered ^M than a ctrl-entered ^M (sounds strange but is true).
Seems like a temporal fix, but at least works.

In the spirit of personal freedom to suggest your own intentions yourself, I would like to express my own perspective and intention on what I am supposed to do.
If you have read any statement throughout the forum rules or Garuda web page, on "what we are supposed to do", please provide a link. I may have been misled.

Free open source software expects users to provide feedback for improvement and respect to the developers.
I am not a Garuda developer, though I help other users with troubles in their Garuda installation, because I want to, but my intention is not to serve. It is an equal relationship between friends.
If you are not my friend, I have no rush or care of helping you. If I do, then you should feel lucky and if you have any morality, you should appreciate.

I haven't told you to run any command. The command I posted was a tip.
If you don't want to learn how to administer and control your linux installation, you are not in my task list. I help people who accept their responsibility of being the System Administrator of their own system.
Go for Windows OS, or other preferred OS, if you don't agree. At least if you would like to request for a technical advice from myself.

Are you a troll? If you know all that, how can't you follow simple instructions?
:exploding_head: :upside_down_face:

2 Likes