问题报告

This commit is contained in:
Wildlife 2020-08-12 11:44:27 +08:00
parent 25614ca27c
commit 54ff2d5075
3 changed files with 25 additions and 11 deletions

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -eu
# build_rootfs.sh is only for tn3399_v3 dev board
# see https://github.com/lanseyujie/tn3399_v3.git
@ -16,7 +16,6 @@ OUTPUT_PATH=$PROJECT_PATH/out
OVERLAY_PATH=$PROJECT_PATH/overlay
ROOTFS_PATH=$OUTPUT_PATH/rootfs
UBUNTU_VERSION=20.04
TARGET=$1
mount_rootfs() {
@ -29,15 +28,18 @@ mount_rootfs() {
}
umount_rootfs() {
umount "$ROOTFS_PATH"/proc
umount "$ROOTFS_PATH"/sys
umount "$ROOTFS_PATH"/dev/pts
umount "$ROOTFS_PATH"/dev
umount "$ROOTFS_PATH"/sys
umount "$ROOTFS_PATH"/proc
echo "ROOTFS: UNMOUNTED"
}
custom_rootfs() {
rm -rf "$ROOTFS_PATH"
mkdir -p "$ROOTFS_PATH"
# 安装构建工具
apt install -y qemu-user-static debootstrap
# 构建 rootfs
@ -63,9 +65,6 @@ custom_rootfs() {
# 卸载路径
umount_rootfs
# 清理工作
rm -f "$ROOTFS_PATH"/usr/bin/qemu-aarch64-static
echo "ROOTFS: BUILD SUCCEED"
}

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -eu
# custom_rootfs.sh is only for tn3399_v3 dev board
# see https://github.com/lanseyujie/tn3399_v3.git
@ -12,7 +12,7 @@ if [ "$(id -u)" -ne 0 ]; then
fi
# 继续构建第二阶段
debootstrap/debootstrap --second-stage
/debootstrap/debootstrap --second-stage
# 修改主机名
echo ubuntu >/etc/hostname
@ -48,7 +48,22 @@ chage -d 0 root
# ttyS2
ln -s /lib/systemd/system/serial-getty\@.service /etc/systemd/system/getty.target.wants/serial-getty@ttyS2.service
# 清理缓存
# 问题报告
cat >/etc/update-motd.d/60-issue-report<<EOF
#!/bin/sh
#
# 60-issue-report is only for tn3399_v3 dev board
# see https://github.com/lanseyujie/tn3399_v3.git
# Wildlife <admin@lanseyujie.com>
# 2020.08.12
printf "\n"
printf " * Issue: https://github.com/lanseyujie/tn3399_v3/issues"
EOF
chmod +x /etc/update-motd.d/60-issue-report
# 清理
apt clean
rm -rf /var/lib/apt/lists/*
rm -f ~/.bash_history
rm -f /usr/bin/qemu-aarch64-static

View File

@ -1,5 +1,5 @@
#!/bin/bash
set -e
set -eu
# factory_image.sh is only for tn3399_v3 dev board
# see https://github.com/lanseyujie/tn3399_v3.git