Commit 2c024513 authored by Ophélie Gagnard's avatar Ophélie Gagnard

dracut.module/: Choose the version of the module's main script (collect.sh) in...

dracut.module/: Choose the version of the module's main script (collect.sh) in the Makefile. Add several versions.
parent 4aa6a8b0
......@@ -2,31 +2,23 @@
. /lib/dracut-lib.sh
#>&2 echo "$NEWROOT" # DEBUG: display the path of newroot before the pivot
#sleep 10 # DEBUG
DEBUG_LOG_FILE=/var/log/debug-mode.log
MCA_LOG_FILE=/var/log/metadata_collect.log
/sbin/fluent-bit -e /etc/libfluentbit_wendelin.so -c /etc/debug-mode.conf &
debug_flb_pid=$!
sleep 1 # wait for fluent-bit to monitor the log file (?)
echo "NEWROOT = $NEWROOT" &>> $DEBUG_LOG_FILE
echo "********** /sbin **********" &>> $DEBUG_LOG_FILE
ls -Rl /sbin &>> $DEBUG_LOG_FILE
echo "********** /usr/sbin **********" &>> $DEBUG_LOG_FILE
ls -Rl /usr/sbin &>> $DEBUG_LOG_FILE
echo "********** /bin **********" &>> $DEBUG_LOG_FILE
ls -Rl /bin &>> $DEBUG_LOG_FILE
echo "********** /etc **********" &>> $DEBUG_LOG_FILE
ls -Rl /usr/bin &>> $DEBUG_LOG_FILE
echo "********** /usr/etc **********" &>> $DEBUG_LOG_FILE
ls -Rl /etc &>> $DEBUG_LOG_FILE
echo "********** /lib **********" &>> $DEBUG_LOG_FILE
ls -Rl /lib &>> $DEBUG_LOG_FILE
echo "********** /usr/lib **********" &>> $DEBUG_LOG_FILE
ls -Rl /usr/lib &>> $DEBUG_LOG_FILE
echo "fluentbit_end" &>> $DEBUG_LOG_FILE
wait $debug_flb_pid
#/sbin/metadata-collect-agent "$NEWROOT"
/sbin/metadata-collect-agent $NEWROOT /sbin/fluent-bit /etc/libfluentbit_wendelin.so /etc/flb.conf /var/log/metadata_collect.log
#sleep 10 " DEBUG
#!/bin/bash
. /lib/dracut-lib.sh
DEBUG_LOG_FILE=/var/log/debug-mode.log
/sbin/fluent-bit -e /etc/libfluentbit_wendelin.so -c /etc/debug-mode.conf &
debug_flb_pid=$!
sleep 1 # wait for fluent-bit to monitor the log file (?)
echo "NEWROOT = $NEWROOT" &>> $DEBUG_LOG_FILE
echo "********** /usr/sbin **********" &>> $DEBUG_LOG_FILE
ls -Rl /usr/sbin &>> $DEBUG_LOG_FILE
echo "********** /bin **********" &>> $DEBUG_LOG_FILE
ls -Rl /usr/bin &>> $DEBUG_LOG_FILE
echo "********** /usr/etc **********" &>> $DEBUG_LOG_FILE
ls -Rl /etc &>> $DEBUG_LOG_FILE
echo "********** /usr/lib **********" &>> $DEBUG_LOG_FILE
ls -Rl /usr/lib &>> $DEBUG_LOG_FILE
echo "fluentbit_end" &>> $DEBUG_LOG_FILE
wait $debug_flb_pid
#!/bin/bash
. /lib/dracut-lib.sh
/sbin/metadata-collect-agent $NEWROOT /sbin/fluent-bit /etc/libfluentbit_wendelin.so /etc/flb.conf /var/log/metadata_collect.log
......@@ -11,16 +11,20 @@ ifeq ($(FLB_PATH),)
endif
DRACUT_MODULE_NAME=90metadata-collect
LOCAL_DRACUT_MODULE=$(DRACUT_MODULE_NAME)/
LOCAL_DRACUT_MODULE=$(DRACUT_MODULE_NAME)
.PHONY: all
all: dev 90metadata-collect/metadata-collect-agent 90metadata-collect/fluent-bit 90metadata-collect/fluentbit_wendelin.so 90metadata-collect/flb.conf
all: dev 90metadata-collect/collect.sh 90metadata-collect/metadata-collect-agent 90metadata-collect/fluent-bit 90metadata-collect/fluentbit_wendelin.so 90metadata-collect/flb.conf
dev:
@echo dev1 = $(dev1)
90metadata-collect/collect.sh:
# different options are vailable: debug-and-scan, only-debug, only-scan
cp $(LOCAL_DRACUT_MODULE)/only-scan.sh $(LOCAL_DRACUT_MODULE)/collect.sh
90metadata-collect/metadata-collect-agent:
cp $(MCA_PATH)/bin/metadata-collect-agent $(LOCAL_DRACUT_MODULE)
......@@ -35,6 +39,7 @@ dev:
.PHONY: clean
clean:
rm -f $(LOCAL_DRACUT_MODULE)/collect.sh
rm -f $(LOCAL_DRACUT_MODULE)/metadata-collect-agent
rm -f $(LOCAL_DRACUT_MODULE)/fluent-bit
rm -f $(LOCAL_DRACUT_MODULE)/libfluentbit_wendelin.so
......@@ -42,8 +47,8 @@ clean:
.PHONY: install
install: all
cp -vLr "90metadata-collect" /usr/lib/dracut/modules.d
cp -vLr $(LOCAL_DRACUT_MODULE) /usr/lib/dracut/modules.d
.PHONY: uninstall
uninstall:
rm -rfv /usr/lib/dracut/modules.d/90metadata-collect
rm -rfv /usr/lib/dracut/modules.d/$(DRACUT_MODULE_NAME)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment