Files
clr-init/Makefile
T
Josue David Hernandez ee60fd153b clr-init: adding load modules and emergency mode support
if something fails the initrd will provide a shell to see what was wrong

also now load kernel modules from an additional cpio file is posible this
cpio file just must have the path /usr/lib/modules/$(uname -r)/ with the common
kernel modules tree and module.* files to be loaded.

Signed-off-by: Josue David Hernandez <josue.d.hernandez.gutierrez@intel.com>
2018-09-26 11:39:48 -05:00

25 lines
857 B
Makefile

BINFILES=`cat bin_files`
all:
@mkdir -p initramfs/{sys,dev,proc,tmp,var,sysroot,usr/sbin,usr/bin,usr/lib/systemd/system-generators,usr/lib64,usr/lib64/multipath,run,root} && \
for file in $(BINFILES); \
do \
cp -f $$file initramfs/$$file;\
done && \
cp $$(ldd $(BINFILES) | awk '{print $$3}' | grep "^/" | sort | uniq) initramfs/usr/lib64/ && \
cd initramfs && \
find . -print0 | cpio -o --null --format=newc | gzip -9 > ../clr-init.cpio.gz && \
cd ..
install: clr-init.cpio.gz
@mkdir -p $(DESTDIR)/usr/lib/initrd.d/ && \
cp $< $(DESTDIR)/usr/lib/initrd.d/
clean:
@for file in $(BINFILES); \
do \
rm -f initramfs/$$file; \
done && \
rm -rf initramfs/{sys,dev,proc,tmp,var,sysroot,usr/sbin,usr/bin,usr/lib/systemd/system-generators,usr/lib64,usr/lib64/multipath,run,root} && \
rm clr-init.cpio.gz