Merge branch 'master' into net-deploy
This commit is contained in:
commit
0fbebe6207
|
|
@ -5,7 +5,7 @@ Just a bare bone automated [Arch](https://wiki.archlinux.org/index.php/Arch_Linu
|
||||||
|
|
||||||
# cd ~/archlive
|
# cd ~/archlive
|
||||||
# echo -e "git\npython-psutil" >> packages.both
|
# echo -e "git\npython-psutil" >> packages.both
|
||||||
# echo "git clone -b net-deploy --single-branch https://github.com/Torxed/archinstall.git" >> ./airootfs/root/customize_airootfs.sh
|
# echo "git clone https://github.com/Torxed/archinstall.git" >> ./airootfs/root/customize_airootfs.sh
|
||||||
# echo "chmod +x ~/archinstall/archinstall.py" >> ./airootfs/root/customize_airootfs.sh
|
# echo "chmod +x ~/archinstall/archinstall.py" >> ./airootfs/root/customize_airootfs.sh
|
||||||
# mkdir ./airootfs/etc/skel
|
# mkdir ./airootfs/etc/skel
|
||||||
# echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && sh -c ~/archinstall/archinstall.py' >> ./airootfs/etc/skel/.zprofile
|
# echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && sh -c ~/archinstall/archinstall.py' >> ./airootfs/etc/skel/.zprofile
|
||||||
|
|
@ -19,7 +19,7 @@ Whenever this live-cd boots, from here on now - it'll run `archinstall.py`.
|
||||||
|
|
||||||
# Manually run it on a booted Live CD
|
# Manually run it on a booted Live CD
|
||||||
|
|
||||||
# git clone -b net-deploy --single-branch https://github.com/Torxed/archinstall.git
|
# git clone https://github.com/Torxed/archinstall.git
|
||||||
# python3 ./archinstall/archinstall.py
|
# python3 ./archinstall/archinstall.py
|
||||||
|
|
||||||
# Rerunning a installation
|
# Rerunning a installation
|
||||||
|
|
|
||||||
|
|
@ -85,9 +85,10 @@ def update_git():
|
||||||
|
|
||||||
def device_state(name):
|
def device_state(name):
|
||||||
# Based out of: https://askubuntu.com/questions/528690/how-to-get-list-of-all-non-removable-disk-device-names-ssd-hdd-and-sata-ide-onl/528709#528709
|
# Based out of: https://askubuntu.com/questions/528690/how-to-get-list-of-all-non-removable-disk-device-names-ssd-hdd-and-sata-ide-onl/528709#528709
|
||||||
with open('/sys/block/{}/device/block/{}/removable'.format(name, name)) as f:
|
if os.path.isfile('/sys/block/{}/device/block/{}/removable'.format(name, name)):
|
||||||
if f.read(1) == '1':
|
with open('/sys/block/{}/device/block/{}/removable'.format(name, name)) as f:
|
||||||
return
|
if f.read(1) == '1':
|
||||||
|
return
|
||||||
|
|
||||||
path = rootdir_pattern.sub('', os.readlink('/sys/block/{}'.format(name)))
|
path = rootdir_pattern.sub('', os.readlink('/sys/block/{}'.format(name)))
|
||||||
hotplug_buses = ("usb", "ieee1394", "mmc", "pcmcia", "firewire")
|
hotplug_buses = ("usb", "ieee1394", "mmc", "pcmcia", "firewire")
|
||||||
|
|
@ -100,20 +101,15 @@ def device_state(name):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def grab_partitions(dev):
|
def grab_partitions(dev):
|
||||||
o = run('parted -m -s {} p'.format(dev)).decode('UTF-8')
|
drive_name = os.path.basename(dev)
|
||||||
parts = oDict()
|
parts = oDict()
|
||||||
for line in o.split('\n'):
|
o = run('lsblk -o name -J -b {dev}'.format(dev=dev))
|
||||||
if ':' in line:
|
r = json.loads(o)
|
||||||
data = line.split(':')
|
for part in r['blockdevices'][0]['children']:
|
||||||
if data[0].isdigit():
|
parts[part['name'][len(drive_name):]] = {
|
||||||
parts[int(data[0])] = {
|
# TODO: Grab partition info and store here?
|
||||||
'start' : data[1],
|
}
|
||||||
'end' : data[2],
|
|
||||||
'size' : data[3],
|
|
||||||
'sum' : data[4],
|
|
||||||
'label' : data[5],
|
|
||||||
'options' : data[6]
|
|
||||||
}
|
|
||||||
return parts
|
return parts
|
||||||
|
|
||||||
def update_drive_list():
|
def update_drive_list():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue