From ddfdb40cdd8bb8624c1f7d3eddc5fc508577d38c Mon Sep 17 00:00:00 2001 From: le Date: Tue, 14 Mar 2023 20:00:17 +0800 Subject: [PATCH] install scripts and debuger env. --- .gitignore | 5 +++-- activate_conda.sh | 4 ++++ copy_source_archinstall.sh | 2 ++ debug_install_net.sh | 10 +++++++++ manual_install_nouefi.sh | 44 ++++++++++++++++++++++++++++++++++++++ manual_install_uefi.sh | 44 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 activate_conda.sh create mode 100644 copy_source_archinstall.sh create mode 100644 debug_install_net.sh create mode 100644 manual_install_nouefi.sh create mode 100644 manual_install_uefi.sh diff --git a/.gitignore b/.gitignore index e764c7f..65385b6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ SAFETY_LOCK **/**build **/**dist **/**.egg* -**/**.sh !archinstall/locales/locales_generator.sh **/**.egg-info/ **/**build/ @@ -33,4 +32,6 @@ venv **/cmd_history.txt **/*.*~ /*.sig -*.pyc \ No newline at end of file +*.pyc +.lh/* +.histroy/* \ No newline at end of file diff --git a/activate_conda.sh b/activate_conda.sh new file mode 100644 index 0000000..d6b5be4 --- /dev/null +++ b/activate_conda.sh @@ -0,0 +1,4 @@ +#/sbin/bin +. /root/miniconda3/etc/profile.d/conda.sh +conda activate +cd /archinstall && python archinstall diff --git a/copy_source_archinstall.sh b/copy_source_archinstall.sh new file mode 100644 index 0000000..3fcbcbe --- /dev/null +++ b/copy_source_archinstall.sh @@ -0,0 +1,2 @@ +#/sbin/bin +scp -r ubuntu@10.10.20.149:/data/project/os-installer/archinstall / \ No newline at end of file diff --git a/debug_install_net.sh b/debug_install_net.sh new file mode 100644 index 0000000..0cade9a --- /dev/null +++ b/debug_install_net.sh @@ -0,0 +1,10 @@ +#/sbin/bin + +local-install nic +local-install vim.tiny +hw-detect +local-install ssh + +ip link set $1 up +ip addr add $2 dev $1 +ip route add default via $3 dev $1 diff --git a/manual_install_nouefi.sh b/manual_install_nouefi.sh new file mode 100644 index 0000000..25a866b --- /dev/null +++ b/manual_install_nouefi.sh @@ -0,0 +1,44 @@ +#/sbin/bin +local-install libpam0g bash_5 passwd_4 grub-installer arch-install grub efi di-utils-mapdevfs partman-utils +local-install dpkg mawk +local-install vim.tiny +depmod + +. /root/miniconda3/etc/profile.d/conda.sh +conda activate + +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 +bash -c "cp -a /mnt/pool/other/grub-pc*.deb /target/tmp" +chroot /target bash -c "dpkg -i /tmp/grub-pc*.deb" +echo "====>>>>grub-install $1" +chroot /target bash -c "grub-install $1" +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!" \ No newline at end of file diff --git a/manual_install_uefi.sh b/manual_install_uefi.sh new file mode 100644 index 0000000..504e333 --- /dev/null +++ b/manual_install_uefi.sh @@ -0,0 +1,44 @@ +#/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!" \ No newline at end of file