summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2019-07-26 20:17:54 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2019-07-26 20:17:54 -0400
commitefd5d866be3cdb9c2b5b3221319fbc80aa0d039b (patch)
tree5aa6603f47e56bcc380db0274513b95240727e64 /Makefile
downloadminitramfs-efd5d866be3cdb9c2b5b3221319fbc80aa0d039b.tar.xz
minitramfs-efd5d866be3cdb9c2b5b3221319fbc80aa0d039b.zip
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0b2d171
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+all: initramfs.img amd-uc.img
+
+initramfs.img:
+ ./make
+
+-include initramfs.d
+
+amd-uc.img: kernel/x86/microcode/AuthenticAMD.bin
+ echo $^ | bsdcpio -o -H newc -R 0:0 > $@
+
+kernel/x86/microcode/AuthenticAMD.bin: /lib/firmware/amd-ucode/microcode_amd_fam17h.bin /lib/firmware/amd/amd_sev_fam17h_model0xh.sbin
+ mkdir -p $(@D)
+ cat $^ > $@
+
+install: /boot/initramfs.img /boot/amd-uc.img
+
+/boot/initramfs.img: initramfs.img
+ rm -f $@.old $@.new
+ cp $< $@.new
+ if [ -e $@ ]; then mv $@ $@.old; fi
+ mv $@.new $@
+
+/boot/amd-uc.img: amd-uc.img
+ cp $< $@
+
+clean:
+ $(RM) -r initramfs.img initramfs.d amd-uc.img kernel