Rudd-O / zfs-fedora-installer

Fedora on ZFS root installer
35 stars 6 forks source link

Does not work in fedora 26 #23

Closed fire closed 6 years ago

fire commented 6 years ago

Log:

$ sudo ./install-fedora-on-zfs zfs-root.img
   DEBUG:         shell:        check_output@  34   Check outputting rpm -q fedora-release '--queryformat=%{version}' in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  38   First line of output from command: 26
   DEBUG:         shell:        check_output@  34   Check outputting losetup -j zfs-root.img in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  40   No output from command
   DEBUG:         shell:          check_call@  27   Check calling losetup -P --find --show zfs-root.img in cwd '/home/fedora/Documents/zfs-fedora-installer'
/dev/loop2
   DEBUG:         shell:        check_output@  34   Check outputting losetup -j zfs-root.img in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  38   First line of output from command: /dev/loop2: [64770]:8917868 (/home/fedora/Documents/zfs-fedora-installer/zfs-root.img)
   DEBUG:         shell:               Popen@ 115   Popening fdisk /dev/loop2 in cwd '/home/fedora/Documents/zfs-fedora-installer'

Welcome to fdisk (util-linux 2.30.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xe8d3c6fd.

Command (m for help): Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (1-4, default 1): First sector (2048-14335999, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-14335999, default 14335999): 
Created a new partition 1 of type 'Linux' and of size 256 MiB.

Command (m for help): 

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (526336-14335999, default 526336): Last sector, +sectors or +size{K,M,G,T,P} (526336-14335999, default 14335999): 
Created a new partition 2 of type 'Linux' and of size 6.6 GiB.

Command (m for help): Disk /dev/loop2: 6.9 GiB, 7340032000 bytes, 14336000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe8d3c6fd

Device       Boot  Start      End  Sectors  Size Id Type
/dev/loop2p1        2048   526335   524288  256M 83 Linux
/dev/loop2p2      526336 14303231 13776896  6.6G 83 Linux

Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

   DEBUG:         shell:        check_output@  34   Check outputting blkid -c /dev/null /dev/loop2p1 in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  38   First line of output from command: /dev/loop2p1: PARTUUID="e8d3c6fd-01"
   DEBUG:         shell:          check_call@  27   Check calling mkfs.ext4 -L boot_tank /dev/loop2p1 in cwd '/home/fedora/Documents/zfs-fedora-installer'
mke2fs 1.43.4 (31-Jan-2017)
Discarding device blocks: done                            
Creating filesystem with 262144 1k blocks and 65536 inodes
Filesystem UUID: daaf4b71-d4fa-41cd-bf11-e24758163f6f
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729, 204801, 221185

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done 

   DEBUG:         shell:        check_output@  34   Check outputting blkid -c /dev/null /dev/loop2p1 -o value -s UUID in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  38   First line of output from command: daaf4b71-d4fa-41cd-bf11-e24758163f6f
   DEBUG:         shell:          check_call@  27   Check calling zfs list -H -o name tank in cwd '/home/fedora/Documents/zfs-fedora-installer'
cannot open 'tank': dataset does not exist
   DEBUG:         shell:          check_call@  27   Check calling zpool import -f -R /var/lib/zfs-fedora-installer/tank tank in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling zfs list -H -o name tank/ROOT in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling zfs list -H -o name tank/ROOT/os in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling zfs list -H -o name tank/swap in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  34   Check outputting blkid -c /dev/null /dev/zvol/tank/swap in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  38   First line of output from command: /dev/zvol/tank/swap: UUID="f4cf2351-eaf6-4ff4-aa48-b4d29e71778f" TYPE="swap"
   DEBUG:         shell:          check_call@  27   Check calling mount -- /dev/loop2p1 /var/lib/zfs-fedora-installer/tank/boot in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling mount -t sysfs -- sysfs /var/lib/zfs-fedora-installer/tank/sys in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling mount -t selinuxfs -- selinuxfs /var/lib/zfs-fedora-installer/tank/sys/fs/selinux in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling mount -t proc -- proc /var/lib/zfs-fedora-installer/tank/proc in cwd '/home/fedora/Documents/zfs-fedora-installer'
   ERROR:          root:      install_fedora@ 906   Unexpected error
Traceback (most recent call last):
  File "./src/installfedoraonzfs/__init__.py", line 568, in install_fedora
    with setup_filesystems(rootpart, bootpart, lukspassword, luksoptions) as (rootmountpoint, p, q, in_chroot, rootuuid, luksuuid, bootpartuuid):
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "./src/installfedoraonzfs/__init__.py", line 560, in setup_filesystems
    yield rootmountpoint, p, q, in_chroot, rootuuid, luksuuid, bootpartuuid
UnboundLocalError: local variable 'rootuuid' referenced before assignment
Cleaning up now
   DEBUG:         shell:          check_call@  27   Check calling umount /var/lib/zfs-fedora-installer/tank/proc in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling umount /var/lib/zfs-fedora-installer/tank/sys/fs/selinux in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling umount /var/lib/zfs-fedora-installer/tank/sys in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling umount /var/lib/zfs-fedora-installer/tank/boot in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling umount /var/lib/zfs-fedora-installer/tank in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling sync in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling zpool export tank in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:          check_call@  27   Check calling sync in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  34   Check outputting losetup -j /dev/loop2 in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  40   No output from command
   DEBUG:         shell:        check_output@  34   Check outputting losetup -j /dev/loop2 in cwd '/home/fedora/Documents/zfs-fedora-installer'
   DEBUG:         shell:        check_output@  40   No output from command
Traceback (most recent call last):
  File "./install-fedora-on-zfs", line 10, in <module>
    sys.exit(installfedoraonzfs.install_fedora_on_zfs())
  File "./src/installfedoraonzfs/__init__.py", line 988, in install_fedora_on_zfs
    workdir=args.workdir,
  File "./src/installfedoraonzfs/__init__.py", line 568, in install_fedora
    with setup_filesystems(rootpart, bootpart, lukspassword, luksoptions) as (rootmountpoint, p, q, in_chroot, rootuuid, luksuuid, bootpartuuid):
  File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "./src/installfedoraonzfs/__init__.py", line 560, in setup_filesystems
    yield rootmountpoint, p, q, in_chroot, rootuuid, luksuuid, bootpartuuid
UnboundLocalError: local variable 'rootuuid' referenced before assignment
fire commented 6 years ago

adding

    def setup_filesystems(rootpart, bootpart, lukspassword, luksoptions):
        rootuuid = ""
        luksuuid = ""
        global rootuuid, luksuuid

bypassed the errors

Rudd-O commented 6 years ago

Bug confirmed. Working on fix, which should already be in staging branch.

Rudd-O commented 6 years ago

Fixed.