aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2021-07-17 00:25:07 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2021-07-17 00:25:07 +0300
commitc68dd316c0cf363a500e85f5d1e39a1847b71fd2 (patch)
treeea6a57873a4c395d0eb6f41e482e3632df0d8cfd /scripts
parent403b894424286b13fcdd3e0f5e38af0005dd24ad (diff)
downloadUEFI-Lessons-c68dd316c0cf363a500e85f5d1e39a1847b71fd2.tar.gz
UEFI-Lessons-c68dd316c0cf363a500e85f5d1e39a1847b71fd2.tar.bz2
UEFI-Lessons-c68dd316c0cf363a500e85f5d1e39a1847b71fd2.zip
Add createNewApp.sh script
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/createNewApp.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/createNewApp.sh b/scripts/createNewApp.sh
new file mode 100755
index 0000000..9fde27f
--- /dev/null
+++ b/scripts/createNewApp.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# This is a simple script that creates a basic structure for your new UEFI application
+# Put this script in your edk2 folder and run it with 1 argument - your new application name
+
+APP_NAME=${1}
+
+UUID=$(uuidgen)
+
+mkdir -p UefiLessonsPkg/${APP_NAME}
+
+cat << EOF > UefiLessonsPkg/${APP_NAME}/${APP_NAME}.inf
+[Defines]
+ INF_VERSION = 1.25
+ BASE_NAME = ${APP_NAME}
+ FILE_GUID = ${UUID}
+ MODULE_TYPE = UEFI_APPLICATION
+ VERSION_STRING = 1.0
+ ENTRY_POINT = UefiMain
+
+[Sources]
+ ${APP_NAME}.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[LibraryClasses]
+ UefiApplicationEntryPoint
+ UefiLib
+EOF
+
+cat << EOF > UefiLessonsPkg/${APP_NAME}/${APP_NAME}.c
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+
+EFI_STATUS
+EFIAPI
+UefiMain (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ return EFI_SUCCESS;
+}
+EOF
+