some initial work
This commit is contained in:
parent
08c84c0c75
commit
c429549a61
18
pikainstall/usr/bin/pikainstall
Executable file
18
pikainstall/usr/bin/pikainstall
Executable 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)
|
20
pikainstall/usr/lib/pika/pikainstall/partition-helper.sh
Executable file
20
pikainstall/usr/lib/pika/pikainstall/partition-helper.sh
Executable 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
|
||||
|
Loading…
Reference in New Issue
Block a user