Maybe in 2024 we use nginx heavily to distribute some Debian packages or something like this. But unfortunately, today I found I have forgotsome configs about it. So let’s take it on here now.
/etc/nginx$ ls sites-enabled/
default file.conf repo.conf
cotent of file.conf is:
a@debian:/etc/nginx$ cat sites-enabled/file.conf
server {
listen 81;
listen [::]:81;
#server_name ;
location / {
root /home/a/files/ ;
autoindex on;
}
}
以 Debian 为根据地,围绕 Debian 打造自己的技术栈。
这是一个长期更新的清单,记录我所有 debian 打包的一些情况。
一共13个。see link
dch is a tool to generate new entry in debian/changelog
.
The option to be used as unstable
upload.
export DEBEMAIL=[email protected]
export DEBFULLNAME="xx"
你需要安装 dnsutils
包在 Debian 上。
dig
是用来查询 DNS 的命令。
dig Hostname
dig DomaiNameHere
dig @DNS-server-name Hostname
dig @DNS-server-name IPAddress
dig @DNS-server-name Hostname|IPAddress type
这里是一些具体的解释
dig ipv6.google.com
这个命令执行的是默认查询,通常是 A 记录查询,用于获取主机名对应的 IPv4 地址。如果主机名有对应的 IPv4 地址,dig 会返回该地址。
dig AAAA ipv6.google.com:
这个命令执行的是 AAAA 记录查询,用于获取主机名对应的 IPv6 地址。如果主机名有对应的 IPv6 地址,dig 会返回该地址。
源码目录: https://github.com/yuzibo/vf2-linux
使用 vf2 开头的分支,首先交叉编译出相应的 kernel riscv64 的 deb 包。 配置可以使用 debian_defconfig
或者你可以直接使用 prebuilt image
download from here
sudo debootstrap --arch=riscv64 unstable /tmp/riscv64-chroot http://mirrors.tuna.tsinghua.edu.cn/debian/
sudo systemd-nspawn -D /tmp/riscv64-chroot/ -M debian --bind-ro=/etc/resolv.conf
apt update
apt upgrade
apt-get install initramfs-tools openssh-server systemd-timesyncd rsync bash-completion u-boot-menu
4.0 安装 kernel
这里有2种方式安装 kernel, 一种是自己构建,一种是使用 prebuild 第一种方式可以参考这里,第二种方式可以参考这里. 下面以 prebuilt 方式进行讲解:
# 1 download prebuild kernel image from here:
# https://github.com/yuzibo/vf2-linux *-dev branch with tag published
# then copy into /tmp/riscv64-chroot
~: ls
linux-headers-6.6.7-vf2_2023.12.14.08.37+88bd30f68_riscv64.deb
linux-image-6.6.7-vf2_2023.12.14.08.37+88bd30f68_riscv64.deb
apt install -f ./*.deb
4.0.1 u-boot
接下来需要配置与启动最直接相关的 u-boot 了:
主要一个是 /etc/default/u-boot
,另一个是 uEnv.txt
. 引导设备最好在dd 时再操作。
cat <<EOF >> /etc/default/u-boot
U_BOOT_PARAMETERS="rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0"
EOF
$ cat /etc/default/u-boot // double check
sed -i -e 's|root=[^ ]*|root=/dev/mmcblk1p3|' /boot/extlinux/extlinux.conf
Then
mkdir -p /boot/efi
配置 uEvn.txt
cat <<EOF > /boot/uEnv.txt
fdtdir=/boot/dtbs
fdtfile=starfive/jh7110-starfive-visionfive-2-v1.2a.dtb
kernel_comp_addr_r=0xb0000000
kernel_comp_size=0x10000000
EOF
change dtb file following your vf2 boards
最后:
cat <<EOF > /etc/fstab
/dev/mmcblk1p2 /boot/efi vfat umask=0077 0 1
EOF
4.1 配置 网络接口
cat <<EOF >> /etc/network/interfaces
allow-hotplug end0
iface end0 inet dhcp
EOF
echo vf2 > /etc/hostname
passwd # for vf2
# add new user
root@debian:/# adduser debian
info: Adding user `debian' ...
info: Selecting UID/GID from range 1000 to 59999 ...
info: Adding new group `debian' (1000) ...
info: Adding new user `debian' (1000) with group `debian (1000)' ...
info: Creating home directory `/home/debian' ...
info: Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for debian
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
info: Adding new user `debian' to supplemental / extra groups `users' ...
info: Adding user `debian' to group `users' ...
# passwd for debian is `debian`
passwd debian
New password:
Retype new password:
passwd: password updated successfully
usermod -aG sudo debian
作为应聘 Debian/RevyOS 实习生的一个硬性条件,需要完成以下目标:
下载 Debian hello
源代码, 修改其中的 src/hello.c
文件,然后重新打包并安装、运行
vimer@dev:~$ hello -h
Usage: hello [OPTION]...
Print a friendly, customizable greeting.
-h, --help display this help and exit
-v, --version display version information and exit
-t, --traditional use traditional greeting
-g, --greeting=TEXT use TEXT as the greeting message
hello, revyos
其中
hello, revyos
不是必须的,可出现自定义的 string 的即可。参考资料:
http://www.aftermath.cn/2022/02/17/sbuild-build-riscv-on-debian/ https://github.com/yuzibo/talks/blob/main/debian/2022-08-17-debian-fix-ftbfs-riscv64.pptx
说明,基于时效性,以上参考资料中的 URL 中带有 *debian-ports/
可自动调整为 debian/
.