Skip to content

tealinuxos/tea_partition_generator

 
 

Repository files navigation

Tea partition generator

this is a json auto generator & backend autopartitioning for tealinux installer, here what you should know

  • ./src/dual_boot_blockdev.rs contains various function and helper that will called after user click next on partitioning page (only for dualboot section).
  • ./src/single_boot_blockdev.rs same as dualboot, but this is will overwrite entire disk.
  • ./src/os.rs contains various helper functions
  • ./src/mkpart.rs a set of helper function that execute parted command & partition utility
  • ./src/mounting.rs helper that help you mount the partition, note: you must mount root first then /boot, not vice versa.
  • ./src/core.rs, is a helper function collection
  • ./src/parted_parser.rs, is a machine parted reader.
  • ./src/dual_boot_efi_mount.rs, this file find & locate original EFI partition inside your disk & mount it.

tunning

see config.rs

  • MINIMUM_DISK_SIZE: this is a minimum required disks for installer to be working correctly.

todo/fix

  • fixme: remove all dangerous unwrap() in future (help need)
  • todo: add custom partition install, example: user can select /dev/sda8 instead.
  • todo: remove autogenerated_mode
  • fixme: bug during installation, when some partition fs is unknown
  • add support for NVME

Notes

  • please uncomment this section, os-prober related. this section used as testing. link
  • ./bin directory is a testing folder, use sudo -E cargo run --bin <program_name>
  • if you searching about blueprint.rs struct signature conversion, the file is available here.

Test

here qemu test script & result

MBR/BIOS

qemu-system-x86_64 \
                      -enable-kvm \
                      -boot order=d \
                      -drive file=windows-tealinux-mbr.img,format=qcow2 \
                      -m 4G \
                      -enable-kvm \
                      -smp 4 \
                      -net user,hostfwd=tcp::20022-:22 \
                       -net nic

GPT/UEFI

qemu-system-x86_64 \
                      -enable-kvm \
                      -boot order=d \
                      -drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \
                      -drive if=pflash,format=raw,file=OVMF_VARS.4m.fd \
                      -drive file=tealinux.img,format=qcow2 \
                      -m 4G \
                      -enable-kvm \
                      -smp 4 \
                      -net user,hostfwd=tcp::20022-:22 \
                      -vga virtio

result

big fat notes: this result tested using QEMU emulator version 10.0.0, not in real hardware

date first_os secondary_os ptable/boot_mode type fs swap qemu_params note
25 may Windows 10 Tealinux mbr/bios dual ext4 no success, windows fastboot turned off
25 may Windows 10 Tealinux mbr/bios dual ext4 yes untested, no partition left for swap
25 may Windows 10 Tealinux mbr/bios dual btrfs no success, windows fastboot turned off
25 may Windows 10 Tealinux mbr/bios dual btrfs yes untested, no partition left for swap
30 may Windows 10 Tealinux gpt/uefi dual ext4 no -vga virtio tealinux failed (wayland issue), windows success, fastboot turned off
30 may Windows 10 Tealinux gpt/uefi dual ext4 no tealinux success, windows failed with abstract random line & fastboot turned off
31 may Windows 10 Tealinux gpt/uefi dual ext4 no GDK_BACKEND=x11 -vga virtio -display gtk tealinux failed (looping wayland error), windows success, fastboot turned off
31 may Windows 10 Tealinux gpt/uefi dual ext4 yes tealinux success with swap, windows failed with abstract random line & fastboot turned off
31 may Windows 10 Tealinux gpt/uefi dual ext4 yes -vga virtio tealinux failed, windows success, fastboot turned off
31 may Windows 10 Tealinux gpt/uefi dual btrfs no tealinux btrfs success, windows failed with abstract random line & fastboot turned off
31 may Windows 10 Tealinux gpt/uefi dual btrfs yes tealinux success with swap, windows failed with abstract random line & fastboot turned off
31 may Windows 10 Tealinux gpt/uefi dual btrfs yes -vga virtio tealinux failed, windows success, fastboot turned off
31 may Archlinux (by calamares) Tealinux mbr/bios dual ext4 no all green
31 may Archlinux (by calamares) Tealinux mbr/bios dual ext4 yes all green
31 may Archlinux (by calamares) Tealinux mbr/bios dual btrfs no all green
31 may Archlinux (by calamares) Tealinux mbr/bios dual btrfs yes all green
31 may Archlinux (by calamares) Tealinux gpt/uefi dual ext4 no all green
31 may Archlinux (by calamares) Tealinux gpt/uefi dual ext4 yes all green
31 may Archlinux (by calamares) Tealinux gpt/uefi dual btrfs no all green
31 may Archlinux (by calamares) Tealinux gpt/uefi dual btrfs yes all green
31 may Tealinux - mbr/bios single ext4 no all green
31 may Tealinux - mbr/bios single ext4 yes all green
31 may Tealinux - mbr/bios single btrfs no all green
31 may Tealinux - mbr/bios single ext4 yes all green
31 may Tealinux - gpt/uefi single ext4 no all green
31 may Tealinux - gpt/uefi single ext4 yes all green
31 may Tealinux - gpt/uefi single btrfs no all green
31 may Tealinux - gpt/uefi single ext4 yes all green

notes: sometimes we may remove older uefi vars in order to reset bootloader configuration, but this can be avoided by entering EFI shell, and remove the bootloader using bcfg boot dump and bcfg boot rm X

License

GPL 2.0

About

JSON config generator

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 99.7%
  • Shell 0.3%