mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
rename parameter
This commit is contained in:
parent
b6d8c7e8f2
commit
933dfa181b
2 changed files with 22 additions and 22 deletions
|
@ -9,7 +9,7 @@ ROOTFS=""
|
|||
INITRAMFS="initramfs-${_KERNELPKG}.img"
|
||||
|
||||
getrootfstype() {
|
||||
ROOTFS="$(getfstype "${PART_ROOT}")"
|
||||
ROOTFS="$(getfstype "${_PART_ROOT}")"
|
||||
}
|
||||
|
||||
getrootflags() {
|
||||
|
@ -31,49 +31,49 @@ getraidarrays() {
|
|||
|
||||
getcryptsetup() {
|
||||
CRYPTSETUP=""
|
||||
if ! cryptsetup status "$(basename "${PART_ROOT}")" | grep -q inactive; then
|
||||
if ! cryptsetup status "$(basename "${_PART_ROOT}")" | grep -q inactive; then
|
||||
#avoid clash with dmraid here
|
||||
if cryptsetup status "$(basename "${PART_ROOT}")"; then
|
||||
if cryptsetup status "$(basename "${_PART_ROOT}")"; then
|
||||
if [[ "${NAME_SCHEME_PARAMETER}" == "FSUUID" ]]; then
|
||||
CRYPTDEVICE="UUID=$(${_LSBLK} UUID "$(cryptsetup status "$(basename "${PART_ROOT}")" | grep device: | sed -e 's#device:##g')")"
|
||||
CRYPTDEVICE="UUID=$(${_LSBLK} UUID "$(cryptsetup status "$(basename "${_PART_ROOT}")" | grep device: | sed -e 's#device:##g')")"
|
||||
elif [[ "${NAME_SCHEME_PARAMETER}" == "FSLABEL" ]]; then
|
||||
CRYPTDEVICE="LABEL=$(${_LSBLK} LABEL "$(cryptsetup status "$(basename "${PART_ROOT}")" | grep device: | sed -e 's#device:##g')")"
|
||||
CRYPTDEVICE="LABEL=$(${_LSBLK} LABEL "$(cryptsetup status "$(basename "${_PART_ROOT}")" | grep device: | sed -e 's#device:##g')")"
|
||||
else
|
||||
CRYPTDEVICE="$(cryptsetup status "$(basename "${PART_ROOT}")" | grep device: | sed -e 's#device:##g'))"
|
||||
CRYPTDEVICE="$(cryptsetup status "$(basename "${_PART_ROOT}")" | grep device: | sed -e 's#device:##g'))"
|
||||
fi
|
||||
CRYPTNAME="$(basename "${PART_ROOT}")"
|
||||
CRYPTNAME="$(basename "${_PART_ROOT}")"
|
||||
CRYPTSETUP="cryptdevice=${CRYPTDEVICE}:${CRYPTNAME}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
getrootpartuuid() {
|
||||
_rootpart="${PART_ROOT}"
|
||||
_partuuid="$(getpartuuid "${PART_ROOT}")"
|
||||
_rootpart="${_PART_ROOT}"
|
||||
_partuuid="$(getpartuuid "${_PART_ROOT}")"
|
||||
if [[ -n "${_partuuid}" ]]; then
|
||||
_rootpart="PARTUUID=${_partuuid}"
|
||||
fi
|
||||
}
|
||||
|
||||
getrootpartlabel() {
|
||||
_rootpart="${PART_ROOT}"
|
||||
_partlabel="$(getpartlabel "${PART_ROOT}")"
|
||||
_rootpart="${_PART_ROOT}"
|
||||
_partlabel="$(getpartlabel "${_PART_ROOT}")"
|
||||
if [[ -n "${_partlabel}" ]]; then
|
||||
_rootpart="PARTLABEL=${_partlabel}"
|
||||
fi
|
||||
}
|
||||
|
||||
getrootfsuuid() {
|
||||
_rootpart="${PART_ROOT}"
|
||||
_fsuuid="$(getfsuuid "${PART_ROOT}")"
|
||||
_rootpart="${_PART_ROOT}"
|
||||
_fsuuid="$(getfsuuid "${_PART_ROOT}")"
|
||||
if [[ -n "${_fsuuid}" ]]; then
|
||||
_rootpart="UUID=${_fsuuid}"
|
||||
fi
|
||||
}
|
||||
|
||||
getrootfslabel() {
|
||||
_rootpart="${PART_ROOT}"
|
||||
_fslabel="$(getfslabel "${PART_ROOT}")"
|
||||
_rootpart="${_PART_ROOT}"
|
||||
_fslabel="$(getfslabel "${_PART_ROOT}")"
|
||||
if [[ -n "${_fslabel}" ]]; then
|
||||
_rootpart="LABEL=${_fslabel}"
|
||||
fi
|
||||
|
@ -102,7 +102,7 @@ bootloader_kernel_parameters() {
|
|||
fi
|
||||
[[ "${NAME_SCHEME_PARAMETER}" == "FSUUID" ]] && getrootfsuuid
|
||||
[[ "${NAME_SCHEME_PARAMETER}" == "FSLABEL" ]] && getrootfslabel
|
||||
[[ "${_rootpart}" == "" ]] && _rootpart="${PART_ROOT}"
|
||||
[[ "${_rootpart}" == "" ]] && _rootpart="${_PART_ROOT}"
|
||||
_KERNEL_PARAMS_COMMON_UNMOD="root=${_rootpart} rootfstype=${ROOTFS} rw ${ROOTFLAGS} ${RAIDARRAYS} ${CRYPTSETUP}"
|
||||
_KERNEL_PARAMS_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sed -e 's# # #g' | sed -e 's# # #g')"
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ check_bootpart() {
|
|||
bootdev="$(mount | grep "${_DESTDIR}/boot " | cut -d' ' -f 1)"
|
||||
if [[ "${bootdev}" == "" ]]; then
|
||||
subdir="/boot"
|
||||
bootdev="${PART_ROOT}"
|
||||
bootdev="${_PART_ROOT}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
# created by Tobias Powalowski <tpowa@archlinux.org>
|
||||
# destdir_mounts()
|
||||
# check if PART_ROOT is set and if something is mounted on ${_DESTDIR}
|
||||
# check if _PART_ROOT is set and if something is mounted on ${_DESTDIR}
|
||||
destdir_mounts(){
|
||||
# Don't ask for filesystem and create new filesystems
|
||||
ASK_MOUNTPOINTS=""
|
||||
PART_ROOT=""
|
||||
_PART_ROOT=""
|
||||
# check if something is mounted on ${_DESTDIR}
|
||||
PART_ROOT="$(mount | grep "${_DESTDIR} " | cut -d' ' -f 1)"
|
||||
_PART_ROOT="$(mount | grep "${_DESTDIR} " | cut -d' ' -f 1)"
|
||||
# Run mountpoints, if nothing is mounted on ${_DESTDIR}
|
||||
if [[ "${PART_ROOT}" == "" ]]; then
|
||||
if [[ "${_PART_ROOT}" == "" ]]; then
|
||||
DIALOG --msgbox "Setup couldn't detect mounted partition(s) in ${_DESTDIR}, please set mountpoints first." 0 0
|
||||
mountpoints || return 1
|
||||
fi
|
||||
|
@ -157,7 +157,7 @@ mountpoints() {
|
|||
#shellcheck disable=SC2086
|
||||
DIALOG --menu "Select the partition to mount as /:" 15 50 12 ${PARTS} 2>"${_ANSWER}" || return 1
|
||||
PART=$(cat "${_ANSWER}")
|
||||
PART_ROOT=${PART}
|
||||
_PART_ROOT=${PART}
|
||||
# Select root filesystem type
|
||||
FSTYPE="$(${_LSBLK} FSTYPE "${PART}")"
|
||||
# clear values first!
|
||||
|
|
Loading…
Reference in a new issue