Files
s390-tools/zdev/src/Makefile
Vineeth Vijayan 7dd03eaeec zdev: Add build option to update initial RAM-disk by default
Some Linux distributions always include a copy of all persistent device
configuration data when updating the initial RAM-disk. This makes
chzdev's persistent device configuration changes ineffective because
device configuration directives applied in the RAM-disk take precedence
over those stored in the root filesystem.

This patch introduces a new build-time switch which allows distributions
to specify that whenever there is a persistent device configuration
change, the RAM-disk is updated automatically.

This feature can be enabled by adding 'ZDEV_ALWAYS_UPDATE_INITRD=1' as
a zdev build option. Where, by default ZDEV_ALWAYS_UPDATE_INITRD is 0.

Co-developed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2021-01-25 13:19:33 +01:00

111 lines
2.8 KiB
Makefile

# Common definitions
include ../../common.mak
ALL_CPPFLAGS += -I ../include -std=gnu99 -Wno-unused-parameter \
-Wno-missing-field-initializers
# Adding ZDEV_ALWAYS_UPDATE_INITRD=1 option will update the initial RAM-disk
# without the user interaction upon the modification of a persistent device
# configuration.
ifeq ($(ZDEV_ALWAYS_UPDATE_INITRD),1)
ALL_CPPFLAGS += -DZDEV_ALWAYS_UPDATE_INITRD=true
else
ALL_CPPFLAGS += -DZDEV_ALWAYS_UPDATE_INITRD=false
endif
# Core
chzdev_objects += attrib.o chzdev.o device.o devnode.o devtype.o exit_code.o \
export.o hash.o inuse.o misc.o namespace.o opts.o path.o \
root.o select.o setting.o subtype.o table.o table_attribs.o \
table_types.o net.o firmware.o internal.o
# Devtype Helpers
chzdev_objects += blkinfo.o ccw.o ccwgroup.o findmnt.o modprobe.o module.o \
udev.o udev_ccw.o udev_ccwgroup.o iscsi.o
# DASD devtype
chzdev_objects += dasd.o
# FCP devtype
chzdev_objects += zfcp.o zfcp_host.o
chzdev_objects += scsi.o udev_zfcp_lun.o zfcp_lun.o
# QETH devtype
chzdev_objects += nic.o qeth.o qeth_auto.o
# CTC devtype
chzdev_objects += ctc.o ctc_auto.o
# LCS devtype
chzdev_objects += lcs.o lcs_auto.o
# Generic CCW devtype
chzdev_objects += generic_ccw.o
# Core
lszdev_objects += attrib.o lszdev.o device.o devnode.o devtype.o exit_code.o \
export.o hash.o inuse.o misc.o namespace.o opts.o path.o \
root.o select.o setting.o subtype.o table.o table_types.o \
net.o internal.o
# Devtype Helpers
lszdev_objects += blkinfo.o ccw.o ccwgroup.o findmnt.o modprobe.o module.o \
udev.o udev_ccw.o udev_ccwgroup.o iscsi.o
# DASD devtype
lszdev_objects += dasd.o
# FCP devtype
lszdev_objects += zfcp.o zfcp_host.o
lszdev_objects += scsi.o udev_zfcp_lun.o zfcp_lun.o
# QETH devtype
lszdev_objects += nic.o qeth.o qeth_auto.o
# CTC devtype
lszdev_objects += ctc.o ctc_auto.o
# LCS devtype
lszdev_objects += lcs.o lcs_auto.o
# Generic CCW devtype
lszdev_objects += generic_ccw.o
all: chzdev lszdev
chzdev_usage.c: chzdev_usage.txt
$(SED) $< >$@ -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/g' \
-e 's/$$/\\n"/g'
.chzdev.o.d: chzdev_usage.c
lszdev_usage.c: lszdev_usage.txt
$(SED) $< >$@ -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/g' \
-e 's/$$/\\n"/g'
.lszdev.o.d: lszdev_usage.c
chzdev.o: chzdev_usage.c
lszdev.o: lszdev_usage.c
libs = $(rootdir)/libutil/libutil.a
chzdev: $(chzdev_objects) $(libs)
lszdev: $(lszdev_objects) $(libs)
install: chzdev
$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)
$(INSTALL) -c chzdev $(DESTDIR)$(BINDIR)
$(INSTALL) -c lszdev $(DESTDIR)$(BINDIR)
ifeq ($(HAVE_DRACUT),1)
$(INSTALL) -m 755 zdev-root-update.dracut \
$(DESTDIR)$(TOOLS_LIBDIR)/zdev-root-update
endif
clean:
@rm -f *.o chzdev lszdev chzdev_usage.c lszdev_usage.c gmon.out *.gcda *.gcno
.PHONY: all install clean