Add modified copy of basestrap script to

pass --needed flags to pacman
merge-requests/273/head
Chrysostomus 7 years ago
parent 63d47a0a0a
commit e7353c093a

@ -1,7 +1,7 @@
# Maintainer: Chrysostomus @forum.manjaro.org
pkgname=manjaro-architect
pkgver=0.3
pkgver=0.3-beta
pkgrel=1
pkgdesc="A clone of architect installer modified to install manjaro instead of arch linux"
arch=(any)
@ -20,6 +20,7 @@ md5sums=('SKIP')
package () {
cd "$srcdir/aif-dev"
install -Dm755 "$srcdir/aif-dev/aif" "$pkgdir/usr/bin/aif"
install -Dm755 "$srcdir/aif-dev/basestrappy" "$pkgdir/usr/bin/basestrappy"
install -Dm755 "$srcdir/aif-dev/manjaro-architect" "$pkgdir/usr/bin/manjaro-architect"
install -dm655 $pkgdir/usr/share/aif/package-lists
install -dm655 $pkgdir/usr/share/aif/translations

@ -0,0 +1,109 @@
#!/bin/bash
#
# Assumptions:
# 1) User has partitioned, formatted, and mounted partitions on /mnt
# 2) Network is functional
# 3) Arguments passed to the script are valid pacman targets
# 4) A valid mirror appears in /etc/pacman.d/mirrorlist
#
version=0.14.0
shopt -s extglob
DATADIR='/usr/share/manjaro-tools'
LIBDIR='/usr/lib/manjaro-tools'
[[ -r ${LIBDIR}/util-msg.sh ]] && source ${LIBDIR}/util-msg.sh
import ${LIBDIR}/util.sh
import ${LIBDIR}/util-mount.sh
newroot=/mnt
hostcache=false
copykeyring=true
copymirrorlist=true
usage() {
echo "usage: ${0##*/} [options] root [packages...]"
echo " -C config Use an alternate config file for pacman"
echo " -c Use the package cache on the host, rather than the target"
echo " -d Allow installation to a non-mountpoint directory"
echo " -G Avoid copying the host's pacman keyring to the target"
echo " -i Avoid auto-confirmation of package selections"
echo " -M Avoid copying the host's mirrorlist to the target"
echo " -h Print this help message"
echo ''
echo ' basestrap installs packages to the specified new root directory.'
echo ' If no packages are given, basestrap defaults to the "base" group.'
echo ''
echo ''
exit $1
}
# if [[ -z $1 || $1 = @(-h|--help) ]]; then
# usage
# exit $(( $# ? 0 : 1 ))
# fi
#
orig_argv=("$@")
opts=':C:cdGiM'
while getopts ${opts} arg; do
case "${arg}" in
C) pacman_config=$OPTARG ;;
d) directory=true ;;
c) hostcache=true ;;
i) interactive=true ;;
G) copykeyring=false ;;
M) copymirrorlist=false ;;
:) echo "invalid argument ${arg}:$OPTARG"; usage 1;;
?) usage 0 ;;
esac
done
shift $(( OPTIND - 1 ))
check_root "$0" "${orig_argv[@]}"
(( $# )) || die "No root directory specified"
newroot=$1; shift
pacman_args=("${@:-base}")
${hostcache} && pacman_args+=(--cachedir="$newroot/var/cache/pacman/pkg")
${interactive} && pacman_args+=(--noconfirm)
[[ -n $pacman_config ]] && pacman_args+=(--config="$pacman_config")
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
if ! mountpoint -q "$newroot" && ! ${directory}; then
die '%s is not a mountpoint!' "$newroot"
fi
# create obligatory directories
create_min_fs "$newroot"
# mount API filesystems
chroot_api_mount "$newroot" || die "failed to setup API filesystems in new root"
msg2 'Installing packages to %s' "$newroot"
if ! pacman -r "$newroot" --needed -Sy "${pacman_args[@]}"; then
die 'Failed to install packages to new root'
fi
# kill chroot process if needed (TODO: check if needed at all)
kill_chroot_process "$newroot"
if ${copykeyring};then
copy_keyring "$newroot"
fi
if ${copymirrorlist};then
copy_mirrorlist "$newroot"
fi

@ -1611,8 +1611,8 @@ install_base() {
# If at least one kernel selected, proceed with installation.
elif [[ $KERNEL == "y" ]]; then
clear
[[ $(cat ${ANSWER}) -eq 1 ]] && basestrap ${MOUNTPOINT} $(cat /tmp/.base) 2>/tmp/.errlog
[[ $(cat ${ANSWER}) -eq 2 ]] && basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
[[ $(cat ${ANSWER}) -eq 1 ]] && basestrappy ${MOUNTPOINT} $(cat /tmp/.base) 2>/tmp/.errlog
[[ $(cat ${ANSWER}) -eq 2 ]] && basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
# Use mhwd to install selected kernels with right kernel modules
# This is as of yet untested
@ -1646,7 +1646,7 @@ bios_bootloader() {
# If something has been selected, act
if [[ $(cat ${PACKAGES}) != "" ]]; then
sed -i 's/+\|\"//g' ${PACKAGES}
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
# If Grub, select device
@ -1720,7 +1720,7 @@ uefi_bootloader() {
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES} | grep -v "systemd-boot") efibootmgr dosfstools 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES} | grep -v "systemd-boot") efibootmgr dosfstools 2>/tmp/.errlog
check_for_error
case $(cat ${PACKAGES}) in
@ -1819,7 +1819,7 @@ install_wireless_packages(){
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
fi
@ -1836,7 +1836,7 @@ install_cups(){
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
if [[ $(cat ${PACKAGES} | grep "cups") != "" ]]; then
@ -1918,7 +1918,7 @@ install_xorg_input() {
clear
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
fi
@ -1937,7 +1937,7 @@ setup_graphics_card() {
# Save repetition
install_intel(){
#basestrap ${MOUNTPOINT} xf86-video-intel libva-intel-driver intel-ucode 2>/tmp/.errlog
#basestrappy ${MOUNTPOINT} xf86-video-intel libva-intel-driver intel-ucode 2>/tmp/.errlog
arch_chroot "mhwd -a pci free 0300" 2>/tmp/.errlog
check_for_error
sed -i 's/MODULES=""/MODULES="i915"/' ${MOUNTPOINT}/etc/mkinitcpio.conf
@ -1964,7 +1964,7 @@ install_intel(){
# Save repetition
install_ati(){
# basestrap ${MOUNTPOINT} xf86-video-ati 2>/tmp/.errlog
# basestrappy ${MOUNTPOINT} xf86-video-ati 2>/tmp/.errlog
arch_chroot "mhwd -a pci free 0300" 2>/tmp/.errlog
check_for_error
sed -i 's/MODULES=""/MODULES="radeon"/' ${MOUNTPOINT}/etc/mkinitcpio.conf
@ -2036,7 +2036,7 @@ install_ati(){
;;
"7") # Via
arch_chroot "mhwd -a pci free 0300" 2>/tmp/.errlog
#basestrap ${MOUNTPOINT} xf86-video-openchrome 2>/tmp/.errlog
#basestrappy ${MOUNTPOINT} xf86-video-openchrome 2>/tmp/.errlog
;;
# "8") # VirtualBox
@ -2049,7 +2049,7 @@ install_ati(){
# dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --title "$_VBoxInstTitle" --msgbox "$_VBoxInstBody" 0 0
# clear
# basestrap ${MOUNTPOINT} virtualbox-guest-utils virtualbox-guest-dkms $VB_MOD 2>/tmp/.errlog
# basestrappy ${MOUNTPOINT} virtualbox-guest-utils virtualbox-guest-dkms $VB_MOD 2>/tmp/.errlog
# umount -l /mnt/dev
# # Load modules and enable vboxservice.
@ -2060,10 +2060,10 @@ install_ati(){
# ;;
"8") # VMWare
arch_chroot "mhwd -a pci free 0300" 2>/tmp/.errlog
#basestrap ${MOUNTPOINT} xf86-video-vmware xf86-input-vmmouse 2>/tmp/.errlog
#basestrappy ${MOUNTPOINT} xf86-video-vmware xf86-input-vmmouse 2>/tmp/.errlog
;;
"9") # Generic / Unknown
#basestrap ${MOUNTPOINT} xf86-video-fbdev 2>/tmp/.errlog
#basestrappy ${MOUNTPOINT} xf86-video-fbdev 2>/tmp/.errlog
arch_chroot "mhwd -a pci free 0300" 2>/tmp/.errlog
;;
*) install_graphics_menu
@ -2135,7 +2135,7 @@ install_de_wm() {
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
sed -i 's/+\|\"//g' ${PACKAGES}
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
@ -2164,7 +2164,7 @@ install_de_wm() {
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
fi
@ -2312,8 +2312,8 @@ install_manjaro_de_wm() {
pacman -Sgq openrc-base >> /tmp/.notincluded
grep -v -f /tmp/.notincluded /tmp/.edition | grep -v "base-devel" > /tmp/.tmp
mv /tmp/.tmp /tmp/.edition
# basestrap the parsed package list to the new root
basestrap ${MOUNTPOINT} $(cat /tmp/.edition /usr/share/aif/package-lists/input-drivers | sort | uniq) 2>/tmp/.errlog
# basestrappy the parsed package list to the new root
basestrappy ${MOUNTPOINT} $(cat /tmp/.edition /usr/share/aif/package-lists/input-drivers | sort | uniq) 2>/tmp/.errlog
check_for_error
# copy the profile overlay to the new root
@ -2394,7 +2394,7 @@ install_manjaro_de_wm() {
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
clear
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
fi
@ -2586,7 +2586,7 @@ install_codecs(){
# If at least one package, install.
if [[ $(cat ${PACKAGES}) != "" ]]; then
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
fi
@ -2602,7 +2602,7 @@ install_cust_pkgs(){
if [[ $(cat ${PACKAGES}) == "hen poem" ]]; then
dialog --backtitle "$VERSION - $SYSTEM ($ARCHI)" --title " \"My Sweet Buckies\" by Atiya & Carl " --msgbox "\nMy Sweet Buckies,\nYou are the sweetest Buckies that ever did \"buck\",\nLily, Rosie, Trumpet, and Flute,\nMy love for you all is absolute!\n\nThey buck: \"We love our treats, we are the Booyakka sisters,\"\n\"Sometimes we squabble and give each other comb-twisters,\"\n\"And in our garden we love to sunbathe, forage, hop and jump,\"\n\"We love our freedom far, far away from that factory farm dump,\"\n\n\"For so long we were trapped in cramped prisons full of disease,\"\n\"No sunlight, no fresh air, no one who cared for even our basic needs,\"\n\"We suffered in fear, pain, and misery for such a long time,\"\n\"But now we are so happy, we wanted to tell you in this rhyme!\"\n\n" 0 0
else
basestrap ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
basestrappy ${MOUNTPOINT} $(cat ${PACKAGES}) 2>/tmp/.errlog
check_for_error
fi
fi

Loading…
Cancel
Save