44 lines
1.7 KiB
Bash
44 lines
1.7 KiB
Bash
#/sbin/bin
|
|
local-install libpam0g bash_5 passwd_4 grub-installer arch-install grub efi di-utils-mapdevfs partman-utils
|
|
local-install dpkg mawk
|
|
depmod
|
|
|
|
. /root/miniconda3/etc/profile.d/conda.sh
|
|
conda activate
|
|
|
|
modprobe efivarfs
|
|
sh -c "xz -d -c /mnt/images/rootfs.acosail2-RC2-Base-0221-runtime.txz | tar -x -C /target/"
|
|
genfstab -pU /target/ > /target/etc/fstab
|
|
mkdir -p /target/run
|
|
mkdir -p /target/proc
|
|
mkdir -p /target/sys
|
|
mkdir -p /target/dev
|
|
mkdir -p /target/dev
|
|
mkdir -p /target/media
|
|
mount -t tmpfs none /target/run
|
|
mount -t proc proc /target/proc
|
|
mount -t sysfs sys /target/sys
|
|
mount -o bind /dev /target/dev
|
|
mount -o bind /mnt /target/media
|
|
echo "====>>>>dpkg install liba lvm2 cryptsetup..."
|
|
chroot /target bash -c "dpkg -i /media/pool/main/liba/libaio/*.deb"
|
|
chroot /target bash -c "dpkg -i /media/pool/main/l/lvm2/*.deb"
|
|
chroot /target bash -c "dpkg -i /media/pool/main/c/cryptsetup/*.deb"
|
|
mkdir -p /target/tmp
|
|
echo "====>>>>cp /mnt/pool/other/kernel /target/tmp..."
|
|
cp -ar /mnt/pool/other/kernel /target/tmp
|
|
chroot /target bash -c "dpkg -i /tmp/kernel/linux-*.deb"
|
|
chroot /target bash -c "dpkg -i /tmp/kernel/mwv207-*.deb"
|
|
chroot /target bash -c 'depmod `ls /lib/modules | tail -n 1`'
|
|
echo "====>>>>depmod kernel modules ..."
|
|
rm -fr /target/tmp/kernel
|
|
mount -t efivarfs none /target/sys/firmware/efi/efivars/
|
|
mount -t efivarfs none /sys/firmware/efi/efivars/
|
|
echo "====>>>>grub-install"
|
|
chroot /target bash -c "grub-install"
|
|
echo """deb http://mirrors.huaweicloud.com/debian/ bullseye main
|
|
deb-src http://mirrors.huaweicloud.com/debian/ bullseye main
|
|
""" >/target/etc/apt/sources.list
|
|
echo "====>>>>grub-mkconfig"
|
|
chroot /target bash -c "grub-mkconfig >> /boot/grub/grub.cfg"
|
|
echo "====>>>>succeed,you can reboot system!" |