You are not logged in.

#1 2023-12-02 10:02:35

linuxkonsult
Member
Registered: 2023-12-02
Posts: 1

[SOLVED] Disable the install medium boot chime

How to create a boot medium without the boot chime
$ sudo pacman -S archiso                                       # install archiso to build a new iso
$ cp -r /usr/share/archiso/configs/releng/ archlive            # copy a profile to current folder
$ grep ^play archlive/grub/grub.cfg                            # look for the line causing the chime
play 600 988 1 1319 4
$ sed 's/^play 600/# play 600/' -i archlive/grub/grub.cfg      # comment out the play directive
$ sudo mkarchiso -m iso -o arch_linux_usb_nochime ./archlive/  # build the new iso image
$ export BOOT_USB_STICK=/dev/null                              # ensure this points to your boot medium
$ sudo dd bs=4M if=./arch_linux_usb_nochime/archlinux-$(date +%Y.%m.%d)-x86_64.iso of=${BOOT_USB_STICK} conv=fsync oflag=direct status=progress
archlinux-$(date +%Y.%m.%d)-x86_64.iso                         # write medium


TLDR:
On one of my laptops, the chime played by grub gives a very loud noise, at least on my laptop.
It is actually so loud that I cannot use it without waking up family members upstairs, and I need to cover my ears before booting the medium so for me this is a real problem and causing me to avoid booting from the usb stick and choose another OS medium a couple of times.

Searching for the solution I ended up on this page, with a solution that does not seem to work with a newer dd, so hopefully this can hit the search engines instead.
https://bbs.archlinux.org/viewtopic.php?id=278609

That would be a quick and easy solution, but I ended up solving it by building a new iso because ot this issue:

 # echo '#' | dd of=/tmp/foo.iso skip=810552222 bs=1 count=1 conv=notrunc oflag=count_bytes
dd: 'standard input': cannot skip to specified offset
0+0 records in
0+0 records out
0 bytes copied, 6.1686e-05 s, 0.0 kB/s 

Offline

#2 2023-12-02 11:45:07

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 626

Re: [SOLVED] Disable the install medium boot chime

Here's a solution that doesn't require building the ISO from scratch:

$ osirrox -indev archlinux-2023.12.01-x86_64.iso -cpx /boot/grub/grub.cfg ./
$ chmod +w grub.cfg
$ sed '/^play.*/d' -i grub.cfg
$ xorriso -indev archlinux-2023.12.01-x86_64.iso -outdev archlinux-2023.12.01-x86_64-silent.iso -boot_image any replay -map grub.cfg /boot/grub/grub.cfg

Offline

#3 2023-12-03 07:56:56

scdbackup
Member
Registered: 2013-05-30
Posts: 73

Re: [SOLVED] Disable the install medium boot chime

Hi,

The Evil Wiki Admin wrote:

$ xorriso -indev archlinux-2023.12.01-x86_64.iso -outdev archlinux-2023.12.01-x86_64-silent.iso -boot_image any replay -map grub.cfg /boot/grub/grub.cfg

Thank you for flying xorriso.

In the general use case it would be better to do "-boot_image any replay"
after any image manipulations like "-map". Just to make sure that the
xorriso commands executed by "replay" do not refer to a file which
afterwards gets changed by the manipulation.
(In the present case it is harmless, because grub.cfg is not such a file.)

linuxkonsult wrote:

# echo '#' | dd of=/tmp/foo.iso skip=810552222 bs=1 count=1 conv=notrunc oflag=count_bytes
dd: 'standard input': cannot skip to specified offset

Write addressing in dd is done by option "seek=", not by "skip=".
The script on https://bbs.archlinux.org/viewtopic.php?id=278609 has
two read runs with "skip" surrounding one write run with "seek".

The main disadvantage of that method is that grepping for "play 600" is
not restricted to the content of grub.cfg. If any other data file contains
this text and is located before grub.cfg, then you'd patch the wrong file.

If direct patching of the existing ISO is the goal, one may ask xorriso
for the storage address of the file's content and extract it to the
current working directory:

$ xorriso -indev archlinux-2023.12.01-x86_64.iso -find /boot/grub/grub.cfg -exec report_lba -- -osirrox on -extract /boot/grub/grub.cfg grub.cfg
...
Report layout: xt , Startlba ,   Blocks , Filesize , ISO image path
File data lba:  0 ,   430498 ,        2 ,     3614 , '/boot/grub/grub.cfg'
Copying of file objects from ISO image to disk filesystem is: Enabled
xorriso : UPDATE :       1 files restored (  3614b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/boot/grub/grub.cfg'='/daten/dvdbuffer/grub.cfg'

Now let grep operate on the extracted file:

$ grep -a -b -o "play 600" grub.cfg
3592:play 600

The address number for dd "seek=" is then 430498 * 2048 + 3592 = 881663496.
In our lucky case of "play 600" being unique in the whole ISO this is
confirmed by:

$ grep -a -b -o "play 600" archlinux-2023.12.01-x86_64.iso
881663496:play 600

Have a nice day smile

Thomas

Offline

Board footer

Powered by FluxBB