From 60d523e67fe575f0c24c0284430aa364caa30e04 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Wed, 22 Feb 2017 22:45:18 +0100 Subject: [PATCH 1/6] set_timezone() fix symlink creation --- lib/util-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index a0a5e8a..aba1db8 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -77,7 +77,7 @@ set_timezone() { DIALOG " $_ConfBseTimeHC " --yesno "$_TimeZQ ${ZONE}/${SUBZONE}?" 0 0 if [[ $? -eq 0 ]]; then - arch_chroot "ln -s /usr/share/zoneinfo/posix/${ZONE}/${SUBZONE} /etc/localtime" 2>$ERR + arch_chroot "ln -sf /usr/share/zoneinfo/posix/${ZONE}/${SUBZONE} /etc/localtime" 2>$ERR check_for_error "$FUNCNAME" "$?" else config_base_menu From 1aac7b3bae2ee062c926168b7e90e5cf98a35e0a Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 23 Feb 2017 01:36:28 +0100 Subject: [PATCH 2/6] check if base-install was completed. install_bootloader(): check_base --- lib/util-base.sh | 17 +++++++++++++---- lib/util.sh | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index aba1db8..15dd102 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -228,6 +228,7 @@ install_base() { KERNEL="n" mhwd-kernel -l | awk '/linux/ {print $2}' > /tmp/.available_kernels kernels=$(cat /tmp/.available_kernels) + [[ -e /tmp/.base_installed ]] && rm /tmp/.base_installed # User to select initsystem DIALOG " $_ChsInit " --menu "$_WarnOrc" 0 0 2 \ @@ -292,7 +293,8 @@ install_base() { else # If at least one kernel selected, proceed with installation. - basestrap ${MOUNTPOINT} $(cat /tmp/.base) + basestrap ${MOUNTPOINT} $(cat /tmp/.base) 2>$ERR + check_for_error "install basepkgs" "$?" # If root is on btrfs volume, amend mkinitcpio.conf [[ $(lsblk -lno FSTYPE,MOUNTPOINT | awk '/ \/mnt$/ {print $1}') == btrfs ]] && sed -e '/^HOOKS=/s/\ fsck//g' -i ${MOUNTPOINT}/etc/mkinitcpio.conf @@ -302,19 +304,25 @@ install_base() { # Use mhwd to install selected kernels with right kernel modules # This is as of yet untested - # arch_chroot "mhwd-kernel -i $(cat ${PACKAGES} | xargs -n1 | grep -f /tmp/.available_kernels | xargs)" + # arch_chroot "mhwd-kernel -i $(cat ${PACKAGES} | xargs -n1 | grep -f /tmp/.available_kernels | xargs)" + # If the virtual console has been set, then copy config file to installation [[ -e /tmp/vconsole.conf ]] && cp -f /tmp/vconsole.conf ${MOUNTPOINT}/etc/vconsole.conf 2>$ERR + check_for_error "copy vconsole.conf" "$?" # If specified, copy over the pacman.conf file to the installation [[ $COPY_PACCONF -eq 1 ]] && cp -f /etc/pacman.conf ${MOUNTPOINT}/etc/pacman.conf 2>$ERR + check_for_error "copy pacman.conf" "$?" # if branch was chosen, use that also in installed system. If not, use the system setting if [[ -e ${BRANCH} ]]; then - sed -i "/Branch =/c\Branch = $(cat ${BRANCH})/" ${MOUNTPOINT}/etc/pacman-mirrors.conf + sed -i "/Branch =/c\Branch = $(cat ${BRANCH})/" ${MOUNTPOINT}/etc/pacman-mirrors.conf 2>$ERR + check_for_error "set target branch -> $(cat ${BRANCH}" "$?" else - sed -i "/Branch =/c$(grep "Branch =" /etc/pacman-mirrors.conf)" ${MOUNTPOINT}/etc/pacman-mirrors.conf + sed -i "/Branch =/c$(grep "Branch =" /etc/pacman-mirrors.conf)" ${MOUNTPOINT}/etc/pacman-mirrors.conf 2>$ERR + check_for_error "use host branch \($(grep "Branch =" /etc/pacman-mirrors.conf)\)" "$?" fi + touch /tmp/.base_installed fi fi } @@ -484,6 +492,7 @@ bios_bootloader() { install_bootloader() { check_mount + check_base if [[ $SYSTEM == "BIOS" ]]; then bios_bootloader diff --git a/lib/util.sh b/lib/util.sh index 97a82b5..0d3faf7 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -342,7 +342,7 @@ check_mount() { # Ensure that Manjaro has been installed check_base() { - if [[ ! -e ${MOUNTPOINT}/etc ]]; then + if [[ ! -e /tmp/.base_installed ]]; then DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0 main_menu_online fi From 7c9b49eaae94849559ae47db0efc36d5e73d68c5 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 23 Feb 2017 02:00:20 +0100 Subject: [PATCH 3/6] if base not installed go to install_base_menu directly; some logging --- lib/util-base.sh | 2 +- lib/util.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index 15dd102..5b02480 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -337,7 +337,7 @@ uefi_bootloader() { if [[ $(cat ${PACKAGES}) != "" ]]; then clear basestrap ${MOUNTPOINT} $(cat ${PACKAGES} | grep -v "systemd-boot") efibootmgr dosfstools 2>$ERR - check_for_error "uefi_bootloader" "$?" + check_for_error "$FUNCNAME" "$?" case $(cat ${PACKAGES}) in "grub") diff --git a/lib/util.sh b/lib/util.sh index 0d3faf7..ac0d852 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -290,7 +290,7 @@ rank_mirrors() { "unstable" "-" off 2>${BRANCH} clear [[ ! -z "$(cat ${BRANCH})" ]] && pacman-mirrors -gib "$(cat ${BRANCH})" && \ - check_for_error "branch selected: $(cat ${BRANCH})" "$?" + check_for_error "$FUNCNAME branch $(cat ${BRANCH})" "$?" } # Originally adapted from AIS. Added option to allow users to edit the mirrorlist. @@ -344,7 +344,7 @@ check_mount() { check_base() { if [[ ! -e /tmp/.base_installed ]]; then DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0 - main_menu_online + install_base_menu fi } @@ -356,8 +356,8 @@ inst_needed() { # install a pkg in the chroot if not installed check_pkg() { -if ! arch_chroot "pacman -Q $1" ; then - basestrap "$1" 2>$ERR - check_for_error "install missing pkg $1 to target." "$?" -fi + if ! arch_chroot "pacman -Q $1" ; then + basestrap "$1" 2>$ERR + check_for_error "install missing pkg $1 to target." "$?" + fi } From cbab0dfede1411ed8317082dae2af9c0c6ec1fb3 Mon Sep 17 00:00:00 2001 From: Bernhard Landauer Date: Thu, 23 Feb 2017 02:42:14 +0100 Subject: [PATCH 4/6] set_timezone rm posix, KDE doesn't seem to like it --- lib/util-base.sh | 4 ++-- lib/util-desktop.sh | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index 5b02480..cb7112d 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -77,7 +77,7 @@ set_timezone() { DIALOG " $_ConfBseTimeHC " --yesno "$_TimeZQ ${ZONE}/${SUBZONE}?" 0 0 if [[ $? -eq 0 ]]; then - arch_chroot "ln -sf /usr/share/zoneinfo/posix/${ZONE}/${SUBZONE} /etc/localtime" 2>$ERR + arch_chroot "ln -sf /usr/share/zoneinfo/${ZONE}/${SUBZONE} /etc/localtime" 2>$ERR check_for_error "$FUNCNAME" "$?" else config_base_menu @@ -679,7 +679,7 @@ setup_graphics_card() { sed -i 's/MODULES=""/MODULES="nouveau"/' ${MOUNTPOINT}/etc/mkinitcpio.conf fi - check_for_error "$FUNCNAME" "$?" + check_for_error "$FUNCNAME $(cat /tmp/.driver)" "$?" install_graphics_menu } diff --git a/lib/util-desktop.sh b/lib/util-desktop.sh index 069469f..9182870 100644 --- a/lib/util-desktop.sh +++ b/lib/util-desktop.sh @@ -172,17 +172,19 @@ install_manjaro_de_wm() { # remove zsh sed -i '/^zsh$/d' /tmp/.edition - check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?" - # basestrap the parsed package list to the new root - basestrap -i ${MOUNTPOINT} $(cat /tmp/.edition /usr/share/manjaro-architect/package-lists/input-drivers | sort | uniq) + basestrap -i ${MOUNTPOINT} $(cat /tmp/.edition /usr/share/manjaro-architect/package-lists/input-drivers | sort | uniq) 2>$ERR + check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?" # copy the profile overlay to the new root echo "Copying overlay files to the new root" cp -r "$overlay"* ${MOUNTPOINT} 2>$ERR - check_for_error "${overlay}* ${MOUNTPOINT}" "$?" + check_for_error "copy overlay" "$?" + # Copy settings to root account - cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ + cp -ar $MOUNTPOINT/etc/skel/. $MOUNTPOINT/root/ 2>$ERR + check_for_error "copy root config" "$?" + # copy settings to already created users if [[ -e "$(echo /mnt/home/*)" ]]; then for home in $(echo $MOUNTPOINT/home/*); do From 381dc7d110bb8c99c778bb50fdbde5559edf3f62 Mon Sep 17 00:00:00 2001 From: Chrysostomus Date: Thu, 23 Feb 2017 23:32:23 +0800 Subject: [PATCH 5/6] Fix syntax error --- lib/util-base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util-base.sh b/lib/util-base.sh index cb7112d..5d4a9e8 100644 --- a/lib/util-base.sh +++ b/lib/util-base.sh @@ -317,7 +317,7 @@ install_base() { # if branch was chosen, use that also in installed system. If not, use the system setting if [[ -e ${BRANCH} ]]; then sed -i "/Branch =/c\Branch = $(cat ${BRANCH})/" ${MOUNTPOINT}/etc/pacman-mirrors.conf 2>$ERR - check_for_error "set target branch -> $(cat ${BRANCH}" "$?" + check_for_error "set target branch -> $(cat ${BRANCH})" "$?" else sed -i "/Branch =/c$(grep "Branch =" /etc/pacman-mirrors.conf)" ${MOUNTPOINT}/etc/pacman-mirrors.conf 2>$ERR check_for_error "use host branch \($(grep "Branch =" /etc/pacman-mirrors.conf)\)" "$?" From dce25199b370a1016a8f85ac994e5092e34be488 Mon Sep 17 00:00:00 2001 From: Chrysostomus Date: Fri, 24 Feb 2017 02:27:31 +0800 Subject: [PATCH 6/6] Fixes for f2fs --- lib/util-disk.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/util-disk.sh b/lib/util-disk.sh index 9a51d1f..1f4916f 100644 --- a/lib/util-disk.sh +++ b/lib/util-disk.sh @@ -186,14 +186,14 @@ create_partitions() { "ext2" "mkfs.ext2 -q" \ "ext3" "mkfs.ext3 -q" \ "ext4" "mkfs.ext4 -q" \ - "f2fs" "mkfs.f2fs -l" \ + "f2fs" "mkfs.f2fs -q" \ "jfs" "mkfs.jfs -q" \ "nilfs2" "mkfs.nilfs2 -fq" \ "ntfs" "mkfs.ntfs -q" \ "reiserfs" "mkfs.reiserfs -q" \ "vfat" "mkfs.vfat -F32" \ "xfs" "mkfs.xfs -f" 2>${ANSWER} - + cat ${ANSWER} > /tmp/.fs case $(cat ${ANSWER}) in "$_FSSkip") FILESYSTEM="$_FSSkip" ;; @@ -211,7 +211,7 @@ create_partitions() { CHK_NUM=8 fs_opts="data=journal data=writeback dealloc discard noacl noatime nobarrier nodelalloc" ;; - "f2fs") FILESYSTEM="mkfs.f2fs -l" + "f2fs") FILESYSTEM="mkfs.f2fs -q" fs_opts="data_flush disable_roll_forward disable_ext_identify discard fastboot flush_merge \ inline_xattr inline_data inline_dentry no_heap noacl nobarrier noextent_cache noinline_data norecovery" CHK_NUM=16 @@ -287,9 +287,9 @@ mount_partitions() { # Use special mounting options if selected, else standard mount if [[ $(cat ${MOUNT_OPTS}) != "" ]]; then - mount -o $(cat ${MOUNT_OPTS}) ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR + mount -t $(cat /tmp/.fs) -o $(cat ${MOUNT_OPTS}) ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR else - mount ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR + mount -t $(cat /tmp/.fs) ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR fi check_for_error "$FUNCNAME" "$?"