-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
librecomputer: genimage: add initramfs config and script
- Loading branch information
Da Xue
authored and
lc-engineering-bot
committed
Oct 4, 2023
1 parent
07a03a8
commit aaa0ffa
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
image boot.vfat { | ||
vfat { | ||
file EFI/boot/BOOTAA64.EFI { | ||
image = "Image" | ||
} | ||
} | ||
size = __SIZE__M | ||
} | ||
|
||
image sdcard.img { | ||
hdimage { | ||
} | ||
partition bootloader { | ||
in-partition-table = false | ||
offset = 512 | ||
image = "__BOARD__" | ||
} | ||
partition rootfs { | ||
partition-type = 0xEF | ||
bootable = "true" | ||
image = "boot.vfat" | ||
offset = 1M | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
BOARD=$2 | ||
IMAGE_SIZE=$(stat -c %s $BINARIES_DIR/Image) | ||
IMAGE_SIZE=$((((IMAGE_SIZE + (17 << 20) - 1) >> 23 << 3) - 1)) | ||
GENIMG_CFG=$BINARIES_DIR/genimage.cfg | ||
|
||
wget https://boot.libre.computer/ci/$BOARD -O $BINARIES_DIR/$BOARD | ||
|
||
cp -f $(dirname "${BASH_SOURCE[0]}")/genimage.cfg "$GENIMG_CFG" | ||
|
||
sed -i "s/__SIZE__/$IMAGE_SIZE/" "$GENIMG_CFG" | ||
sed -i "s/__BOARD__/$BOARD/" "$GENIMG_CFG" | ||
|
||
support/scripts/genimage.sh -c "$GENIMG_CFG" |