Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit dafbabb

Browse files
committed
add u-boot course
1 parent 3f0450a commit dafbabb

File tree

8 files changed

+59
-0
lines changed

8 files changed

+59
-0
lines changed

courses/cpp/uboot/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# CodeQL LearningLab Course Action Template
2+
3+
Copy this entire directory,
4+
and replace the following:
5+
6+
* Replace `<owner>`, `<repo>` and `<pkg>` in the `image` property in
7+
[`action.yml`](action.yml) to reference the correct repository
8+
where the docker image will be published,
9+
and with a package name of your choice.
10+
(For courses in this repository,
11+
we use the convention of taking the course path,
12+
and replacing slashes with dashes,
13+
e.g. `courses/cpp/ctf-segv` becomes `courses-cpp-ctf-segv`)
14+
* Replace the zip file URL in [`image/Dockerfile`](image/Dockerfile)
15+
to point to the CodeQL database that will be used in your course.
16+
17+
After this,
18+
update [`answers/`](answers) and [`image/config/`](image/config)
19+
to add your model answers and expected query results as appropriate.

courses/cpp/uboot/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: 'Check queries'
2+
description: 'Check that the queries that have been pushed produce the correct results'
3+
author: 'GitHub <[email protected]>'
4+
runs:
5+
using: 'docker'
6+
image: 'docker://docker.pkg.github.com/github/codeql-learninglab-actions/courses-cpp-uboot'
7+
branding:
8+
icon: 'check-circle'
9+
color: 'purple'

courses/cpp/uboot/answers/qlpack.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
name: codeql-uboot
2+
version: 0.0.0
3+
libraryPathDependencies: codeql-cpp # Update this with appropriate language

courses/cpp/uboot/answers/step-01.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import cpp
2+
3+
from Function f
4+
where f.getName() = "getchar"
5+
select f

courses/cpp/uboot/answers/step-02.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import cpp
2+
3+
from Function f
4+
where f.getName() = "getchar"
5+
select f

courses/cpp/uboot/image/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM docker.pkg.github.com/github/codeql-learninglab-actions/codeql-learninglab-check:v0.0.8
2+
3+
## Add course config
4+
COPY --chown=codeql:codeql config /home/codeql/config
5+
WORKDIR /home/codeql/config
6+
# Download, unzip and then delete the zip file in one step to reduce image size
7+
RUN wget --quiet https://downloads.lgtm.com/snapshots/cpp/uboot/u-boot_u-boot_cpp-srcVersion_d0d07ba86afc8074d79e436b1ba4478fa0f0c1b5-dist_odasa-2019-07-25-linux64.zip -O database.zip && unzip -qq database.zip && rm -rf database.zip
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"databasePath": "u-boot_u-boot_d0d07ba",
3+
"locationPaths": "https://github.com/u-boot/u-boot/blob/d0d07ba86afc8074d79e436b1ba4478fa0f0c1b5{path}#L{line-start}-L{line-end}",
4+
"expectedResults": {
5+
"step-01.ql": false
6+
}
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"f","URL for f","col1"
2+
"getchar","file:///opt/src/libio/getchar.c:33:1:33:7","a getchar function"
3+
"getchar","file:///opt/src/libio/bits/stdio.h:47:1:47:7","a getchar function"
4+
"getchar","file:///opt/src/libio/bits/stdio.h:47:1:47:7","a getchar function"

0 commit comments

Comments
 (0)