The officially official Devuan Forum!

You are not logged in.

#1 2020-08-31 13:02:45

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

(solved) grub custom menu for other distro using F2FS filesystem.

Not real sure how to do this, i want to create custom boot menu for another linux (artix linux) that will be installed alongside devuan.
Current setup is.

Devuan boot parttion = /dev/sda1
Devuan root partition = /dev/sda2
Artix  on /dev/sda3

This is because i may have stuffed up installing artix or something is missing im not getting.

When i installed artix i only mounted sda3 to /mnt and not the devuan sda1 partition for the boot loader. My thinking was grub and os-prober would pick up /dev/sda3 as artix inside devuan when i update-grub there but this is not the case as update-grub just finds unknown linux distro and it dont boot.

So my thinking is maybe i could create boot menu like so below but even this does not seem to work.

In /etc/grub.d/40_custom

menuentry "Artix" {
	set root=(hd0,3)
	 linux /boot/vmlinuz-linux-lts
	 initrd /boot/initramfs-linux-lts.img
}

This might all be stupid and ive stuffed up and should have mounted /dev/sda1 as /mnt/boot when pacstrap the install to begin with?

Last edited by HevyDevy (2020-09-02 11:55:24)

Offline

#2 2020-08-31 13:38:32

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: (solved) grub custom menu for other distro using F2FS filesystem.

HevyDevy wrote:

when i update-grub there but this is not the case as update-grub just finds unknown linux distro and it dont boot

Devuan's GRUB can't deal with the multiple initramfs images that are created in Arch-based distribustions if the CPU µcode package is installed.

If you post the actual /boot/grub/grub.cfg file then we could confirm if this is the problem here.

HevyDevy wrote:

In /etc/grub.d/40_custom

menuentry "Artix" {
	set root=(hd0,3)
	 linux /boot/vmlinuz-linux-lts
	 initrd /boot/initramfs-linux-lts.img
}

You need to pass the location of the root partition to the kernel and it's best to identify it with a UUID because the block device assignment might change from one boot to the next.

Try something like this (replace $uuid with the actual UUID for the Artix root partition):

menuentry 'Artix' {
   search --fs-uuid --set=root $uuid
   linux /boot/vmlinuz-linux-lts root=UUID=$uuid rw quiet # add any other boot parameters here
   initrd /boot/intel-ucode.img /boot/initramfs-linux-lts.img
}

^ That presumes the intel-ucode package is installed, check /boot in Artix for the actual initramfs images and adjust as required.


Brianna Ghey — Rest In Power

Offline

#3 2020-09-01 02:09:25

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: (solved) grub custom menu for other distro using F2FS filesystem.

No luck, i think its the f2fs filesystem im trying to use is not compatible with devuan/debians grub.

I can install artix grub from a chroot on the artix partition and update grub there and boot into artix fine, but if i try the custom menu entry it just says filesytem not found so im pretty sure its a grub devuan issue.

Offline

#4 2020-09-01 07:47:18

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: (solved) grub custom menu for other distro using F2FS filesystem.

After doing some digging, looks like i may be right. grub2 version 2.04 brings support for f2fs but that is currently in testing.
I wonder if there is a workaround? I tried copying to the custom grub menu the entry that artix linux creates and it complains of not having /boot/grub/i386-pc/f2fs.mod loaded (and yes i do have f2fs-tools installed in devuan and artix), so i wonder if i could just move that module there into stable grub, probably break something though.

https://bugs.launchpad.net/ubuntu/+sour … ug/1868664

https://salsa.debian.org/grub-team/grub … 31d165782b

https://packages.debian.org/search?keywords=grub2

This is the custom grub menu in /etc/grub.d/40_custom  im using.

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Artix Linux' --class artix --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-<UUID>' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod f2fs
        set root='hd0,msdos3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,msdos3' --hint-bios=hd0,msdos3 --hin
t-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  <UUID>
        else
          search --no-floppy --fs-uuid --set=root <UUID>
        fi
        echo    'Loading Linux linux-lts ...'
        linux   /boot/vmlinuz-linux-lts root=UUID=<UUID> rw  loglevel=3 quiet
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initramfs-linux-lts.img
}

Last edited by HevyDevy (2020-09-01 07:48:30)

Offline

#5 2020-09-01 15:50:19

Vernon
Member
Registered: 2020-07-19
Posts: 89  

Re: (solved) grub custom menu for other distro using F2FS filesystem.

HevyDevy wrote:

After doing some digging, looks like i may be right. grub2 version 2.04 brings support for f2fs but that is currently in testing.

Off topic but I once tried f2fs on a micro-SD card mounted on one of my OpenWRT devices  Found it extremely slow, CPU intensive and therefore unusable. Switched back to ext4. Have been running both RaspberryPis and micro-routers out of ext4 formatted SD/micro-SD cards for years without any issues. Note that most smart phones have a lot more horse power than my micro router with a MIPS 260Mhz 32 bit CPU and 32Mb of RAM.

Last edited by Vernon (2020-09-01 16:14:42)

Offline

#6 2020-09-01 17:11:42

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: (solved) grub custom menu for other distro using F2FS filesystem.

No, the GRUB version in beowulf doesn't support f2fs.

HevyDevy wrote:

I wonder if there is a workaround? I tried copying to the custom grub menu the entry that artix linux creates and it complains of not having /boot/grub/i386-pc/f2fs.mod loaded (and yes i do have f2fs-tools installed in devuan and artix), so i wonder if i could just move that module there into stable grub

I was thinking about suggesting that but a better solution is probably to just install GRUB in Artix instead of Devuan. The only problem with that is having to manually update the configuration every time the kernel version in Devuan changes.

Another alternative is to install Artix's GRUB version in Devuan by running these commands from Artix:

# mount /dev/sda1 /mnt
# pacman -S grub
# grub-install --target=i386-pc --boot-directory=/mnt /dev/sda

Then remove the grub-pc package in Devuan but keep the grub2-common package installed so that the configuration file is updated every time the kernel version changes:

# apt install grub-pc- grub2-common

And yet another alternative is to backport the grub-pc, grub-common & grub2-common packages from ceres.

I presume this is a non-UEFI system?

Last edited by Head_on_a_Stick (2020-09-01 17:28:25)


Brianna Ghey — Rest In Power

Offline

#7 2020-09-02 11:53:50

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: (solved) grub custom menu for other distro using F2FS filesystem.

Yeah i could have artix take over boot management but too many missions and i want to have devuan be the main stable os and not introduce anything from unstable. I was basically wanting to see how well f2fs would run on a partition using artix, ive since deleted the artix partition, so  problem solved wink. Thanks for your input.

Last edited by HevyDevy (2020-09-02 11:57:09)

Offline

Board footer