Skip to content

Commit

Permalink
chore: default build revyos image
Browse files Browse the repository at this point in the history
Signed-off-by: Han Gao <[email protected]>
  • Loading branch information
RevySR committed Feb 28, 2024
1 parent df57679 commit 3325b96
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ARCH=${ARCH:-riscv}
CROSS_COMPILE=${CROSS_COMPILE:-riscv64-unknown-linux-gnu-}
TIMESTAMP=${TIMESTAMP:-$(date +%Y%m%d-%H%M%S)}

DEB_REPO='deb https://mirror.iscas.ac.cn/debian/ sid main contrib non-free non-free-firmware'
DISTRO=${DISTRO:-revyos} # revyos or debian
CHROOT_TARGET=${CHROOT_TARGET:-target}
ROOTFS_IMAGE_SIZE=2G
ROOTFS_IMAGE_FILE="k230_root.ext4"
Expand Down Expand Up @@ -81,10 +81,20 @@ function build_rootfs() {

mount ${OUTPUT_DIR}/${ROOTFS_IMAGE_FILE} ${CHROOT_TARGET}

mmdebstrap --architectures=riscv64 \
if [[ $DISTRO == "revyos" ]]; then
mmdebstrap --architectures=riscv64 \
--include="ca-certificates locales dosfstools bash iperf3 revyos-keyring \
sudo bash-completion network-manager openssh-server systemd-timesyncd cloud-utils" \
sid "$CHROOT_TARGET" \
"deb https://mirror.iscas.ac.cn/revyos/revyos-addons/ revyos-addons main" \
"deb https://mirror.iscas.ac.cn/revyos/revyos-base/ sid main contrib non-free non-free-firmware"
else
mmdebstrap --architectures=riscv64 \
--include="ca-certificates locales dosfstools bash iperf3 \
sudo bash-completion network-manager openssh-server systemd-timesyncd cloud-utils" \
sid "$CHROOT_TARGET" "${DEB_REPO}"
sid "$CHROOT_TARGET" \
"deb https://deb.debian.org/debian/ sid main contrib non-free non-free-firmware"
fi

chroot $CHROOT_TARGET /bin/bash <<EOF
# apt update
Expand All @@ -95,8 +105,8 @@ useradd -m -s /bin/bash -G adm,sudo debian
echo 'debian:debian' | chpasswd
# Change hostname
echo revyos-${BOARD} > /etc/hostname
echo 127.0.1.1 revyos-${BOARD} >> /etc/hosts
echo ${DISTRO}-${BOARD} > /etc/hostname
echo 127.0.1.1 ${DISTRO}-${BOARD} >> /etc/hosts
# Disable iperf3
systemctl disable iperf3
Expand Down

0 comments on commit 3325b96

Please sign in to comment.