Skip to content

Commit d758d9e

Browse files
bjzhjingrbradford
authored andcommitted
buildkite: Add repository post-checkout hook to upload bzImage
A pre-compiled bzImage is needed for bzImage loader unit test, add this hook to prepare it in CI environment by downloading and extracting it in specified path for later test. Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
1 parent 97e3c54 commit d758d9e

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.buildkite/hooks/post-checkout

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
DEB_NAME="linux-image-4.9.0-9-amd64_4.9.168-1_amd64.deb"
4+
DEB_URL="http://ftp.debian.org/debian/pool/main/l/linux/${DEB_NAME}"
5+
6+
REPO_PATH="${BUILDKITE_BUILD_CHECKOUT_PATH}/linux-loader"
7+
DEB_PATH="${REPO_PATH}/${DEB_NAME}"
8+
EXTRACT_PATH="${REPO_PATH}/src/bzimage-archive"
9+
BZIMAGE_PATH="${EXTRACT_PATH}/boot/vmlinuz-4.9.0-9-amd64"
10+
11+
mkdir -p ${EXTRACT_PATH}
12+
13+
wget $DEB_URL -P ${REPO_PATH}
14+
dpkg-deb -x ${DEB_PATH} ${EXTRACT_PATH}
15+
16+
mv ${BZIMAGE_PATH} ${REPO_PATH}/src/loader/bzimage
17+
rm -r ${EXTRACT_PATH}
18+
rm -f ${DEB_PATH}
19+

src/loader/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ mod test {
377377
#[allow(non_snake_case)]
378378
fn make_bzImage() -> Vec<u8> {
379379
let mut v = Vec::new();
380-
v.extend_from_slice(include_bytes!("bzImage"));
380+
v.extend_from_slice(include_bytes!("bzimage"));
381381
v
382382
}
383383

0 commit comments

Comments
 (0)