Skip to content

Commit

Permalink
librecomputer: genimage: add initramfs config and script
Browse files Browse the repository at this point in the history
  • Loading branch information
Da Xue authored and lc-engineering-bot committed Oct 4, 2023
1 parent 07a03a8 commit aaa0ffa
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
25 changes: 25 additions & 0 deletions board/librecomputer/genimage/initramfs/genimage.cfg
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
}
}

16 changes: 16 additions & 0 deletions board/librecomputer/genimage/initramfs/genimage.sh
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"

0 comments on commit aaa0ffa

Please sign in to comment.