-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy over the osbuilder-tools image assets and merge with auroraboot
So we can deprecate the osbuilder-tools image in favor of this one. Part of kairos-io/kairos#1633 Signed-off-by: Dimitris Karakasilis <[email protected]>
- Loading branch information
1 parent
cb118b3
commit 595306d
Showing
21 changed files
with
1,080 additions
and
6 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
examples/airgap/build | ||
examples/airgap/data | ||
dist/ | ||
build/ |
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
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
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,18 @@ | ||
#!/bin/bash | ||
# docker run --entrypoint /add-cloud-init.sh -v $PWD:/work -ti --rm test https://github.com/kairos-io/kairos/releases/download/v1.1.2/kairos-alpine-v1.1.2.iso /work/test.iso /work/config.yaml | ||
|
||
set -ex | ||
|
||
ISO=$1 | ||
OUT=$2 | ||
CONFIG=$3 | ||
|
||
case ${ISO} in | ||
http*) | ||
curl -L "${ISO}" -o in.iso | ||
ISO=in.iso | ||
;; | ||
esac | ||
|
||
# Needs xorriso >=1.5.4 | ||
xorriso -indev $ISO -outdev $OUT -map $CONFIG /config.yaml -boot_image any replay |
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,13 @@ | ||
#!/bin/bash | ||
|
||
image=$1 | ||
|
||
if [ -z "$image" ]; then | ||
echo "No image specified" | ||
exit 1 | ||
fi | ||
|
||
# conv=notrunc ? | ||
dd if=/firmware/odroid-c2/bl1.bin.hardkernel of=$image conv=fsync bs=1 count=442 | ||
dd if=/firmware/odroid-c2/bl1.bin.hardkernel of=$image conv=fsync bs=512 skip=1 seek=1 | ||
dd if=/firmware/odroid-c2/u-boot.odroidc2 of=$image conv=fsync bs=512 seek=97 |
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,19 @@ | ||
#!/bin/bash | ||
|
||
image=$1 | ||
|
||
if [ -z "$image" ]; then | ||
echo "No image specified" | ||
exit 1 | ||
fi | ||
|
||
LOADER_OFFSET=${LOADER_OFFSET:-"64"} | ||
LOADER_IMAGE=${LOADER_IMAGE:-"idbloader.img"} | ||
UBOOT_IMAGE=${UBOOT_IMAGE:-"u-boot.itb"} | ||
UBOOT_OFFSET=${UBOOT_OFFSET:-"16384"} | ||
|
||
echo "Writing idbloader" | ||
dd conv=notrunc if=/pinebookpro/u-boot/usr/lib/u-boot/pinebook-pro-rk3399/${LOADER_IMAGE} of="$image" conv=fsync seek=${LOADER_OFFSET} | ||
echo "Writing u-boot image" | ||
dd conv=notrunc if=/pinebookpro/u-boot/usr/lib/u-boot/pinebook-pro-rk3399/${UBOOT_IMAGE} of="$image" conv=fsync seek=${UBOOT_OFFSET} | ||
sync $image |
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,22 @@ | ||
#!/bin/bash | ||
|
||
partprobe | ||
|
||
kpartx -va $DRIVE | ||
|
||
image=$1 | ||
|
||
if [ -z "$image" ]; then | ||
echo "No image specified" | ||
exit 1 | ||
fi | ||
|
||
set -ax | ||
TEMPDIR="$(mktemp -d)" | ||
echo $TEMPDIR | ||
mount "${device}p1" "${TEMPDIR}" | ||
|
||
# Copy all rpi files | ||
cp -rfv /rpi/* $TEMPDIR | ||
|
||
umount "${TEMPDIR}" |
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,20 @@ | ||
#!/bin/bash | ||
|
||
partprobe | ||
|
||
image=$1 | ||
|
||
if [ -z "$image" ]; then | ||
echo "No image specified" | ||
exit 1 | ||
fi | ||
|
||
set -ax | ||
TEMPDIR="$(mktemp -d)" | ||
echo $TEMPDIR | ||
mount "${device}p1" "${TEMPDIR}" | ||
|
||
# Copy all rpi files | ||
cp -rfv /rpi/* $TEMPDIR | ||
|
||
umount "${TEMPDIR}" |
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,17 @@ | ||
#!/bin/bash | ||
|
||
# Transform a raw image disk to azure vhd | ||
RAWIMAGE="$1" | ||
VHDDISK="${2:-disk.vhd}" | ||
cp -rf $RAWIMAGE $VHDDISK.work | ||
|
||
MB=$((1024*1024)) | ||
size=$(qemu-img info -f raw --output json "$RAWIMAGE" | gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1]}') | ||
# shellcheck disable=SC2004 | ||
ROUNDED_SIZE=$(((($size+$MB-1)/$MB)*$MB)) | ||
echo "Resizing raw image to $ROUNDED_SIZE" | ||
qemu-img resize -f raw "$VHDDISK.work" $ROUNDED_SIZE | ||
echo "Converting $RAWIMAGE to $VHDDISK" | ||
qemu-img convert -f raw -o subformat=fixed,force_size -O vpc "$VHDDISK.work" "$VHDDISK" | ||
echo "Done" | ||
rm -rf "$VHDDISK.work" |
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,27 @@ | ||
#!/bin/bash | ||
# Generates raw bootable images with qemu | ||
set -ex | ||
CLOUD_INIT=${1:-cloud_init.yaml} | ||
QEMU=${QEMU:-qemu-system-x86_64} | ||
ISO=${2:-iso.iso} | ||
|
||
mkdir -p build | ||
pushd build | ||
touch meta-data | ||
cp -rfv $CLOUD_INIT user-data | ||
|
||
mkisofs -output ci.iso -volid cidata -joliet -rock user-data meta-data | ||
truncate -s "+$((20000*1024*1024))" disk.raw | ||
|
||
${QEMU} -m 8096 -smp cores=2 \ | ||
-nographic -cpu host \ | ||
-serial mon:stdio \ | ||
-rtc base=utc,clock=rt \ | ||
-chardev socket,path=qga.sock,server,nowait,id=qga0 \ | ||
-device virtio-serial \ | ||
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ | ||
-drive if=virtio,media=disk,file=disk.raw \ | ||
-drive format=raw,media=cdrom,readonly=on,file=$ISO \ | ||
-drive format=raw,media=cdrom,readonly=on,file=ci.iso \ | ||
-boot d \ | ||
-enable-kvm |
Oops, something went wrong.