No-Trip :: Manjaro kernel panic and grub's custom file

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
ZiSH
Level 1
Level 1
Posts: 8
Joined: Sun Jul 16, 2017 1:57 pm
Contact:

No-Trip :: Manjaro kernel panic and grub's custom file

Post by ZiSH »

The stagnant cane. It would be nice if someone helped. Also, it is more pleasant if there is a more easy way.

1. Execute the following script on manjaro.

The following file is created in the current directory.

40_custom.4.14.23-1-MANJARO

2. Do the following on OS other than manjaro.

Make the 40_custom.4.14.23-1-MANJARO as before
Then copy.

/etc/grub.d/
rename. The name is 40_custom.

sudo update-grub

bootable New Entry name. "My Manjaro" . Script add "My".
Perhaps a new entry 'My Manjaro' will be added on the bottom line.
The original manjaro entry is not activated. do not touch.

3. It is desirable to perform the same work every time the kernel is updated on manjaro.

Generation script ::manjaro_entry.sh

Code: Select all

#!/bin/bash
#@manjaro boot entry generating tool ; New 40_custom for ANOTHER Linux grub
#
# Zish@japan,K Nishihama
#
#
#TIMESTAMP=`date +%m/%d_%H:%M`
sudo cat /boot/grub/grub.cfg > /tmp/grub.cfg.txt
MANJARO_KERNEL=$(grep -Po '(?<=\(Kernel: )\d.*?\d-MANJARO(?= x64\))' /tmp/grub.cfg.txt | head -1)
#entry_40_custom=40_custom.$TIMESTAMP
entry_40_custom=40_custom.$MANJARO_KERNEL

echo "generating tool ; New 40_custom for ANOTHER Linux grub"
if uname -a | grep -P 'Linux manjaro \d.*?-MANJARO' > /dev/null ; then
    echo yes, using manjaro #;exit
    cat /etc/grub.d/40_custom > ${entry_40_custom}

#Linux manjaro 4.14.21-1-MANJARO #1 SMP PREEMPT Fri Feb 23 00:01:40 UTC 2018 x86_64 GNU/Linux
sudo cat /boot/grub/grub.cfg |\
        perl -ne 'if ( / BEGIN \/etc\/grub\.d\/10_linux/ .. / END \/etc\/grub\.d\/10_linux / ){s/Manjaro Linux/My Manjaro Linux ♡ /;s/(Advanced options for My Manjaro Linux)/New ♡ $1/ ;   print;  }' |\
        perl -pe 's/BEGIN/MyBegin/;s/END/MyEnd/' |\
        # tee -a /etc/grub.d/40_custom
        tee  -a ${entry_40_custom}
echo "copy entry_40_custom.$MANJARO_KERNEL to ANOTHER Linux \
  /etc/grub.d/40_custom (eg.ubuntu,mint,antergos etc.)"
echo "do not copy entry_40_custom.$MANJARO_KERNEL /etc/grub.d/ on THIS Manjaro Linux environment."
echo "Be carefull!!  Only tested my own environment."
ls -l ${entry_40_custom}


else
    echo not, manjaro only ;exit
fi
exit
Be carefull!! Only tested my own environment. :!:
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Chat about Linux”