Merge branch 'master' into fonction

This commit is contained in:
patrick 2017-02-23 19:39:38 +01:00 committed by GitHub
commit e5e8f8dba3
4 changed files with 35 additions and 24 deletions

View File

@ -77,7 +77,7 @@ set_timezone() {
DIALOG " $_ConfBseTimeHC " --yesno "$_TimeZQ ${ZONE}/${SUBZONE}?" 0 0 DIALOG " $_ConfBseTimeHC " --yesno "$_TimeZQ ${ZONE}/${SUBZONE}?" 0 0
if [[ $? -eq 0 ]]; then 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/${ZONE}/${SUBZONE} /etc/localtime" 2>$ERR
check_for_error "$FUNCNAME" "$?" check_for_error "$FUNCNAME" "$?"
else else
config_base_menu config_base_menu
@ -228,6 +228,7 @@ install_base() {
KERNEL="n" KERNEL="n"
mhwd-kernel -l | awk '/linux/ {print $2}' > /tmp/.available_kernels mhwd-kernel -l | awk '/linux/ {print $2}' > /tmp/.available_kernels
kernels=$(cat /tmp/.available_kernels) kernels=$(cat /tmp/.available_kernels)
[[ -e /tmp/.base_installed ]] && rm /tmp/.base_installed
# User to select initsystem # User to select initsystem
DIALOG " $_ChsInit " --menu "$_WarnOrc" 0 0 2 \ DIALOG " $_ChsInit " --menu "$_WarnOrc" 0 0 2 \
@ -292,7 +293,8 @@ install_base() {
else else
# If at least one kernel selected, proceed with installation. # 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 # 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 [[ $(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 # Use mhwd to install selected kernels with right kernel modules
# This is as of yet untested # 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 # 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 [[ -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 # 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 [[ $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 branch was chosen, use that also in installed system. If not, use the system setting
if [[ -e ${BRANCH} ]]; then 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 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 fi
touch /tmp/.base_installed
fi fi
fi fi
} }
@ -329,7 +337,7 @@ uefi_bootloader() {
if [[ $(cat ${PACKAGES}) != "" ]]; then if [[ $(cat ${PACKAGES}) != "" ]]; then
clear clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES} | grep -v "systemd-boot") efibootmgr dosfstools 2>$ERR 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 case $(cat ${PACKAGES}) in
"grub") "grub")
@ -484,6 +492,7 @@ bios_bootloader() {
install_bootloader() { install_bootloader() {
check_mount check_mount
check_base
if [[ $SYSTEM == "BIOS" ]]; then if [[ $SYSTEM == "BIOS" ]]; then
bios_bootloader bios_bootloader
@ -670,7 +679,7 @@ setup_graphics_card() {
sed -i 's/MODULES=""/MODULES="nouveau"/' ${MOUNTPOINT}/etc/mkinitcpio.conf sed -i 's/MODULES=""/MODULES="nouveau"/' ${MOUNTPOINT}/etc/mkinitcpio.conf
fi fi
check_for_error "$FUNCNAME" "$?" check_for_error "$FUNCNAME $(cat /tmp/.driver)" "$?"
install_graphics_menu install_graphics_menu
} }

View File

@ -172,17 +172,19 @@ install_manjaro_de_wm() {
# remove zsh # remove zsh
sed -i '/^zsh$/d' /tmp/.edition sed -i '/^zsh$/d' /tmp/.edition
check_for_error "install pkgs: $(cat /tmp/.desktop)" "$?"
# basestrap the parsed package list to the new root # 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 # copy the profile overlay to the new root
echo "Copying overlay files to the new root" echo "Copying overlay files to the new root"
cp -r "$overlay"* ${MOUNTPOINT} 2>$ERR cp -r "$overlay"* ${MOUNTPOINT} 2>$ERR
check_for_error "${overlay}* ${MOUNTPOINT}" "$?" check_for_error "copy overlay" "$?"
# Copy settings to root account # 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 # copy settings to already created users
if [[ -e "$(echo /mnt/home/*)" ]]; then if [[ -e "$(echo /mnt/home/*)" ]]; then
for home in $(echo $MOUNTPOINT/home/*); do for home in $(echo $MOUNTPOINT/home/*); do

View File

@ -186,14 +186,14 @@ create_partitions() {
"ext2" "mkfs.ext2 -q" \ "ext2" "mkfs.ext2 -q" \
"ext3" "mkfs.ext3 -q" \ "ext3" "mkfs.ext3 -q" \
"ext4" "mkfs.ext4 -q" \ "ext4" "mkfs.ext4 -q" \
"f2fs" "mkfs.f2fs -l" \ "f2fs" "mkfs.f2fs -q" \
"jfs" "mkfs.jfs -q" \ "jfs" "mkfs.jfs -q" \
"nilfs2" "mkfs.nilfs2 -fq" \ "nilfs2" "mkfs.nilfs2 -fq" \
"ntfs" "mkfs.ntfs -q" \ "ntfs" "mkfs.ntfs -q" \
"reiserfs" "mkfs.reiserfs -q" \ "reiserfs" "mkfs.reiserfs -q" \
"vfat" "mkfs.vfat -F32" \ "vfat" "mkfs.vfat -F32" \
"xfs" "mkfs.xfs -f" 2>${ANSWER} "xfs" "mkfs.xfs -f" 2>${ANSWER}
cat ${ANSWER} > /tmp/.fs
case $(cat ${ANSWER}) in case $(cat ${ANSWER}) in
"$_FSSkip") FILESYSTEM="$_FSSkip" "$_FSSkip") FILESYSTEM="$_FSSkip"
;; ;;
@ -211,7 +211,7 @@ create_partitions() {
CHK_NUM=8 CHK_NUM=8
fs_opts="data=journal data=writeback dealloc discard noacl noatime nobarrier nodelalloc" 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 \ 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" inline_xattr inline_data inline_dentry no_heap noacl nobarrier noextent_cache noinline_data norecovery"
CHK_NUM=16 CHK_NUM=16
@ -287,9 +287,9 @@ mount_partitions() {
# Use special mounting options if selected, else standard mount # Use special mounting options if selected, else standard mount
if [[ $(cat ${MOUNT_OPTS}) != "" ]]; then 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 else
mount ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR mount -t $(cat /tmp/.fs) ${PARTITION} ${MOUNTPOINT}${MOUNT} 2>$ERR
fi fi
check_for_error "$FUNCNAME" "$?" check_for_error "$FUNCNAME" "$?"

View File

@ -294,7 +294,7 @@ rank_mirrors() {
"unstable" "-" off 2>${BRANCH} "unstable" "-" off 2>${BRANCH}
clear clear
[[ ! -z "$(cat ${BRANCH})" ]] && pacman-mirrors -gib "$(cat ${BRANCH})" && \ [[ ! -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. # Originally adapted from AIS. Added option to allow users to edit the mirrorlist.
@ -346,9 +346,9 @@ check_mount() {
# Ensure that Manjaro has been installed # Ensure that Manjaro has been installed
check_base() { check_base() {
if [[ ! -e ${MOUNTPOINT}/etc ]]; then if [[ ! -e /tmp/.base_installed ]]; then
DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0 DIALOG " $_ErrTitle " --msgbox "$_ErrNoBase" 0 0
main_menu_online install_base_menu
fi fi
} }
@ -360,8 +360,8 @@ inst_needed() {
# install a pkg in the chroot if not installed # install a pkg in the chroot if not installed
check_pkg() { check_pkg() {
if ! arch_chroot "pacman -Q $1" ; then if ! arch_chroot "pacman -Q $1" ; then
basestrap "$1" 2>$ERR basestrap "$1" 2>$ERR
check_for_error "install missing pkg $1 to target." "$?" check_for_error "install missing pkg $1 to target." "$?"
fi fi
} }