WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Truly silent boot with grub2  (Read 2030 times)

Offline pieric

  • Newbie
  • *
  • Posts: 7
Truly silent boot with grub2
« on: March 11, 2020, 11:20:28 AM »
Hi,

I'm trying to achive a silent boot with (close to) no output until c server has started.
Getting rid of most messages worked by adding kernel commnd to redirect console output to /dev/null.

However some messages remained - see attached image. Not sure if they are grub related...

Anybody who can give me a hint to hide them?

Many thanks in advance!
Eric
BR
Eric

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Truly silent boot with grub2
« Reply #1 on: March 11, 2020, 01:47:35 PM »
I think the first line is from your bootloader, and others from the kernel's early booting code. The "earlycon" bootcode in kernel-parameters.txt looks relevant, but I'm not sure if there's a supported way to disable it. Could be you'd need to edit kernel code to shut that up.
The only barriers that can stop you are the ones you create yourself.

Offline pieric

  • Newbie
  • *
  • Posts: 7
Re: Truly silent boot with grub2
« Reply #2 on: March 12, 2020, 07:47:59 PM »
Indeed, kernel customization was necessary. I found some hints on google.

Here are the steps I did to get a sleek boot (no debug info though):
Code: [Select]
# Download Packages ----------------------------------------------------------------------------
    tce-load -w compiletc perl5 bash ncursesw-dev bc advcomp glibc_apps

# Load Packages --------------------------------------------------------------------------------
    tce-load -i compiletc perl5 bash ncursesw-dev bc advcomp glibc_apps
   
# Go root --------------------------------------------------------------------------------------
    sudo su
   
# Create working dir ---------------------------------------------------------------------------
    mkdir /usr/src ; cd /usr/src

# Get kernel sources ---------------------------------------------------------------------------   
    wget repo.tinycorelinux.net/11.x/x86/release/src/kernel/config-5.4.3-tinycore
    wget repo.tinycorelinux.net/11.x/x86/release/src/kernel/linux-5.4.3-patched.txz
   
# Uncompress source ---------------------------------------------------------------------------
    tar Jxvf linux-5.4.3-patched.txz

# Configure -----------------------------------------------------------------------------------
    cd cd /usr/src/linux-5.4.3
    make mrproper
    cp ../config-5.4.3-tinycore .config
    make oldconfig
    make menuconfig
   
#        -> To remove early boot messages
#           https://www.refining-linux.org/archives/4-Boot-your-Linux-silently.html
#            Remove flags here: 
#                Kernel hacking --->
#                [ ] Enable verbose x86 bootup info messages
#                [ ] Early printk
#        -> Optinally Reduce loglevel for "quiet" argument from "4" to "3"
       
# Compile and copy -----------------------------------------------------------------------------
    make bzImage
    cp /usr/src/linux-5.4.3/arch/x86/boot/bzImage /mnt/sda1/boot/vmlinuz.new

My grub.cfg with "vt.global_cursor_default=0" to get rid of blinking cursor
Code: [Select]
insmod ext2
set default=0
set timeout=0
set timeout_style=hidden
search --no-floppy --fs-uuid --set=root 9f6a5bac-eb18-41bd-8c87-68ad5741d4b5                         
menuentry "tiny" {
    linux /boot/vmlinuz.mod quiet console=/dev/null vt.global_cursor_default=0
    initrd /boot/core.gz
}
BR
Eric