aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2021-07-17 00:31:24 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2021-07-17 00:31:24 +0300
commite076c459f61cbebec552b11f91f1123aedcd0c4d (patch)
tree0ac4b5f579818cb1d1047813af84d27412a77506 /scripts
parentc68dd316c0cf363a500e85f5d1e39a1847b71fd2 (diff)
downloadUEFI-Lessons-e076c459f61cbebec552b11f91f1123aedcd0c4d.tar.gz
UEFI-Lessons-e076c459f61cbebec552b11f91f1123aedcd0c4d.tar.bz2
UEFI-Lessons-e076c459f61cbebec552b11f91f1123aedcd0c4d.zip
Add createNewDriver.sh script
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/createNewDriver.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/scripts/createNewDriver.sh b/scripts/createNewDriver.sh
new file mode 100644
index 0000000..5c05916
--- /dev/null
+++ b/scripts/createNewDriver.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+# This is a simple script that creates a basic structure for your new UEFI driver
+# Put this script in your edk2 folder and run it with 1 argument - your new driver name
+
+DRIVER_NAME=${1}
+
+UUID=$(uuidgen)
+
+mkdir -p UefiLessonsPkg/${DRIVER_NAME}
+
+cat << EOF > UefiLessonsPkg/${DRIVER_NAME}/${DRIVER_NAME}.inf
+[Defines]
+ INF_VERSION = 1.25
+ BASE_NAME = ${DRIVER_NAME}
+ FILE_GUID = ${UUID}
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = ${DRIVER_NAME}EntryPoint
+ UNLOAD_IMAGE = ${DRIVER_NAME}Unload
+
+[Sources]
+ ${DRIVER_NAME}.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[LibraryClasses]
+ UefiDriverEntryPoint
+ UefiLib
+EOF
+
+cat << EOF > UefiLessonsPkg/${DRIVER_NAME}/${DRIVER_NAME}.c
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+
+
+EFI_STATUS
+EFIAPI
+${DRIVER_NAME}Unload (
+ EFI_HANDLE ImageHandle
+ )
+{
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+${DRIVER_NAME}EntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ return EFI_SUCCESS;
+}
+EOF
+