aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Aladyshev <aladyshev22@gmail.com>2022-07-28 11:38:50 +0300
committerKonstantin Aladyshev <aladyshev22@gmail.com>2022-07-28 11:38:50 +0300
commit208b9c0dec67b06c404b500cb976d7d0d9e01795 (patch)
treea0d7ed285f83f3729d1b56d96d2667f5d05c00c8
parentca4593c2dcde8ae8a5c48ccf41589e85451f6cf8 (diff)
downloadUEFI-Lessons-208b9c0dec67b06c404b500cb976d7d0d9e01795.tar.gz
UEFI-Lessons-208b9c0dec67b06c404b500cb976d7d0d9e01795.tar.bz2
UEFI-Lessons-208b9c0dec67b06c404b500cb976d7d0d9e01795.zip
Add createNewShellApp.sh script
Signed-off-by: Konstantin Aladyshev <aladyshev22@gmail.com>
-rw-r--r--scripts/README.md2
-rwxr-xr-xscripts/createNewShellApp.sh46
2 files changed, 48 insertions, 0 deletions
diff --git a/scripts/README.md b/scripts/README.md
index 18ecb7c..41f2461 100644
--- a/scripts/README.md
+++ b/scripts/README.md
@@ -4,6 +4,8 @@
[createNewApp.sh](createNewApp.sh) - create new UEFI_APPLICATION by name
+[createNewShellApp.sh](createNewShellApp.sh) - create new UEFI_APPLICATION with shell entry point by name
+
[createNewDriver.sh](createNewDriver.sh) - create new UEFI_DRIVER by name
- Replace GUIDs in log file:
diff --git a/scripts/createNewShellApp.sh b/scripts/createNewShellApp.sh
new file mode 100755
index 0000000..9674142
--- /dev/null
+++ b/scripts/createNewShellApp.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# This is a simple script that creates a basic structure for your new UEFI shell 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 = ShellCEntryLib
+
+[Sources]
+ ${APP_NAME}.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+
+[LibraryClasses]
+ ShellCEntryLib
+ UefiLib
+EOF
+
+cat << EOF > UefiLessonsPkg/${APP_NAME}/${APP_NAME}.c
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+
+INTN
+EFIAPI
+ShellAppMain (
+ IN UINTN Argc,
+ IN CHAR16 **Argv
+ )
+{
+ return EFI_SUCCESS;
+}
+EOF
+