mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 12:00:37 +02:00
continue with removin brackets if not really needed
This commit is contained in:
parent
151b46a7de
commit
aba05f72cb
1 changed files with 55 additions and 55 deletions
|
@ -2465,77 +2465,77 @@ _mkfs() {
|
||||||
local ret
|
local ret
|
||||||
case $_fstype in
|
case $_fstype in
|
||||||
xfs) mkfs.xfs $_fsoptions -L $_labelname -f $_device >$LOG 2>&1; ret=$? ;;
|
xfs) mkfs.xfs $_fsoptions -L $_labelname -f $_device >$LOG 2>&1; ret=$? ;;
|
||||||
jfs) yes | mkfs.jfs ${_fsoptions} -L ${_labelname} ${_device} >$LOG 2>&1; ret=$? ;;
|
jfs) yes | mkfs.jfs $_fsoptions -L $_labelname $_device >$LOG 2>&1; ret=$? ;;
|
||||||
reiserfs) yes | mkreiserfs ${_fsoptions} -l ${_labelname} ${_device} >$LOG 2>&1; ret=$? ;;
|
reiserfs) yes | mkreiserfs $_fsoptions -l $_labelname $_device >$LOG 2>&1; ret=$? ;;
|
||||||
ext2) mkfs.ext2 -L ${_fsoptions} ${_labelname} ${_device} >$LOG 2>&1; ret=$? ;;
|
ext2) mkfs.ext2 -L $_fsoptions $_labelname $_device >$LOG 2>&1; ret=$? ;;
|
||||||
ext3) mke2fs ${_fsoptions} -L ${_labelname} -t ext3 ${_device} >$LOG 2>&1; ret=$? ;;
|
ext3) mke2fs $_fsoptions -L $_labelname -t ext3 $_device >$LOG 2>&1; ret=$? ;;
|
||||||
ext4) mke2fs ${_fsoptions} -L ${_labelname} -t ext4 ${_device} >$LOG 2>&1; ret=$? ;;
|
ext4) mke2fs $_fsoptions -L $_labelname -t ext4 $_device >$LOG 2>&1; ret=$? ;;
|
||||||
btrfs) mkfs.btrfs ${_fsoptions} -L ${_labelname} ${_btrfsdevices} >$LOG 2>&1; ret=$? ;;
|
btrfs) mkfs.btrfs $_fsoptions -L $_labelname $_btrfsdevices >$LOG 2>&1; ret=$? ;;
|
||||||
nilfs2) mkfs.nilfs2 ${_fsoptions} -L ${_labelname} ${_device} >$LOG 2>&1; ret=$? ;;
|
nilfs2) mkfs.nilfs2 $_fsoptions -L $_labelname $_device >$LOG 2>&1; ret=$? ;;
|
||||||
ntfs-3g) mkfs.ntfs ${_fsoptions} -L ${_labelname} ${_device} >$LOG 2>&1; ret=$? ;;
|
ntfs-3g) mkfs.ntfs $_fsoptions -L $_labelname $_device >$LOG 2>&1; ret=$? ;;
|
||||||
vfat) mkfs.vfat ${_fsoptions} -n ${_labelname} ${_device} >$LOG 2>&1; ret=$? ;;
|
vfat) mkfs.vfat $_fsoptions -n $_labelname $_device >$LOG 2>&1; ret=$? ;;
|
||||||
# don't handle anything else here, we will error later
|
# don't handle anything else here, we will error later
|
||||||
esac
|
esac
|
||||||
if [[ $ret != 0 ]]; then
|
if [[ $ret != 0 ]]; then
|
||||||
DIALOG --msgbox "Error creating filesystem ${_fstype} on ${_device}" 0 0
|
DIALOG --msgbox "Error creating filesystem $_fstype on $_device" 0 0
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
fi
|
fi
|
||||||
if [[ "${_fstype}" = "btrfs" && -n "${_btrfssubvolume}" && "${_dosubvolume}" = "yes" ]]; then
|
if [[ "$_fstype" = "btrfs" && -n "$_btrfssubvolume" && "$_dosubvolume" = "yes" ]]; then
|
||||||
create_btrfs_subvolume
|
create_btrfs_subvolume
|
||||||
fi
|
fi
|
||||||
btrfs_scan
|
btrfs_scan
|
||||||
sleep 2
|
sleep 2
|
||||||
# create our mount directory
|
# create our mount directory
|
||||||
mkdir -p ${_dest}${_mountpoint}
|
mkdir -p $_dest$_mountpoint
|
||||||
# prepare btrfs mount options
|
# prepare btrfs mount options
|
||||||
_btrfsmountoptions=""
|
_btrfsmountoptions=""
|
||||||
[[ -n "${_btrfssubvolume}" ]] && _btrfsmountoptions="subvol=${_btrfssubvolume}"
|
[[ -n "$_btrfssubvolume" ]] && _btrfsmountoptions="subvol=$_btrfssubvolume"
|
||||||
[[ -n "${_btrfscompress}" ]] && _btrfsmountoptions="${_btrfsmountoptions} ${_btrfscompress}"
|
[[ -n "$_btrfscompress" ]] && _btrfsmountoptions="$_btrfsmountoptions $_btrfscompress"
|
||||||
[[ -n "${_btrfsssd}" ]] && _btrfsmountoptions="${_btrfsmountoptions} ${_btrfsssd}"
|
[[ -n "$_btrfsssd" ]] && _btrfsmountoptions="$_btrfsmountoptions $_btrfsssd"
|
||||||
_btrfsmountoptions="$(echo ${_btrfsmountoptions} | sed -e 's#^ ##g' | sed -e 's# #,#g')"
|
_btrfsmountoptions="$(echo $_btrfsmountoptions | sed -e 's#^ ##g' | sed -e 's# #,#g')"
|
||||||
# mount the bad boy
|
# mount the bad boy
|
||||||
if [[ "${_fstype}" = "btrfs" && -n "${_btrfsmountoptions}" ]]; then
|
if [[ "$_fstype" = "btrfs" && -n "$_btrfsmountoptions" ]]; then
|
||||||
mount -t ${_fstype} -o ${_btrfsmountoptions} ${_device} ${_dest}${_mountpoint} >$LOG 2>&1
|
mount -t $_fstype -o $_btrfsmountoptions $_device $_dest$_mountpoint >$LOG 2>&1
|
||||||
else
|
else
|
||||||
mount -t ${_fstype} ${_device} ${_dest}${_mountpoint} >$LOG 2>&1
|
mount -t $_fstype $_device $_dest$_mountpoint >$LOG 2>&1
|
||||||
fi
|
fi
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
DIALOG --msgbox "Error mounting ${_dest}${_mountpoint}" 0 0
|
DIALOG --msgbox "Error mounting $_dest$_mountpoint" 0 0
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
# change permission of base directories to correct permission
|
# change permission of base directories to correct permission
|
||||||
# to avoid btrfs issues
|
# to avoid btrfs issues
|
||||||
if [[ "${_mountpoint}" = "/tmp" ]]; then
|
if [[ "$_mountpoint" = "/tmp" ]]; then
|
||||||
chmod 1777 ${_dest}${_mountpoint}
|
chmod 1777 $_dest$_mountpoint
|
||||||
elif [[ "${_mountpoint}" = "/root" ]]; then
|
elif [[ "$_mountpoint" = "/root" ]]; then
|
||||||
chmod 750 ${_dest}${_mountpoint}
|
chmod 750 $_dest$_mountpoint
|
||||||
else
|
else
|
||||||
chmod 755 ${_dest}${_mountpoint}
|
chmod 755 $_dest$_mountpoint
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add to .device-names for config files
|
# add to .device-names for config files
|
||||||
local _uuid="$(getuuid ${_device})"
|
local _uuid="$(getuuid $_device)"
|
||||||
local _label="$(getlabel ${_device})"
|
local _label="$(getlabel $_device)"
|
||||||
echo "# DEVICE DETAILS: ${_device} UUID=$_uuid LABEL=$_label" >> /tmp/.device-names
|
echo "# DEVICE DETAILS: $_device UUID=$_uuid LABEL=$_label" >> /tmp/.device-names
|
||||||
# add to temp fstab
|
# add to temp fstab
|
||||||
if [[ "$NAME_SCHEME_PARAMETER" = "UUID" ]]; then
|
if [[ "$NAME_SCHEME_PARAMETER" = "UUID" ]]; then
|
||||||
if [[ -n "${_uuid}" ]]; then
|
if [[ -n "$_uuid" ]]; then
|
||||||
_device="UUID=${_uuid}"
|
_device="UUID=$_uuid"
|
||||||
fi
|
fi
|
||||||
elif [[ "$NAME_SCHEME_PARAMETER" = "LABEL" ]]; then
|
elif [[ "$NAME_SCHEME_PARAMETER" = "LABEL" ]]; then
|
||||||
if [[ -n "${_label}" ]]; then
|
if [[ -n "$_label" ]]; then
|
||||||
_device="LABEL=${_label}"
|
_device="LABEL=$_label"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${_fstype}" = "btrfs" && -n "${_btrfsmountoptions}" ]]; then
|
if [[ "$_fstype" = "btrfs" && -n "$_btrfsmountoptions" ]]; then
|
||||||
echo -n "${_device} ${_mountpoint} ${_fstype} defaults,${_btrfsmountoptions} 0 " >>/tmp/.fstab
|
echo -n "$_device $_mountpoint $_fstype defaults,$_btrfsmountoptions 0 " >>/tmp/.fstab
|
||||||
else
|
else
|
||||||
echo -n "${_device} ${_mountpoint} ${_fstype} defaults 0 " >>/tmp/.fstab
|
echo -n "$_device $_mountpoint $_fstype defaults 0 " >>/tmp/.fstab
|
||||||
fi
|
fi
|
||||||
if [[ "${_fstype}" = "swap" ]]; then
|
if [[ "$_fstype" = "swap" ]]; then
|
||||||
echo "0" >>/tmp/.fstab
|
echo "0" >>/tmp/.fstab
|
||||||
else
|
else
|
||||||
echo "1" >>/tmp/.fstab
|
echo "1" >>/tmp/.fstab
|
||||||
|
@ -2581,12 +2581,12 @@ getsource() {
|
||||||
select_mirror() {
|
select_mirror() {
|
||||||
DIALOG --msgbox "Keep in mind ftp.archlinux.org is throttled.\nPlease select another mirror to get full download speed." 8 65
|
DIALOG --msgbox "Keep in mind ftp.archlinux.org is throttled.\nPlease select another mirror to get full download speed." 8 65
|
||||||
# FIXME: this regex doesn't honor commenting
|
# FIXME: this regex doesn't honor commenting
|
||||||
MIRRORS=$(egrep -o '((ftp)|(http))://[^/]*' "${MIRRORLIST}" | sed 's|$| _|g')
|
MIRRORS=$(egrep -o '((ftp)|(http))://[^/]*' "$MIRRORLIST" | sed 's|$| _|g')
|
||||||
DIALOG --menu "Select an FTP/HTTP mirror" 14 55 7 \
|
DIALOG --menu "Select an FTP/HTTP mirror" 14 55 7 \
|
||||||
$MIRRORS \
|
$MIRRORS \
|
||||||
"Custom" "_" 2>$ANSWER || return 1
|
"Custom" "_" 2>$ANSWER || return 1
|
||||||
local _server=$(cat $ANSWER)
|
local _server=$(cat $ANSWER)
|
||||||
if [[ "${_server}" = "Custom" ]]; then
|
if [[ "$_server" = "Custom" ]]; then
|
||||||
DIALOG --inputbox "Enter the full URL to core repo." 8 65 \
|
DIALOG --inputbox "Enter the full URL to core repo." 8 65 \
|
||||||
"ftp://ftp.archlinux.org/core/os/$(uname -m)" 2>$ANSWER || return 1
|
"ftp://ftp.archlinux.org/core/os/$(uname -m)" 2>$ANSWER || return 1
|
||||||
SYNC_URL=$(cat $ANSWER)
|
SYNC_URL=$(cat $ANSWER)
|
||||||
|
@ -2595,7 +2595,7 @@ select_mirror() {
|
||||||
# our mirrorlist and pulling the full URL out. Substitute 'core' in
|
# our mirrorlist and pulling the full URL out. Substitute 'core' in
|
||||||
# for the repository name, and ensure that if it was listed twice we
|
# for the repository name, and ensure that if it was listed twice we
|
||||||
# only return one line for the mirror.
|
# only return one line for the mirror.
|
||||||
SYNC_URL=$(egrep -o "${_server}.*" "${MIRRORLIST}" | head -n1)
|
SYNC_URL=$(egrep -o "${_server}.*" "$MIRRORLIST" | head -n1)
|
||||||
fi
|
fi
|
||||||
echo "Using mirror: $SYNC_URL" >$LOG
|
echo "Using mirror: $SYNC_URL" >$LOG
|
||||||
}
|
}
|
||||||
|
@ -2604,9 +2604,9 @@ select_mirror() {
|
||||||
# creates temporary pacman.conf file
|
# creates temporary pacman.conf file
|
||||||
pacman_conf() {
|
pacman_conf() {
|
||||||
if [[ "$MODE" = "media" ]]; then
|
if [[ "$MODE" = "media" ]]; then
|
||||||
local serverurl="${FILE_URL}"
|
local serverurl="$FILE_URL"
|
||||||
elif [[ "$MODE" = "ftp" ]]; then
|
elif [[ "$MODE" = "ftp" ]]; then
|
||||||
local serverurl="${SYNC_URL}"
|
local serverurl="$SYNC_URL"
|
||||||
fi
|
fi
|
||||||
# Setup a pacman.conf in /tmp
|
# Setup a pacman.conf in /tmp
|
||||||
cat << EOF > /tmp/pacman.conf
|
cat << EOF > /tmp/pacman.conf
|
||||||
|
@ -2617,10 +2617,10 @@ CacheDir = /src/core-$(uname -m)/pkg
|
||||||
CacheDir = /src/core-any/pkg
|
CacheDir = /src/core-any/pkg
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
Server = ${serverurl}
|
Server = $serverurl
|
||||||
|
|
||||||
[extra]
|
[extra]
|
||||||
Server = ${serverurl}
|
Server = $serverurl
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2751,7 +2751,7 @@ select_packages() {
|
||||||
-e "^gimp" -e "^fprint" -e "-l10n" -e "^ladspa"\
|
-e "^gimp" -e "^fprint" -e "-l10n" -e "^ladspa"\
|
||||||
-e "qtcurve" -e "^telepathy" -e "^texlive" -e "^gstreamer"\
|
-e "qtcurve" -e "^telepathy" -e "^texlive" -e "^gstreamer"\
|
||||||
-e "i18n" -e "^koffice" -e "^vim" | sort); do
|
-e "i18n" -e "^koffice" -e "^vim" | sort); do
|
||||||
_catlist="${_catlist} ${i} - OFF"
|
_catlist="$_catlist $i - OFF"
|
||||||
done
|
done
|
||||||
|
|
||||||
DIALOG --checklist "Select Package Categories\nDO NOT deselect BASE unless you know what you're doing!" 20 60 12 $_catlist 2>$ANSWER || return 1
|
DIALOG --checklist "Select Package Categories\nDO NOT deselect BASE unless you know what you're doing!" 20 60 12 $_catlist 2>$ANSWER || return 1
|
||||||
|
@ -2769,7 +2769,7 @@ select_packages() {
|
||||||
while read pkgname pkgcat; do
|
while read pkgname pkgcat; do
|
||||||
# check if this package is in a selected group
|
# check if this package is in a selected group
|
||||||
# slightly ugly but sorting later requires newlines in the variable
|
# slightly ugly but sorting later requires newlines in the variable
|
||||||
if [[ "${_catlist/"\"$pkgcat\""/XXXX}" != "${_catlist}" ]]; then
|
if [[ "${_catlist/"\"$pkgcat\""/XXXX}" != "$_catlist" ]]; then
|
||||||
_pkglist="$(echo -e "${_pkglist}\n${pkgname} ${pkgcat} ON")"
|
_pkglist="$(echo -e "${_pkglist}\n${pkgname} ${pkgcat} ON")"
|
||||||
else
|
else
|
||||||
_pkglist="$(echo -e "${_pkglist}\n${pkgname} ${pkgcat} OFF")"
|
_pkglist="$(echo -e "${_pkglist}\n${pkgname} ${pkgcat} OFF")"
|
||||||
|
@ -3045,7 +3045,7 @@ donetwork() {
|
||||||
net_notdetectable() {
|
net_notdetectable() {
|
||||||
# modules with no modalias exported! status kernel 2.6.18
|
# modules with no modalias exported! status kernel 2.6.18
|
||||||
NOTDETECTABLE="hp ne de4x5 wd cs89x0 eepro smc9194 seeq8005 ni52 ni65 ac3200 smc-ultra at1700 hp-plus depca eexpress 82596 de600 eth16i de620 lance ewrk3 e2100 lp486e 3c501 3c503 3c505 3c507 3c509 3c515 myri10ge"
|
NOTDETECTABLE="hp ne de4x5 wd cs89x0 eepro smc9194 seeq8005 ni52 ni65 ac3200 smc-ultra at1700 hp-plus depca eexpress 82596 de600 eth16i de620 lance ewrk3 e2100 lp486e 3c501 3c503 3c505 3c507 3c509 3c515 myri10ge"
|
||||||
for mod in ${NOTDETECTABLE}; do
|
for mod in $NOTDETECTABLE; do
|
||||||
modprobe $mod >/dev/null 2>&1
|
modprobe $mod >/dev/null 2>&1
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -3087,16 +3087,16 @@ getcryptsetup() {
|
||||||
getrootuuid() {
|
getrootuuid() {
|
||||||
_rootpart="$PART_ROOT"
|
_rootpart="$PART_ROOT"
|
||||||
_uuid="$(getuuid $PART_ROOT)"
|
_uuid="$(getuuid $PART_ROOT)"
|
||||||
if [[ -n "${_uuid}" ]]; then
|
if [[ -n "$_uuid" ]]; then
|
||||||
_rootpart="/dev/disk/by-uuid/${_uuid}"
|
_rootpart="/dev/disk/by-uuid/$_uuid"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
getrootlabel() {
|
getrootlabel() {
|
||||||
_rootpart="$PART_ROOT"
|
_rootpart="$PART_ROOT"
|
||||||
_label="$(getlabel $PART_ROOT)"
|
_label="$(getlabel $PART_ROOT)"
|
||||||
if [[ -n "${_label}" ]]; then
|
if [[ -n "$_label" ]]; then
|
||||||
_rootpart="/dev/disk/by-label/${_label}"
|
_rootpart="/dev/disk/by-label/$_label"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3917,7 +3917,7 @@ dogrub2_efi_common() {
|
||||||
|
|
||||||
dogrub2_common_before
|
dogrub2_common_before
|
||||||
|
|
||||||
DIALOG --msgbox "Installing grub2-efi-${EFI_ARCH} now ..." 0 0
|
DIALOG --msgbox "Installing grub2-efi-$EFI_ARCH now ..." 0 0
|
||||||
PACKAGES="grub2-efi-$EFI_ARCH grub2-common dosfstools efibootmgr"
|
PACKAGES="grub2-efi-$EFI_ARCH grub2-common dosfstools efibootmgr"
|
||||||
run_pacman
|
run_pacman
|
||||||
# reset PACKAGES after installing
|
# reset PACKAGES after installing
|
||||||
|
@ -3943,15 +3943,15 @@ dogrub2_efi_common() {
|
||||||
EFISYS_PART_NUM=$(sgdisk -p $DISC | grep "EF00" | sed 's/\(.\{4\}\).*/\1/' | sed 's/^ *//;s/ *$//')
|
EFISYS_PART_NUM=$(sgdisk -p $DISC | grep "EF00" | sed 's/\(.\{4\}\).*/\1/' | sed 's/^ *//;s/ *$//')
|
||||||
mount -o rw -t vfat $DISC$EFISYS_PART_NUM $DESTDIR/boot/efi
|
mount -o rw -t vfat $DISC$EFISYS_PART_NUM $DESTDIR/boot/efi
|
||||||
else
|
else
|
||||||
mount -o rw -t vfat ${EFISYS_PART} $DESTDIR/boot/efi
|
mount -o rw -t vfat $EFISYS_PART $DESTDIR/boot/efi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chroot_mount
|
chroot_mount
|
||||||
|
|
||||||
chroot $DESTDIR /sbin/grub_efi_${EFI_ARCH}-install --boot-directory=/boot/efi/efi --bootloader-id=grub --no-floppy --recheck >> /tmp/grub2_efi.log
|
chroot $DESTDIR /sbin/grub_efi_$EFI_ARCH-install --boot-directory=/boot/efi/efi --bootloader-id=grub --no-floppy --recheck >> /tmp/grub2_efi.log
|
||||||
|
|
||||||
chroot $DESTDIR /bin/grub-mkimage --directory=/usr/lib/grub/${EFI_ARCH}-efi \
|
chroot $DESTDIR /bin/grub-mkimage --directory=/usr/lib/grub/$EFI_ARCH-efi \
|
||||||
--format=${EFI_ARCH}-efi \
|
--format=$EFI_ARCH-efi \
|
||||||
--prefix="" \
|
--prefix="" \
|
||||||
--output=/boot/efi/efi/grub/grub_custom.efi \
|
--output=/boot/efi/efi/grub/grub_custom.efi \
|
||||||
--compression=auto \
|
--compression=auto \
|
||||||
|
|
Loading…
Reference in a new issue