some initial work

This commit is contained in:
Ward from fusion-voyager-3 2023-10-20 12:04:25 +03:00
parent 08c84c0c75
commit c429549a61
2 changed files with 38 additions and 0 deletions

18
pikainstall/usr/bin/pikainstall Executable file
View File

@ -0,0 +1,18 @@
#! /bin/python3
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--root", help="The Path where root is mounted to.", metavar="/mnt/root", default=argparse.SUPPRESS, required=True, nargs=1)
parser.add_argument("-b", "--boot", help="The Path where boot is mounted to.", metavar="/mnt/root/boot", default=argparse.SUPPRESS, required=True, nargs=1)
parser.add_argument("-e", "--efi", help="The Path where EFI is mounted to.", metavar="/mnt/root/boot/efi", default=argparse.SUPPRESS, required=True, nargs=1)
parser.add_argument("-H", "--home", help="The Path where home is mounted to.", metavar="/mnt/root/home", default=None, nargs=1)
args = parser.parse_args()
# Print all command-line arguments.
print("Parsed arguments: {}".format(args))
print(r)
if args.home is not None:
print("good")
exit(1)

View File

@ -0,0 +1,20 @@
#! /bin/bash
if [[ -z $2 ]]
then
echo "no mount point specified" && exit 1
fi
if [[ "$1" == "part" ]]
then
df -P -h -T "$2" | awk 'END{print $1}'
elif [[ "$1" == "block" ]]
then
echo "/dev/$(lsblk -ndo pkname $(df -P "$2" | awk 'END{print $1}'))"
elif [[ "$1" == "uuid" ]]
then
blkid "$(df -P -h -T "$2" | awk 'END{print $1}')" -s UUID -o value
else
echo "invalid first args not in: part, block, uuid" && exit 1
fi