install function

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-01-31 21:33:19 +01:00
parent df502a2458
commit 7ce5b33814

View File

@@ -239,12 +239,13 @@ create_fs_structure () {
local cmd local cmd
printf "${BLUE}Prepare filesystem structure${GREEN}'subvol=%s'${NO_COLOR}\n" \ printf "${BLUE}Prepare root filesystem structure ${GREEN}'subvol=%s'${NO_COLOR}\n" \
"$SUBVOL" "$SUBVOL"
cmd="mount_target /dev/disk/by-partlabel/$LABEL $MOUNT_POINT btrfs $SUBVOL" cmd="mount_target /dev/disk/by-partlabel/${PREFIX}-${LABEL} $MOUNT_POINT btrfs $SUBVOL"
if [ $dryrun -eq 1 ]; then if [ $dryrun -eq 1 ]; then
printf "${MAGENTA}Would run ${GREEN}'%s'${NO_COLOR}\n" "$cmd" printf "${MAGENTA}Would run ${GREEN}'%s'${NO_COLOR}\n" "$cmd"
else else
printf "${BLUE} - Create base subdirs${NO_COLOR}\n"
printf "${MAGENTA}Run ${GREEN}'%s'${NO_COLOR}\n" "$cmd" printf "${MAGENTA}Run ${GREEN}'%s'${NO_COLOR}\n" "$cmd"
eval "$cmd" eval "$cmd"
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
@@ -255,6 +256,7 @@ create_fs_structure () {
if [ $LABEL=$disk_label_root ]; then if [ $LABEL=$disk_label_root ]; then
printf "${BLUE}Create target filesystem structure${NO_COLOR}\n" printf "${BLUE}Create target filesystem structure${NO_COLOR}\n"
printf "${BLUE} - Create base subdirs${NO_COLOR}\n"
for subdir in lib; do for subdir in lib; do
cmd="mkdir -p $MOUNT_POINT/var/$subdir" cmd="mkdir -p $MOUNT_POINT/var/$subdir"
if [ $dryrun -eq 1 ]; then if [ $dryrun -eq 1 ]; then
@@ -597,9 +599,9 @@ install_target_packages () {
# Find fast mirror # Find fast mirror
# TODO: Aachen # TODO: Aachen
sed '1 i \ #sed '1 i \
Server = http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch' \ #Server = http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch' \
/etc/pacman.d/mirrorlist # /etc/pacman.d/mirrorlist
# Update available packages # Update available packages
cmd="pacman -Sy" cmd="pacman -Sy"
@@ -648,7 +650,7 @@ Server = http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch' \
fi fi
} }
install_target () { install () {
printf "${BLUE}Install target${NO_COLOR}\n" "$TARGET" printf "${BLUE}Install target${NO_COLOR}\n" "$TARGET"
# Needs to be executed in chroot environment (target) # Needs to be executed in chroot environment (target)