cleanup commit
This commit is contained in:
parent
5defa8b4a6
commit
342af012f1
3
.gitignore
vendored
3
.gitignore
vendored
@ -12,3 +12,6 @@ build/
|
|||||||
|
|
||||||
# generated ssh keys
|
# generated ssh keys
|
||||||
keys/*
|
keys/*
|
||||||
|
|
||||||
|
# boostrap packages
|
||||||
|
/*-stage4/
|
||||||
|
27
boot.sh
27
boot.sh
@ -112,6 +112,17 @@ qemu_setargs_riscv64() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemu_setargs_ppc64() {
|
||||||
|
qemu_args+=(
|
||||||
|
-machine pseries
|
||||||
|
-m 2G
|
||||||
|
-kernel "$1"/vmlinuz-linux-libre
|
||||||
|
-initrd "$1"/initramfs-linux-libre.img
|
||||||
|
-append "console=ttyS0 rw root=/dev/sda3"
|
||||||
|
-drive file="$2"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
qemu_setargs_i386() {
|
qemu_setargs_i386() {
|
||||||
qemu_setargs_x86_64 "$@"
|
qemu_setargs_x86_64 "$@"
|
||||||
}
|
}
|
||||||
@ -141,15 +152,17 @@ boot_from_image() {
|
|||||||
check_kernel_arch "$TOPBUILDDIR"/mnt || return
|
check_kernel_arch "$TOPBUILDDIR"/mnt || return
|
||||||
|
|
||||||
case "$machine" in
|
case "$machine" in
|
||||||
RISC-V) arch=riscv64 ;;
|
RISC-V) arch=riscv64 ;;
|
||||||
ARM) arch=arm ;;
|
PowerPC64) arch=ppc64 ;;
|
||||||
i386) arch=i386 ;;
|
ARM) arch=arm ;;
|
||||||
i386:*) arch=x86_64 ;;
|
i386) arch=i386 ;;
|
||||||
*) error "unrecognized machine '$machine'"
|
i386:*) arch=x86_64 ;;
|
||||||
return "$ERROR_UNSPECIFIED" ;;
|
*) error "unrecognized machine '$machine'"
|
||||||
|
return "$ERROR_UNSPECIFIED" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
qemu_args=(-snapshot -nographic)
|
#qemu_args=(-snapshot -nographic)
|
||||||
|
qemu_args=(-nographic)
|
||||||
"qemu_setargs_$arch" "$TOPBUILDDIR"/mnt "$1" "$loopdev"
|
"qemu_setargs_$arch" "$TOPBUILDDIR"/mnt "$1" "$loopdev"
|
||||||
qemu_arch_is_foreign "$arch" || qemu_args+=(-enable-kvm)
|
qemu_arch_is_foreign "$arch" || qemu_args+=(-enable-kvm)
|
||||||
QEMU_AUDIO_DRV=none "qemu-system-$arch" "${qemu_args[@]}"
|
QEMU_AUDIO_DRV=none "qemu-system-$arch" "${qemu_args[@]}"
|
||||||
|
14
src/qemu.sh
14
src/qemu.sh
@ -43,6 +43,10 @@ qemu_img_partition_and_mount_for_riscv64() {
|
|||||||
qemu_img_partition_and_mount_for_x86_64 "$@"
|
qemu_img_partition_and_mount_for_x86_64 "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemu_img_partition_and_mount_for_powerpc64le() {
|
||||||
|
qemu_img_partition_and_mount_for_x86_64 "$@"
|
||||||
|
}
|
||||||
|
|
||||||
qemu_img_partition_and_mount_for_i686() {
|
qemu_img_partition_and_mount_for_i686() {
|
||||||
qemu_img_partition_and_mount_for_x86_64 "$@"
|
qemu_img_partition_and_mount_for_x86_64 "$@"
|
||||||
}
|
}
|
||||||
@ -72,6 +76,7 @@ qemu_img_losetup() {
|
|||||||
echo -n "checking for free loop device ... "
|
echo -n "checking for free loop device ... "
|
||||||
loopdev=$(losetup -f --show "$1") || loopdev=no
|
loopdev=$(losetup -f --show "$1") || loopdev=no
|
||||||
echo "$loopdev"
|
echo "$loopdev"
|
||||||
|
partprobe "$loopdev"
|
||||||
|
|
||||||
[ "x$loopdev" == "xno" ] && return "$ERROR_MISSING"
|
[ "x$loopdev" == "xno" ] && return "$ERROR_MISSING"
|
||||||
|
|
||||||
@ -101,8 +106,9 @@ qemu_arch_is_foreign() {
|
|||||||
qemu_setup_user_static() {
|
qemu_setup_user_static() {
|
||||||
local interpreter
|
local interpreter
|
||||||
case "$ARCH" in
|
case "$ARCH" in
|
||||||
armv7h) interpreter=/usr/bin/qemu-arm- ;;
|
armv7h) interpreter=/usr/bin/qemu-arm- ;;
|
||||||
*) interpreter=/usr/bin/qemu-"$ARCH"- ;;
|
powerpc64le) interpreter=/usr/bin/qemu-ppc64le- ;;
|
||||||
|
*) interpreter=/usr/bin/qemu-"$ARCH"- ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if qemu_arch_is_foreign "$ARCH"; then
|
if qemu_arch_is_foreign "$ARCH"; then
|
||||||
@ -136,6 +142,10 @@ qemu_img_finalize_for_riscv64() {
|
|||||||
-O "$1"/boot/bbl
|
-O "$1"/boot/bbl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qemu_img_finalize_for_powerpc64le() {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
qemu_img_finalize_for_i686() {
|
qemu_img_finalize_for_i686() {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user