new kexec routine for testing added

This commit is contained in:
Tobias Powalowski 2022-05-18 07:41:35 +02:00
parent 4812f832b9
commit 35d3c30392
2 changed files with 21 additions and 1 deletions

View file

@ -65,7 +65,8 @@ if [[ "${_L_COMPLETE}" == "1" || "${_L_INSTALL_COMPLETE}" == "1" ]]; then
# unload virtio-net to avoid none functional network device on aarch64
grep -qw virtio_net /proc/modules && rmmod virtio_net
echo -e "\033[1mStep 9/9:\033[0m Loading files through kexec into kernel now ..."
kexec -s -f /"${VMLINUZ}" --initrd="/initrd.img" --reuse-cmdline
echo " This will need some time ..."
_kexec
fi
# Generate new images

View file

@ -141,6 +141,14 @@ _umount_w_dir() {
fi
}
_umount_usr() {
echo "Unmounting /usr.zram ..." > /dev/tty7
# umount all possible mountpoints
umount "/usr"
/usr.zram/bin/./umount /usr.zram
echo 1 > /sys/block/zram1/reset
}
_clean_archboot() {
# remove everything not necessary
rm -rf "/usr/lib/firmware"
@ -228,6 +236,17 @@ _create_initramfs() {
bsdtar --null -cf - --format=newc @- | zstd --rm -T0> /initrd.img
}
_kexec () {
kexec -s -f /"${VMLINUZ}" --initrd="/initrd.img" --reuse-cmdline &
sleep 2
rm /{${VMLINUZ},initrd.img}
_umount_usr
while true; do
sleep 1
done
}
_cleanup_install() {
rm -rf /usr/share/{man,info,doc,gtk-doc,ibus,perl5}
rm -rf /usr/include