-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCSTAPP.sh
96 lines (75 loc) · 1.37 KB
/
CSTAPP.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
#
# Construct UEFI Application Script
#
#check input
if [ -z "$1" ]; then
echo please give a file name!
return
fi
#init
mCurrentYear=$(date +%Y)
mGUID=$(uuidgen)
mDIR="./Application/$1/"
mFILE_INF=$1".inf"
mFILE_SRC=$1".c"
#create files
if [ ! -d $mDIR ]; then
mkdir $mDIR
fi
touch $mDIR$mFILE_INF $mDIR$mFILE_SRC
#write inf file
cat <<EOF > $mDIR$mFILE_INF
##
# UEFI Application
#
# A shell application
#
# Free As Freedom @ $mCurrentYear
#
#
##
[Defines]
INF_VERSION = 0x00010006
BASE_NAME = ${1^^}
FILE_GUID = ${mGUID^^}
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = ShellCEntryLib
[Sources]
$mFILE_SRC
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ShellPkg/ShellPkg.dec
MyPkg/MyPkg.dec
[LibraryClasses]
UefiApplicationEntryPoint
UefiLib
ShellCEntryLib
[Protocols]
EOF
#write source c
cat <<EOF > $mDIR$mFILE_SRC
/*++
FreeAsFreedom @ $mCurrentYear Kurt Qiao
Module Name:
$mFILE_SRC
Abstract:
Revision History
--*/
#include <Uefi.h>
#include <Library/UefiLib.h>
#include "Library/UefiBootServicesTableLib.h"
EFI_STATUS
EFIAPI
ShellAppMain (
IN UINTN Argc,
IN CHAR16 **Argv
)
{
EFI_STATUS Status;
Status = EFI_SUCCESS;
return Status;
}
EOF