r1k0 / kigen

a decent Python3 Kernel|Initramfs generator for Portage (Gentoo/Funtoo/Sabayon/Exherbo/VidaLinux/Calculate)
1 stars 0 forks source link

kigen on Funtoo breaks at boot-update import modules #16

Closed r1k0 closed 12 years ago

r1k0 commented 12 years ago

I have some trouble to install Kigen on my Funtoo Amd64 Unstable.

I instal python 3.2 (run python-updater and rebuild packages depending on python)

but I get this error /usr/sbin/kigen i --splash=emergence --source-disklabel --source-luks --bin-lvm2 --source-dropbear --debugflag --rootpasswd=* --keymaps=all --source-ttyecho --source-strace --source-screen --bin-glibc --bin-zlib --bin-libncurses --defconfig Traceback (most recent call last): File "/usr/sbin/kigen", line 100, in bootupdateinitrd = get_boot_initrd() File "/usr/lib/python3.2/site-packages/kigen/modules/initramfs/bootupdate.py", line 24, in get_boot_initrd if funtoo.boot.config.BootConfigFile('/etc/boot.conf').fileExists(): NameError: global name 'funtoo' is not defined

(using git version or ebuld version)

./kigen i --splash=emergence --source-disklabel --source-luks --bin-lvm2 --source-dropbear --debugflag --rootpasswd=* --keymaps=all --source-ttyecho --source-strace --source-screen --bin-glibc --bin-zlib --bin-libncurses --defconfig Traceback (most recent call last): File "./kigen", line 100, in bootupdateinitrd = get_boot_initrd() File "/home/loulou/kigen/modules/initramfs/bootupdate.py", line 24, in get_boot_initrd if funtoo.boot.config.BootConfigFile('/etc/boot.conf').fileExists(): NameError: global name 'funtoo' is not defined

r1k0 commented 12 years ago

Right after line19 in boot-update-1.5.2.ebuild add a line to install boot-update modules for python3: insinto /usr/lib/eselect python show --python2/site-packages +insinto /usr/lib/eselect python show --python3/site-packages cd ${S}/python/modules

then funtoo ~ # ebuild /usr/portage/sys-boot/boot-update/boot-update-1.5.4.ebuild digest funtoo ~ # emerge boot-update

Then, when you'll rerun kigen, you will encounter errors from boot-update about "invalid syntax" in raise. I suppose that if boot-update was updated to run under python3, kigen funtoo feature would work again (basically it uses boot-update API to read your /etc/boot.conf and merge the list of modules with the one you've configured in /etc/kigen/initramfs/modules.conf, no big deal if it has to wait for a python3 migration) Furthermore: funtoo ~ # head /sbin/boot-update -n1

!/usr/bin/python2

funtoo ~ #

Now, I won't let you down ;) so I've patched kigen so that it can get around this until drobbins has the time and will to make his great boot-update tool compatible with python 3. Normally when boot-update is updated to python3, kigen will see the boot-update API and will automatically add modules from /etc/boot.conf, until then it will not read your /etc/boot.conf. You could kindly ask if there is any plan to migrate boot-update to python3 :)

r1k0 commented 12 years ago

fixed