johnramsden / zedenv-grub

zedenv plugin for GRUB
https://zedenv.readthedocs.io/en/latest/plugins.html#grub
BSD 3-Clause "New" or "Revised" License
11 stars 4 forks source link

zedenv-grub not working #9

Closed danboid closed 6 years ago

danboid commented 6 years ago

zedenv-grub isn't working yet for me. I am using the release versions of pyzfscmds and zedenv with the grub-generators branch of zedenv-grub under a ALEZ 0.4 VM. In addition to setting grub as the default plugin, I also had to run:

zedenv set org.zedenv.grub:bootonzfs=yes

Before I could activate any BEs

The problem seems to be that activating BEs updates the GRUB menu and when you reboot zedenv list says that the chosen BE is active but its not. Also, choosing an older BE from the GRUB menu without activating it first also just boots the latest BE, or thats what seems to be happening.

Here's what I did to test:

At this stage, if I activate the first BE with zedenv and reboot or if I boot into the first BE via GRUB, X is still installed ie both BEs give me the state of the second BE.

I hope I've got that right as I really need to get some sleep now and I shouldn't really be writing bug reports :D

johnramsden commented 6 years ago

I seem to be getting different behavior.

Make sure:

# zedenv set org.zedenv:bootloader=grub
# zedenv set org.zedenv.grub:bootonzfs=yes

Then:

# zedenv create -v first

# zedenv list
Name     Active   Mountpoint   Creation
default  NR       /            Sun-Oct-14-1:49-2018
first             -            Sun-Oct-14-6:41-2018

# zedenv activate first

# zedenv list
Name     Active   Mountpoint   Creation
default  N        /            Sun-Oct-14-1:49-2018
first    R        -            Sun-Oct-14-6:41-2018
cat default | wc -l
198

Should now see in /boot/grub/grub.cfg:

### BEGIN /etc/grub.d/05_zfs_linux.py ###                                   
menuentry 'Arch GNU/Linux BE [first]' --class arch --class gnu-linux --class
 gnu --class os $menuentry_id_option 'gnulinux-simple-zroot/ROOT/first' {   
        load_video                                                          
        set gfxpayload=keep                                                 
        insmod gzio                                                         
        insmod zfs                                                          
        set root='hd0,gpt2'                                                 
        if [ x$feature_platform_search_hint = xy ]; then                    
          search --no-floppy --fs-uuid --set=root 9df246260f6dbc7b --hint-ie
ee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hi
nt-baremetal=ahci0,gpt2                                                     
        else                                                                
          search --no-floppy --fs-uuid --set=root 9df246260f6dbc7b          
        fi                                          
        echo 'Loading Linux linux ...'                                              linux /ROOT/first@/boot/vmlinuz-linux root=ZFS=zroot/ROOT/first rw  quiet                                                                       
        echo 'Loading initial ramdisk ...'                                  
        initrd /ROOT/first@/boot/initramfs-linux.img                        
}

Reboot, should see:

# zedenv list
Name     Active   Mountpoint   Creation
default           -            Sun-Oct-14-1:49-2018 
first    NR       /            Sun-Oct-14-6:55-2018

Install xorg all packages.

pacman -S xorg
pacman -Q > first
cat first | wc -l
313
# zedenv activate default

# zedenv list            
Name     Active   Mountpoint   Creation             
default  R        -            Sun-Oct-14-1:49-2018 
first    N        /            Sun-Oct-14-6:55-2018

Reboot

# zedenv list            
Name     Active   Mountpoint   Creation             
default  NR       /            Sun-Oct-14-1:49-2018 
first             -            Sun-Oct-14-6:55-2018
pacman -Q |wc -l
198

pacman -Q | grep xorg | wc -l
0
danboid commented 6 years ago

I've had another go this morning and zedenv does seem to be working as expected. I've tried creating, activating and destroying BE's and everything looks fine. Great news!

I knew I was too tired to be writing a bug report last night so sorry about the noise.