Skip to content

Commit

Permalink
build(buster vm): +mipsbe
Browse files Browse the repository at this point in the history
  • Loading branch information
2moe committed Apr 9, 2024
1 parent 1d565e3 commit f841597
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 83 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/vm-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ env:
SSH_VM: "ssh -F ssh/vm.sshconf vm"
new_task: "tmux new-session -d"
#
# SID:
# RELEASE_TAG: unstable
# CODENAME: sid
# ROOTFS_REPO: "debian-sid:"
# [sid]
RELEASE_TAG: unstable
CODENAME: sid
ROOTFS_REPO: "debian-sid:"
#
# BOOKWORM:
RELEASE_TAG: 12
CODENAME: "bookworm"
ROOTFS_REPO: "debian:bookworm-"
# [bookworm]
# RELEASE_TAG: 12
# CODENAME: "bookworm"
# ROOTFS_REPO: "debian:bookworm-"
on:
# schedule:
# - cron: "0 11 28 */2 *"
Expand Down
76 changes: 46 additions & 30 deletions .github/workflows/vm-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ env:
DEB_ENV: "DEBIAN_FRONTEND=noninteractive"
DEV_DIR: assets/vm-minimal
SSH_VM: "ssh -F ssh/vm.sshconf vm"
FETCH: "aria2c -s5 -x5 -k1m --no-conf"
new_task: "tmux new-session -d"
#
# [sid]
# RELEASE_TAG: unstable
# CODENAME: sid
# ROOTFS_REPO: "debian-sid:"
#
RELEASE_TAG: unstable
CODENAME: sid
ROOTFS_REPO: "debian-sid:"

#
# [bookworm]
# RELEASE_TAG: 12
# CODENAME: "bookworm"
# ROOTFS_REPO: "debian:bookworm-"
#
# #
# [bullseye]
# RELEASE_TAG: 11
# CODENAME: "bullseye"
# ROOTFS_REPO: "debian:bullseye-"
#
#
# RELEASE_TAG: 10
# CODENAME: "buster"
# ROOTFS_REPO: "debian:buster-"
#
# [buster]
RELEASE_TAG: 10
CODENAME: "buster"
ROOTFS_REPO: "debian:buster-"
#
#
FETCH: "aria2c -s5 -x5 -k1m --no-conf"
new_task: "tmux new-session -d"
on:
push:
# branches: ["build"]
Expand All @@ -43,17 +42,17 @@ jobs:
matrix:
include:
# SID:
- arch: rv64gc
deb_arch: riscv64
qemu_pkg_arch: misc
tty: ttyS0
net: eth0
# - arch: rv64gc
# deb_arch: riscv64
# qemu_pkg_arch: misc
# tty: ttyS0
# net: eth0

- arch: loong64
deb_arch: loong64
qemu_pkg_arch: misc
tty: ttyS0
net: enp0s1
# - arch: loong64
# deb_arch: loong64
# qemu_pkg_arch: misc
# tty: ttyS0
# net: enp0s1
# # ------------------
- arch: arm64
deb_arch: arm64
Expand Down Expand Up @@ -99,11 +98,18 @@ jobs:
net: enp0s3
# ------------------------
# BOOKWORM
# - arch: mipsle
# deb_arch: mipsel
# qemu_pkg_arch: mips
# tty: ttyS0
# net: enp0s18
- arch: mipsle
deb_arch: mipsel
qemu_pkg_arch: mips
tty: ttyS0
net: enp0s18
# ------------------------
# BUSTER
- arch: mipsbe
deb_arch: mips
qemu_pkg_arch: mips
tty: ttyS0
net: enp0s18

runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -248,7 +254,14 @@ jobs:
sudo chmod 700 -v $i
}
sshd_cfg=ssh/vm.sshd.conf
sudo install -Dm600 $sshd_cfg rootfs/etc/ssh/sshd_config.d/vm.conf
case ${{env.CODENAME}} {
(buster|stretch|jessie|wheezy|squeeze|lenny|etch|sarge|woody|potato|slink|hamm)
cat $sshd_cfg | sudo tee -a rootfs/etc/ssh/sshd_config
;;
(*)
sudo install -Dm600 $sshd_cfg rootfs/etc/ssh/sshd_config.d/vm.conf
;;
}
unlink $sshd_cfg
sudo cp -v ${{env.DEV_DIR}}/systemd/* rootfs/etc/systemd/system/
Expand Down Expand Up @@ -393,7 +406,10 @@ jobs:
network_iface=${{matrix.net}}
tty_serial=${{matrix.tty}}
printf "%s\n" "auto $network_iface" "iface $network_iface inet dhcp" >/etc/network/interfaces.d/qemu-nat.conf
iface_dir=/etc/network/interfaces.d
printf "%s\n" "auto lo" "iface lo inet loopback" > $iface_dir/loopback
printf "%s\n" "auto $network_iface" "iface $network_iface inet dhcp" > $iface_dir/qemu-nat
cd $(mktemp -d)
printf "%s\n" 'nameserver 10.0.2.3' 'nameserver 1.1.1.1' > resolv.conf
install -m644 resolv.conf /etc/resolv.conf
Expand Down
98 changes: 53 additions & 45 deletions assets/vm-minimal/run
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,41 @@ integer ssh_port=9022
# See also: hostfwd_map
integer guest_ssh_port=9022

extra_qemu_args=(
# -vnc 127.0.0.1:1
#
# -device ramfb
#
# -cdrom cloud-image.iso
#
$*
)

name=debian-vm-minimal
qemu_arch=x64

# NO GUI
#
# It is designed for NO GUI, if you want to use GUI, then you need to set `no_graphic=false`, and add the related arguments manually.
# e.g., for arm64, you may need to add the ramfb device: extra_qemu_args+=( -device ramfb )
# For armv7a, you also need to enable efi.
no_graphic=true
# -------------------------
#
# DISK
#
# For virtio-blk: The 1st disk is vda, the 2nd is vdb, and the 3rd is vdc.
#
# For RAW format images, use the `.img` or `.raw` extension.
disk_arr=(
disk.img
#
# var.img
# 128GB-EXT4.img
# 1TB-BTRFS.raw
# 1PB-data.qcow2
# win-data-NTFS.vhdx
)
# -------------------------
#
# KVM & MACHINE
Expand Down Expand Up @@ -65,6 +98,8 @@ cpu_mips64le=Loongson-3A1000
# qemu-system-mipsel -cpu help
# 4KEc, 24Kc, 74Kf
cpu_mipsle=4KEc
#
cpu_mipsbe=""

# Symmetric multiprocessing (Multiple CPU cores)
smp=true
Expand Down Expand Up @@ -103,58 +138,14 @@ machine_mips64le=loongson3-virt
#
# qemu-system-mipsel -machine help
machine_mipsle=malta
machine_mipsbe=malta

extra_machine_options=(
# virtualization=on
#
)
# ----------------------
#
# CMD
#
qemu_cmd_x64=qemu-system-x86_64
qemu_cmd_x86=qemu-system-i386
qemu_cmd_arm64=qemu-system-aarch64
qemu_cmd_armv7a=qemu-system-arm
qemu_cmd_rv64gc=qemu-system-riscv64
qemu_cmd_loong64=qemu-system-loongarch64
qemu_cmd_mips64le=qemu-system-mips64el
qemu_cmd_mipsle=qemu-system-mipsel
qemu_cmd_ppc64le=qemu-system-ppc64
qemu_cmd_s390x=qemu-system-s390x

extra_qemu_args=(
# -vnc 127.0.0.1:1
#
# -device ramfb
#
$*
)

# NO GUI
#
# It is designed for NO GUI, if you want to use GUI, then you need to set `no_graphic=false`, and add the related arguments manually.
# e.g., for arm64, you may need to add the ramfb device: extra_qemu_args+=( -device ramfb )
# For armv7a, you also need to enable efi.
no_graphic=true
# --------------
#
# DISK
#
# For virtio-blk: The 1st disk is vda, the 2nd is vdb, and the 3rd is vdc.
#
# For RAW format images, use the `.img` or `.raw` extension.
disk_arr=(
disk.img
#
# var.img
# 128GB-EXT4.img
# 1TB-BTRFS.raw
# 1PB-data.qcow2
# win-data-NTFS.vhdx
)
# --------------
#
# EFI
#
# For arm64(aarch64) debian trixie (qemu 9.0-rc), efi/uboot must be enabled, otherwise the system will not boot.
Expand Down Expand Up @@ -186,6 +177,7 @@ kernel_command_line_armv7a="root=/dev/vda1 rw console=tty0 console=ttyAMA0 nokas
kernel_command_line_ppc64le="root=/dev/vda1 rw console=tty0 console=hvc0"
kernel_command_line_s390x="root=/dev/vda1 rw console=ttysclp0"
kernel_command_line_mipsle="root=/dev/vda1 rw console=tty0 console=ttyS0 nokaslr"
kernel_command_line_mipsbe=$kernel_command_line_mipsle
# --------------
#
# NETWORK
Expand Down Expand Up @@ -281,11 +273,27 @@ float memory_percentage=90.0
# It is not necessary to manually add Unit (Megabytes (MB)).
integer max_memory=0
integer max_memory_mipsle=2048
integer max_memory_mipsbe=2048
integer max_memory_armv7a=2816

# Note: power8 cpu (arch: ppc64le) must have an integer multiple of 256M.
auto_resize_mem_to_256_multiple=false
auto_resize_mem_to_256_multiple_ppc64le=true
# ----------------------
#
# CMD
#
qemu_cmd_x64=qemu-system-x86_64
qemu_cmd_x86=qemu-system-i386
qemu_cmd_arm64=qemu-system-aarch64
qemu_cmd_armv7a=qemu-system-arm
qemu_cmd_rv64gc=qemu-system-riscv64
qemu_cmd_loong64=qemu-system-loongarch64
qemu_cmd_mips64le=qemu-system-mips64el
qemu_cmd_mipsle=qemu-system-mipsel
qemu_cmd_mipsbe=qemu-system-mips
qemu_cmd_ppc64le=qemu-system-ppc64
qemu_cmd_s390x=qemu-system-s390x
# --------------
#
# VIRTIO FSD
Expand Down

0 comments on commit f841597

Please sign in to comment.