LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   eudev destdir install (https://www.linuxquestions.org/questions/linux-from-scratch-13/eudev-destdir-install-4175620259/)

jr_bob_dobbs 12-24-2017 03:57 PM

eudev destdir install
 
Has anyone done a destdir (ie, make a package for later install) install of eudev.

I ask because I've been slowly making a new LFS 8.1 system, using destdir for every package in chapter 6 after GCC and ... this one has me stumped. ATM, the *install* phase segfaults. :o How can just copying and chmoding some files segfault? Yeah, something is odd here. This is beyond my intellect and knowledge.

Right, so for anyone who has pulled this off? How did you do it please?

emmett1 12-26-2017 09:30 AM

Quote:

sed -r -i 's|/usr(/bin/test)|\1|' test/udev-test.pl
sed -i '/keyboard_lookup_key/d' src/udev/udev-builtin-keyboard.c

cat > config.cache << "EOF"
HAVE_BLKID=1
BLKID_LIBS="-lblkid"
BLKID_CFLAGS="-I/tools/include"
EOF

./configure --prefix=/usr \
--bindir=/sbin \
--sbindir=/sbin \
--libdir=/usr/lib \
--sysconfdir=/etc \
--libexecdir=/lib \
--with-rootprefix= \
--with-rootlibdir=/lib \
--enable-manpages \
--disable-static \
--config-cache
LIBRARY_PATH=/tools/lib make

mkdir -pv $PKG/lib/udev/rules.d
mkdir -pv $PKG/etc/udev/rules.d

make LD_LIBRARY_PATH=/tools/lib DESTDIR=$PKG install

cd $SRC
make -f udev-lfs-20140408/Makefile.lfs DESTDIR=$PKG install

LD_LIBRARY_PATH=/tools/lib $PKG/sbin/udevadm hwdb --update --root=$PKG
this whats on my script for eudev using DESTDIR method
$PKG is temporary install dir
$SRC is where eudev source is extracted

jr_bob_dobbs 12-27-2017 12:49 PM

Thank you for the reply.

How very strange, my script essentially does the same thing yours does, yet mine does not work. D'oh. Gonna have to do some serious analysis & investigation.

I like this:
Code:

LD_LIBRARY_PATH=/tools/lib $PKG/sbin/udevadm hwdb --update --root=$PKG
because I did not know about that --root parameter. Will be adding that in after I get the original problem sorted out. Thank you. :)

jr_bob_dobbs 12-28-2017 05:25 PM

So I took a lot of time and did the following.

Looked through the makefile. Wow, what a jungle. Made my head spin.

Backed up the 8.1 system. Installed eudev exactly as in the book, stopping just before putting in the lfs addition. Then ran a file compare. Used that plus the make file to write my own manual install list of commands.

So here is what the install part of my script looks like:
Code:

# make directories first
mkdir -pv $PACKHERE/sbin
mkdir -pv $PACKHERE/etc/udev/hwdb.d
mkdir -pv $PACKHERE/etc/udev/rules.d
mkdir -pv $PACKHERE/lib/udev/rules.d
mkdir -pv $PACKHERE/usr/lib
mkdir -pv $PACKHERE/usr/include
mkdir -pv $PACKHERE/usr/lib/pkgconfig
mkdir -pv $PACKHERE/usr/share/pkgconfig
mkdir -pv $PACKHERE/usr/share/man/man5
mkdir -pv $PACKHERE/usr/share/man/man7
mkdir -pv $PACKHERE/usr/share/man/man8

# library (2 files plus 2 symlinks)
install -c src/libudev/.libs/libudev.so.1.6.3 $PACKHERE/lib/libudev.so.1.6.3
ln -sv libudev.so.1.6.3 $PACKHERE/lib/libudev.so.1
ln -sv ../../lib/libudev.so.1.6.3 $PACKHERE/usr/lib/libudev.so
install -c src/libudev/.libs/libudev.lai $PACKHERE/usr/lib/libudev.la

# include (source code libraries)
install -c -m 644 src/libudev/libudev.h $PACKHERE/usr/include
# Dude: inside libudev.h it says "This file is part of systemd."  WTF?
install -c -m 644 src/udev/udev.h $PACKHERE/usr/include

# the pkgconfig file in usr/lib
install -c -m 644 src/libudev/libudev.pc $PACKHERE/usr/lib/pkgconfig
# the pkgconfig file in usr/share
install -c -m 644 src/udev/udev.pc $PACKHERE/usr/share/pkgconfig

# two binaries
install -m 700 src/udev/udevadm $PACKHERE/sbin/udevadm
install -m 700 src/udev/udevd $PACKHERE/sbin/udevd

# etc/udev config file
install -m 644 src/udev/udev.conf $PACKHERE/etc/udev

# files for /lib/udev
install  src/ata_id/ata_id $PACKHERE/lib/udev/
install  src/cdrom_id/cdrom_id $PACKHERE/lib/udev/
install  src/collect/collect $PACKHERE/lib/udev/
install  src/mtd_probe/mtd_probe $PACKHERE/lib/udev/
install  src/scsi_id/scsi_id $PACKHERE/lib/udev/
install  src/v4l_id/v4l_id $PACKHERE/lib/udev/

# files for /lib/udev/rules.d
cd rules
install -m 644 50-udev-default.rules \
  60-block.rules 60-cdrom_id.rules 60-drm.rules 60-evdev.rules \
  60-persistent-alsa.rules 60-persistent-input.rules \
  60-persistent-storage-tape.rules 60-persistent-v4l.rules \
  60-sensor.rules 60-serial.rules 64-btrfs.rules 70-mouse.rules \
  70-touchpad.rules 75-net-description.rules 78-sound-card.rules \
  80-net-name-slot.rules 60-persistent-storage.rules 80-drivers.rules \
  75-probe_mtd.rules $PACKHERE/lib/udev/rules.d
cd ..

# man 5, 7, 8
install -c -m 644 man/udev.conf.5 $PACKHERE/usr/share/man/man5
install -c -m 644 man/udev.7 $PACKHERE/usr/share/man/man7
install -c -m 644 man/udevd.8 man/udevadm.8 $PACKHERE/usr/share/man/man8

# hwdb ... hardware data base?
cd hwdb
install -m 644 \
 20-OUI.hwdb 20-acpi-vendor.hwdb 20-bluetooth-vendor-product.hwdb \
 20-net-ifname.hwdb 20-pci-classes.hwdb 20-pci-vendor-model.hwdb \
 20-sdio-classes.hwdb 20-sdio-vendor-model.hwdb 20-usb-classes.hwdb \
 20-usb-vendor-model.hwdb 60-evdev.hwdb 60-keyboard.hwdb \
 60-sensor.hwdb 70-mouse.hwdb 70-pointingstick.hwdb \
 70-touchpad.hwdb \
 $PACKHERE/etc/udev/hwdb.d
cd ..

# Now THAT was a mess!

PACKHERE is what I normally pass as DESTDIR in normal installs. :p

Reverted system from backup.

Ran my script to build the eudev package. Package built fine. Installed it. Moved on. Installed the rest. Did the fiddly bits to set up for reboot. Rebooted into the fallback OS to set up the boot loader entry. Rebooted ... fixed a stupid problem unrelated to eudev (me, being an idiot, built the sysvinit package and then forgot to install it). Rebooted again ... into my new 8.1 system.

Compiled a BLFS package as a test. Rebooted again. Still running fine.

Looks like it worked. Whew! :)

p.s. If one goes through the source code for eudev, it says it is part of systemd. Wait a minute, thought the whole point of [E]udev was to avoid systemd?

emmett1 12-30-2017 02:17 AM

Wow thats seem complicated. thats really mess :p

I hope everything work fine.

In case you got wondering how other package build using DESTDIR method you can check my ports (its package buildscript using with my package manager) here:

https://github.com/emmett1/ports

But keep in mind its not 100% use command on BLFS book, for some package I modify a bit to suit my need. And i use it with my BSD-style init, so theres no {b,}lfs-bootscripts.

And also not all package on BLFS book is there, just few package for my daily use on my laptop and desktop.

And one more thing, its based on (B)LFS-SVN book

jr_bob_dobbs 12-30-2017 05:26 PM

Quote:

Originally Posted by emmett1 (Post 5799565)
Wow thats seem complicated. thats really mess :p

That mess is clean, compact and clear when compared with how the original Makefile did it. I begin to suspect that the approach of using automake & autoconf to then make a configure file (that one never looks at) to in turn make a Makefile ... has caused an added unneeded complexity and a lack of stability to many packages.

Quote:

I hope everything work fine.
Things mount, so looks like eudev is fine. Honestly, after all the time spent on investigating this, I've got a good idea as to what goes where now. Kind of like how one makes an LFS instead of just booting a Ubuntu installer. You get it done much quicker but you have no idea what is going on that you don't see. ;) The point is, I have a high confidence that eudev is installed correctly.

emmett1 12-30-2017 10:23 PM

yeah i mean 'fun mess' not 'mess mess' if you know what i mean. :)
its so great of you could do that. i'm so lazy to do that :)

last time i'm using LFS with sysvinit eudev is one problem i got, some of my hardware not working, on dmesg show something error with udev, but i'm to lazy to find out whats the problem.

until i dump all lfs-bootscript and use BSD-style init converted from lfs-bootscripts, all is working fine, eudev is fine, even my system boot faster. :)


All times are GMT -5. The time now is 09:49 PM.