(First)Arm64 安装 archlinuxarm记录。(备忘)

arch-arm-install (2021-06-22)

安装前准备

1 u盘分成两个分区(gpt)

  • boot
  • root ##挂载 挂载主分区到 /mnt,建立 /mnt/boot,挂载引导分区到 /mnt/boot
MOUNTPOINT=/mnt
mount /dev/xxx2 $MOUNTPOINT # 需要 Root
mkdir -v $MOUNTPOINT/boot # 需要 Root
mount /dev/xxx1 $MOUNTPOINT/boot # 需要 Root

2 安装

`bsdtar -xpf /path/to/your/ArchLinuxARM-aarch64-latest.tar.gz -C $MOUNTPOINT # 需要 Root`

注意

boot/Image 是 EFISTUB 内核。可以考虑把它复制到 boot/EFI/boot/bootaa64.efi,这样就无需手动设置引导项了,因为这是 UEFI Spec 中指定的缺省值。

sudo mount /dev/sdXXX /mnt
sudo mount /dev/sdXX /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
cp Image vmlinuz-linux
sudo grub-install --target=arm64-efi --boot-directory=/media/lvrui/archboot --efi-directory=/media/lvrui/archboot --removable
grub-install /dev/sdX
sudo cp Image vmlinuz-linux
sudo grub-mkconfig -o /media/lvrui/archboot/grub/grub.cfg
grub-mkconfig -o /boot/grub/grub.cfg

reboot

cp kernel modules/kernel src/headers
grub-mkconfig -o /boot/grub/grub.cfg

configure

cat << EOF > /
mkdir -p /etc/pacman.d/hooks/
cat > 90-linux-kernel-rename.hook << EOF
[Trigger]
Type = File
Operation = Install
Operation = Upgrade
Type = Path
Target = boot/Image
Target = boot/Image.gz

[Action]
When = PostTransaction
Exec = /usr/bin/sh -c "/usr/bin/mv /boot/Image /boot/vmlinuz-linux"
EOF
sudo systemctl enable dhcpcd
sudo systemctl start dhcpcd
####  evbug: Event. Dev: input2, Type: 1, Code: 28, Value: 1
# jeremy@sj51-ubuntu:~$ tail -n2 /etc/modprobe.d/blacklist.conf
#### evbug
### blacklist evbug
#################
$ sudo pacman -S ttf-sarasa-gothic
$ cat > ~/.fonts.conf << EOF
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <dir>~/.fonts</dir>    
  <alias>
    <family>sans-serif</family>
    <prefer>
      <family>Sarasa Gothic SC</family>
      <family>Sarasa Gothic TC</family>
      <family>Sarasa Gothic J</family>
      <family>Sarasa Gothic K</family>
    </prefer>
  </alias>
  <alias>
    <family>monospace</family>
    <prefer>
      <family>Sarasa Mono SC</family>
      <family>Sarasa Mono TC</family>
      <family>Sarasa Mono J</family>
      <family>Sarasa Mono K</family>
    </prefer>
  </alias>
</fontconfig>
EOF
###################3

kernel make menuconfig

vim /etc/makepkg.conf 
sudo pacman -S docbook-xsl  kmod vim vom inetutiles nc bc vboot-utils dtc coreutils mkinitcpio
makepkg -s

ignor packages update

vim /etc/pacman.config

/etc/pacman.conf中的archlinuxcn时

SigLevel = Optional TrustAll

3 中文字符显示乱码的问题

终端下输入export LANG="zh_CN.UTF-8" ,就可以显示正常

更改/etc/locale.conf中的字符系

4 打印机出故障了,

sudo pacman -S  ghostscript 
chmod 755 /opt/printer/HanGuang/main/filter/PS/Filters/HanGuangPS
查看/var/log/cups日志

5 好看的图表

sudo pacman -S papirus-icon-theme

6 安装wps yay 自己pkgbuild的

7 打印机安装

使用的是ipp协议,转socket,自己测试。永中office 会出现空白页面,打印两次,wps libreoffice正常

8 bash中ps1显示折叠的目录设置

cat > .bashrc << EOF
function _fish_collapsed_pwd() {
    local pwd="$1"
    local home="$HOME"
    local size=${#home}
    [[ $# == 0 ]] && pwd="$PWD"
    [[ -z "$pwd" ]] && return
    if [[ "$pwd" == "/" ]]; then
        echo "/"
        return
    elif [[ "$pwd" == "$home" ]]; then
        echo "~"
        return
    fi
    [[ "$pwd" == "$home/"* ]] && pwd="~${pwd:$size}"
    if [[ -n "$BASH_VERSION" ]]; then
        local IFS="/"
        local elements=($pwd)
        local length=${#elements[@]}
        for ((i=0;i<length-1;i++)); do
            local elem=${elements[$i]}
            if [[ ${#elem} -gt 1 ]]; then
                elements[$i]=${elem:0:1}
            fi
        done
    else
        local elements=("${(s:/:)pwd}")
        local length=${#elements}
        for i in {1..$((length-1))}; do
            local elem=${elements[$i]}
            if [[ ${#elem} > 1 ]]; then
                elements[$i]=${elem[1]}
            fi
        done
    fi
    local IFS="/"
    echo "${elements[*]}"
}
if [ -n "$BASH_VERSION" ]; then
    if [ "$UID" -eq 0 ]; then
#        export PS1='\u@\h \[\e[31m\]$(_fish_collapsed_pwd)\[\e[0m\]# '
        export PS1='\u@ \[\e[31m\]$(_fish_collapsed_pwd)\[\e[0m\] # '
    else
#        export PS1='\u@\h \[\e[32m\]$(_fish_collapsed_pwd)\[\e[0m\]> '
        export PS1='\u@ \[\e[32m\]$(_fish_collapsed_pwd)\[\e[0m\]-> '
    fi
else
    if [ $UID -eq 0 ]; then
        export PROMPT='%f%n@%m %F{1}$(_fish_collapsed_pwd)%f# '
    else
        export PROMPT='%f%n@%m %F{2}$(_fish_collapsed_pwd)%f> '
    fi
fi
EOF

9 屏幕截图

# pacman -S scrot
# (scrot -bs   b带边框 s代表区域  或者 scrot -s **.png)

10 设置静态ip

$ systemctl stop dhcpcd
$ systemctl disable dhcpcd
$ cat >  /etc/systemd/network/20-wired.network << EOF
[Match]
Name=enp125s0f1
[Network]
Address=192.168.3.88/24
Gateway=192.168.3.1
DNS=114.114.114.114
#DNS=8.8.8.8

11 解压zip乱码

$ yay kde-servicemenus-unarchiver

12 文件对比

$ yay kompare (不能改文本)
$ yay meld
@lhy
加入
更多来自 angel