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

Chat about Linux in general
Post Reply
Level 1
Level 1
Posts: 1
Joined: Sun Jul 16, 2017 1:57 pm

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

Post by ZiSH » Mon Mar 05, 2018 1:14 pm

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.


2. Do the following on OS other than manjaro.

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

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

Code: Select all

#@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)

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}

    echo not, manjaro only ;exit
Be carefull!! Only tested my own environment. :!:
Last edited by karlchen on Mon Mar 05, 2018 4:06 pm, edited 1 time in total.
Reason: Note: Manjaro is pretty unrelated to Linux Mint. Therefore this thread goes under "Chat on Linux", not "Main Edition" > "Boot & Installation"

Post Reply

Return to “Chat about Linux”