Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common.sh missing when build configured with --with-config=kernel #10450

Closed
lampmerchant opened this issue Jun 12, 2020 · 2 comments
Closed

common.sh missing when build configured with --with-config=kernel #10450

lampmerchant opened this issue Jun 12, 2020 · 2 comments
Labels
Type: Building Indicates an issue related to building binaries

Comments

@lampmerchant
Copy link

lampmerchant commented Jun 12, 2020

System information

Type Version/Name
Distribution Name Void Linux
Distribution Version n/a (rolling release)
Linux Kernel building with 5.4.46, running on 5.4.39
Architecture x86-64
ZFS Version 0.8.4
SPL Version n/a

Describe the problem you're observing

Background: I'm trying to build a kernel to be used in a coreboot image, with ZFS built in; am performing all actions as a non-privileged user, as this process should not be modifying the host system.

After running configure with --with-config=kernel out of a freshly extracted 0.8.4 tarball, make fails, complaining of "Missing helper script common.sh". If I remove --with-config=kernel, while make succeeds, make install fails because it wants to put files into /etc/default/zfs and it can't because it isn't running as root. However, if I first configure/build without --use-config=kernel and then configure/build again with it, THEN make install succeeds without error.

Describe how to reproduce the problem

Case 1

Kernel version 5.4.46 tarball freshly extracted into /home/kernelshop/linux-5.4.46, ZFS version 0.8.4 tarball freshly extracted into /home/kernelshop/zfs-0.8.4

~/linux-5.4.46 $ make defconfig prepare
~/linux-5.4.46 $ cd ~/zfs-0.8.4
~/zfs-0.8.4 $ sh autogen.sh
~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout --without-udevdir --disable-sysvinit --disable-systemd --with-config=kernel
~/zfs-0.8.4 $ make

make will fail, complaining of common.sh being missing (log below).

Case 2

Kernel version 5.4.46 tarball freshly extracted into /home/kernelshop/linux-5.4.46, ZFS version 0.8.4 tarball freshly extracted into /home/kernelshop/zfs-0.8.4

~/linux-5.4.46 $ make defconfig prepare
~/linux-5.4.46 $ cd ~/zfs-0.8.4
~/zfs-0.8.4 $ sh autogen.sh
~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout --without-udevdir --disable-sysvinit --disable-systemd
~/zfs-0.8.4 $ make
~/zfs-0.8.4 $ make install

make install will fail, complaining that it cannot, as a non-root user, remove /etc/default/zfs (log below).

Case 3

Kernel version 5.4.46 tarball freshly extracted into /home/kernelshop/linux-5.4.46, ZFS version 0.8.4 tarball freshly extracted into /home/kernelshop/zfs-0.8.4

~/linux-5.4.46 $ make defconfig prepare
~/linux-5.4.46 $ cd ~/zfs-0.8.4
~/zfs-0.8.4 $ sh autogen.sh
~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout --without-udevdir --disable-sysvinit --disable-systemd
~/zfs-0.8.4 $ make
~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout --without-udevdir --disable-sysvinit --disable-systemd --with-config=kernel
~/zfs-0.8.4 $ make
~/zfs-0.8.4 $ make install

make install will succeed here.

Include any warning/errors/backtraces from the system logs

Case 1

./scripts/make_gitrev.sh
make: [Makefile:1552: gitrev] Error 128 (ignored)
make  all-recursive
make[1]: Entering directory '/home/kernelshop/zfs-0.8.4-7'
Making all in include
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include'
Making all in linux
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/linux'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/linux'
Making all in spl
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/spl'
Making all in rpc
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/spl/rpc'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/spl/rpc'
Making all in sys
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/spl/sys'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/spl/sys'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/spl'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/spl'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/spl'
Making all in sys
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys'
Making all in fm
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fm'
Making all in fs
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fm/fs'
make[5]: Nothing to be done for 'all'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fm/fs'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fm'
make[5]: Nothing to be done for 'all-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fm'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fm'
Making all in fs
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fs'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/fs'
Making all in crypto
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/crypto'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/crypto'
Making all in lua
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/lua'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/lua'
Making all in sysevent
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys/sysevent'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys/sysevent'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include/sys'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include/sys'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/include'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/include'
Making all in rpm
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-7/rpm'
Making all in generic
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/rpm/generic'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/rpm/generic'
Making all in redhat
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/rpm/redhat'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/rpm/redhat'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-7/rpm'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/rpm'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-7/rpm'
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-7'
[ -x ./scripts/zfs-tests.sh ] && \
    ./scripts/zfs-tests.sh -c
Missing helper script common.sh
make[2]: [Makefile:1568: all-local] Error 1 (ignored)
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-7'
make[1]: Leaving directory '/home/kernelshop/zfs-0.8.4-7'

Case 2

$ make install
./scripts/make_gitrev.sh
make: [Makefile:1552: gitrev] Error 128 (ignored)
make  install-recursive
make[1]: Entering directory '/home/kernelshop/zfs-0.8.4-9'
Making install in include
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include'
Making install in linux
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/linux'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/linux'
make[4]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/linux'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/linux'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/linux'
Making install in spl
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl'
Making install in rpc
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl/rpc'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl/rpc'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl/rpc'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl/rpc'
Making install in sys
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl/sys'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl/sys'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl/sys'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl/sys'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/spl'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Nothing to be done for 'install-data-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/spl'
Making install in sys
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys'
Making install in fm
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm'
Making install in fs
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm/fs'
make[6]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm/fs'
make[6]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys/fm/fs'
 /bin/install -c -m 644 ../../../../include/sys/fm/fs/zfs.h '/home/kernelshop/zout/include/libzfs/sys/fm/fs'
make[6]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm/fs'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm/fs'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm'
make[6]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm'
make[6]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys/fm'
 /bin/install -c -m 644 ../../../include/sys/fm/protocol.h ../../../include/sys/fm/util.h '/home/kernelshop/zout/include/libzfs/sys/fm'
make[6]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fm'
Making install in fs
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fs'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fs'
make[5]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys/fs'
 /bin/install -c -m 644 ../../../include/sys/fs/zfs.h '/home/kernelshop/zout/include/libzfs/sys/fs'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fs'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/fs'
Making install in crypto
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/crypto'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/crypto'
make[5]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys/crypto'
 /bin/install -c -m 644 ../../../include/sys/crypto/api.h ../../../include/sys/crypto/common.h ../../../include/sys/crypto/icp.h '/home/kernelshop/zout/include/libzfs/sys/crypto'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/crypto'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/crypto'
Making install in lua
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/lua'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/lua'
make[5]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys/lua'
 /bin/install -c -m 644 ../../../include/sys/lua/lua.h ../../../include/sys/lua/luaconf.h ../../../include/sys/lua/lualib.h ../../../include/sys/lua/lauxlib.h '/home/kernelshop/zout/include/libzfs/sys/lua'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/lua'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/lua'
Making install in sysevent
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/sysevent'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys/sysevent'
make[5]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys/sysevent'
 /bin/install -c -m 644 ../../../include/sys/sysevent/eventdefs.h ../../../include/sys/sysevent/dev.h '/home/kernelshop/zout/include/libzfs/sys/sysevent'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/sysevent'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys/sysevent'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include/sys'
make[5]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs/sys'
 /bin/install -c -m 644 ../../include/sys/abd.h ../../include/sys/aggsum.h ../../include/sys/arc.h ../../include/sys/arc_impl.h ../../include/sys/avl.h ../../include/sys/avl_impl.h ../../include/sys/blkptr.h ../../include/sys/bplist.h ../../include/sys/bpobj.h ../../include/sys/bptree.h ../../include/sys/bqueue.h ../../include/sys/cityhash.h ../../include/sys/spa_checkpoint.h ../../include/sys/dataset_kstats.h ../../include/sys/dbuf.h ../../include/sys/ddt.h ../../include/sys/dmu.h ../../include/sys/dmu_impl.h ../../include/sys/dmu_objset.h ../../include/sys/dmu_recv.h ../../include/sys/dmu_send.h ../../include/sys/dmu_traverse.h ../../include/sys/dmu_tx.h ../../include/sys/dmu_zfetch.h ../../include/sys/dnode.h ../../include/sys/dsl_bookmark.h ../../include/sys/dsl_dataset.h ../../include/sys/dsl_deadlist.h ../../include/sys/dsl_deleg.h ../../include/sys/dsl_destroy.h ../../include/sys/dsl_dir.h ../../include/sys/dsl_crypt.h ../../include/sys/dsl_pool.h ../../include/sys/dsl_prop.h ../../include/sys/dsl_scan.h ../../include/sys/dsl_synctask.h ../../include/sys/dsl_userhold.h ../../include/sys/edonr.h ../../include/sys/efi_partition.h ../../include/sys/frame.h '/home/kernelshop/zout/include/libzfs/sys'
 /bin/install -c -m 644 ../../include/sys/hkdf.h ../../include/sys/metaslab.h ../../include/sys/metaslab_impl.h ../../include/sys/mmp.h ../../include/sys/mntent.h ../../include/sys/multilist.h ../../include/sys/note.h ../../include/sys/nvpair.h ../../include/sys/nvpair_impl.h ../../include/sys/pathname.h ../../include/sys/policy.h ../../include/sys/range_tree.h ../../include/sys/refcount.h ../../include/sys/rrwlock.h ../../include/sys/sa.h ../../include/sys/sa_impl.h ../../include/sys/sdt.h ../../include/sys/sha2.h ../../include/sys/skein.h ../../include/sys/spa_boot.h ../../include/sys/space_map.h ../../include/sys/space_reftree.h ../../include/sys/spa.h ../../include/sys/spa_impl.h ../../include/sys/spa_checksum.h ../../include/sys/sysevent.h ../../include/sys/trace.h ../../include/sys/trace_acl.h ../../include/sys/trace_arc.h ../../include/sys/trace_common.h ../../include/sys/trace_dbgmsg.h ../../include/sys/trace_dbuf.h ../../include/sys/trace_dmu.h ../../include/sys/trace_dnode.h ../../include/sys/trace_multilist.h ../../include/sys/trace_txg.h ../../include/sys/trace_vdev.h ../../include/sys/trace_zil.h ../../include/sys/trace_zio.h ../../include/sys/trace_zrlock.h '/home/kernelshop/zout/include/libzfs/sys'
 /bin/install -c -m 644 ../../include/sys/txg.h ../../include/sys/txg_impl.h ../../include/sys/u8_textprep_data.h ../../include/sys/u8_textprep.h ../../include/sys/uberblock.h ../../include/sys/uberblock_impl.h ../../include/sys/uio_impl.h ../../include/sys/unique.h ../../include/sys/uuid.h ../../include/sys/vdev_disk.h ../../include/sys/vdev_file.h ../../include/sys/vdev.h ../../include/sys/vdev_impl.h ../../include/sys/vdev_indirect_births.h ../../include/sys/vdev_indirect_mapping.h ../../include/sys/vdev_initialize.h ../../include/sys/vdev_raidz.h ../../include/sys/vdev_raidz_impl.h ../../include/sys/vdev_removal.h ../../include/sys/vdev_trim.h ../../include/sys/xvattr.h ../../include/sys/zap.h ../../include/sys/zap_impl.h ../../include/sys/zap_leaf.h ../../include/sys/zcp.h ../../include/sys/zcp_global.h ../../include/sys/zcp_iter.h ../../include/sys/zcp_prop.h ../../include/sys/zfeature.h ../../include/sys/zfs_acl.h ../../include/sys/zfs_context.h ../../include/sys/zfs_ctldir.h ../../include/sys/zfs_debug.h ../../include/sys/zfs_delay.h ../../include/sys/zfs_dir.h ../../include/sys/zfs_fuid.h ../../include/sys/zfs_project.h ../../include/sys/zfs_ratelimit.h ../../include/sys/zfs_rlock.h ../../include/sys/zfs_sa.h '/home/kernelshop/zout/include/libzfs/sys'
 /bin/install -c -m 644 ../../include/sys/zfs_stat.h ../../include/sys/zfs_sysfs.h ../../include/sys/zfs_vfsops.h ../../include/sys/zfs_vnops.h ../../include/sys/zfs_znode.h ../../include/sys/zil.h ../../include/sys/zil_impl.h ../../include/sys/zio_checksum.h ../../include/sys/zio_compress.h ../../include/sys/zio_crypt.h ../../include/sys/zio.h ../../include/sys/zio_impl.h ../../include/sys/zio_priority.h ../../include/sys/zrlock.h ../../include/sys/zthr.h '/home/kernelshop/zout/include/libzfs/sys'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include/sys'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/include'
make[4]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/home/kernelshop/zout/include/libzfs'
 /bin/install -c -m 644 ../include/zfeature_common.h ../include/zfs_comutil.h ../include/zfs_deleg.h ../include/zfs_fletcher.h ../include/zfs_namecheck.h ../include/zfs_prop.h ../include/libnvpair.h ../include/libuutil_common.h ../include/libuutil.h ../include/libuutil_impl.h ../include/libzfs.h ../include/libzfs_core.h ../include/libzfs_impl.h ../include/libzutil.h ../include/thread_pool.h '/home/kernelshop/zout/include/libzfs'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/include'
Making install in rpm
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm'
Making install in generic
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm/generic'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm/generic'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm/generic'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm/generic'
Making install in redhat
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm/redhat'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm/redhat'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm/redhat'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm/redhat'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/rpm'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/rpm'
Making install in udev
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-9/udev'
Making install in rules.d
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/udev/rules.d'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/udev/rules.d'
make[4]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p 'no/rules.d'
 /bin/install -c -m 644 69-vdev.rules 60-zvol.rules 90-zfs.rules 'no/rules.d'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/udev/rules.d'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/udev/rules.d'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/udev'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/udev'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/udev'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/udev'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/udev'
Making install in etc
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-9/etc'
Making install in default
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-9/etc/default'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-9/etc/default'
make[4]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/etc/default'
 /bin/install -c zfs '/etc/default'
/bin/install: cannot remove '/etc/default/zfs': Permission denied
make[4]: *** [Makefile:610: install-initconfSCRIPTS] Error 1
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/etc/default'
make[3]: *** [Makefile:702: install-am] Error 2
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/etc/default'
make[2]: *** [Makefile:647: install-recursive] Error 1
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-9/etc'
make[1]: *** [Makefile:841: install-recursive] Error 1
make[1]: Leaving directory '/home/kernelshop/zfs-0.8.4-9'
make: *** [Makefile:1148: install] Error 2

Case 3

$ make install
./scripts/make_gitrev.sh
make: [Makefile:1552: gitrev] Error 128 (ignored)
make  install-recursive
make[1]: Entering directory '/home/kernelshop/zfs-0.8.4-6'
Making install in include
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include'
Making install in linux
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/linux'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/linux'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/linux'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/linux'
Making install in spl
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl'
Making install in rpc
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl/rpc'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl/rpc'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl/rpc'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl/rpc'
Making install in sys
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl/sys'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl/sys'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl/sys'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl/sys'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/spl'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Nothing to be done for 'install-data-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/spl'
Making install in sys
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys'
Making install in fm
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm'
Making install in fs
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm/fs'
make[6]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm/fs'
make[6]: Nothing to be done for 'install-exec-am'.
make[6]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm/fs'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm/fs'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm'
make[6]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm'
make[6]: Nothing to be done for 'install-exec-am'.
make[6]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm'
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fm'
Making install in fs
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fs'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fs'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fs'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/fs'
Making install in crypto
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/crypto'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/crypto'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/crypto'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/crypto'
Making install in lua
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/lua'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/lua'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/lua'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/lua'
Making install in sysevent
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/sysevent'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys/sysevent'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/sysevent'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys/sysevent'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys'
make[5]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include/sys'
make[5]: Nothing to be done for 'install-exec-am'.
make[5]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys'
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include/sys'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/include'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/include'
Making install in rpm
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm'
Making install in generic
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm/generic'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm/generic'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm/generic'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm/generic'
Making install in redhat
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm/redhat'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm/redhat'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm/redhat'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm/redhat'
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm'
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6/rpm'
make[4]: Nothing to be done for 'install-exec-am'.
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-6/rpm'
make[2]: Entering directory '/home/kernelshop/zfs-0.8.4-6'
[ -x ./scripts/zfs-tests.sh ] && \
    ./scripts/zfs-tests.sh -c
make[3]: Entering directory '/home/kernelshop/zfs-0.8.4-6'
make[3]: Nothing to be done for 'install-exec-am'.
make  install-data-hook
make[4]: Entering directory '/home/kernelshop/zfs-0.8.4-6'
make[4]: Nothing to be done for 'install-data-hook'.
make[4]: Leaving directory '/home/kernelshop/zfs-0.8.4-6'
make[3]: Leaving directory '/home/kernelshop/zfs-0.8.4-6'
make[2]: Leaving directory '/home/kernelshop/zfs-0.8.4-6'
make[1]: Leaving directory '/home/kernelshop/zfs-0.8.4-6'
@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Jun 13, 2020
@behlendorf
Copy link
Contributor

TLDR, to build ZFS in to the kernel the process is as follows:

# Configure the kernel for a default build.
make mrproper defconfig

# Enable ZFS and additional dependencies.
cat >>.config <<EOF
CONFIG_CRYPTO_DEFLATE=y
CONFIG_ZLIB_DEFLATE=y
CONFIG_KALLSYMS=y
CONFIG_EFI_PARTITION=y
CONFIG_ZFS=y
EOF

# Prepare the kernel source.
make prepare

# Configure ZFS and add it to the kernel tree.
cd ../zfs-0.8.4
sh ./autogen.sh
./configure --enable-linux-builtin --with-linux=$LINUX_DIR --with-linux-obj=$LINUX_DIR
./copy-builtin $LINUX_DIR

# Build the kernel.
cd ../linux
make -j$(nproc)
make -j$(nproc) modules

Let my try and explain how the options are intended to be used and then walk through your three case. The --with-config=kernel|user|all option is used to selectively enable portions of the build system. This is useful when packaging, or as in your case, when your building ZFS in to the kernel and thus only the kmods are relevant.

When user is selected only the user space portions on ./configure are run and the relevant user space options applied. Similarly make only builds the user space components which were configured (utilities, libraries, systemd units, support scripts, test cases, etc).

When kernel is selected only the kernel space portions of ./configure are run and relevant kernel space options applied. This mainly involves determining your exact kernel version and what functionality is available in that kernel. Invoking make will then only build kmods.

When all is selected (the default) everything is built.

Case 1: make will fail, complaining of common.sh being missing (log below).

make actually doesn't fail. If you look closely at the log you'll see the error was ignored.

make; echo $?
make[2]: Entering directory `/tftpboot/dumps/behlendo/src/git/zfs-stock'
[ -x ./scripts/zfs-tests.sh ] && \
    ./scripts/zfs-tests.sh -c
Missing helper script common.sh
make[2]: [all-local] Error 1 (ignored)
make[2]: Leaving directory `/tftpboot/dumps/behlendo/src/git/zfs-stock'
make[1]: Leaving directory `/tftpboot/dumps/behlendo/src/git/zfs-stock'
0

The way the build is setup when --enable-linux-builtin is specified the expectation is that make will never be run in the zfs tree. Instead the copy-builtin.sh script should be used to copy the configured ZFS source in to the target kernel for later compilation there. A nice improvement would be to update make (or make install, or a new build target) to instead do this copy when --enable-linux-builtin is specified and print a message describing the next step which needs to be taken.

~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 \
    --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin \
   --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout \
   --without-udevdir --disable-sysvinit --disable-systemd --with-config=kernel

Note: Since --with-config=kernel is specified the following user space options are ignored entirely
--without-udevdir --disable-sysvinit --disable-systemd. These are user space components which won't be built at all. This includes the common.sh helper script which is expected and is why the error is ignored.

case 2
make install will fail, complaining that it cannot, as a non-root user, remove /etc/default/zfs (log below).

Similar to above, when --enable-linux-builtin is set the make install target isn't expected to be run. We could definitely handle this more gracefully and at least print a useful error message.

~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 \
    --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin \
    --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout \
    --without-udevdir --disable-sysvinit --disable-systemd

case 3
make install will succeed here.

This is because nothing should be built in this case and therefore there's nothing to install.

~/zfs-0.8.4 $ bash configure --with-linux=/home/kernelshop/linux-5.4.46 \
    --with-linux-obj=/home/kernelshop/linux-5.4.46 --enable-linux-builtin \
    --prefix=/home/kernelshop/zout --exec-prefix=/home/kernelshop/zout \
    --without-udevdir --disable-sysvinit --disable-systemd --with-config=kernel

@lampmerchant
Copy link
Author

Thanks, this was helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
None yet
Development

No branches or pull requests

2 participants