From ce3afefeb9728619a06989a67e7ffd5ed299ecf8 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 11:47:18 +0100 Subject: softcode architecture + some small misc stuff in yaourt lib --- src/core/procedures/base | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core/procedures/base') diff --git a/src/core/procedures/base b/src/core/procedures/base index fa88210..94a9d1e 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -7,6 +7,8 @@ var_RUNTIME_PACKAGES= var_PKG_FILE=$RUNTIME_DIR/package-list var_MIRRORLIST="/etc/pacman.d/mirrorlist" var_UI_TYPE="cli" # set to cli or dia for dialog +var_ARCH=`uname -m` #works for i686 TODO: check if it works for x86_64 +[ -z "$var_ARCH" ] && die_error "Could not determine your architecture" ###### Phases ( can be overridden by more specific procedures) ###### phase_preparation=(\ -- cgit v1.2.3-54-g00ecf From bb8deddcdcbda2b7687c6e2ef31d443bd487c899 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 14:37:21 +0100 Subject: moo --- src/core/procedures/base | 1 - 1 file changed, 1 deletion(-) (limited to 'src/core/procedures/base') diff --git a/src/core/procedures/base b/src/core/procedures/base index 94a9d1e..632dda7 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -34,7 +34,6 @@ phase_system=(\ locales \ install_bootloader) - phase_finish=(msg_report) -- cgit v1.2.3-54-g00ecf From 7f9c5b317eb33ffc4be183b50dd636de15f01ae2 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 16:03:38 +0100 Subject: cleanup automatic deployment stuff --- examples/deployconfig-dieter | 16 ++++++++++++++++ src/core/procedures/automatic | 15 --------------- src/core/procedures/base | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'src/core/procedures/base') diff --git a/examples/deployconfig-dieter b/examples/deployconfig-dieter index 00a3396..c626a64 100644 --- a/examples/deployconfig-dieter +++ b/examples/deployconfig-dieter @@ -1,6 +1,8 @@ #!/bin/bash # An example config for the deployment procedure +#TODO: install ruby-gems too + var_RUNTIME_PACKAGES="svn" DEPLOY_CLASS=desktop-a7n8x @@ -21,6 +23,13 @@ worker_fetch_configs () } +worker_package_list () +{ + $SVN export $SVN_BASE/ddm-configs/$DEPLOY_CLASS/trunk/package-list $var_PKG_FILE || die_error "Could not export package list!" + # cat -> there are newlines in it -> var=`echo $var` -> not anymore :) + TARGET_PACKAGES=`cat $var_PKG_FILE` && TARGET_PACKAGES=`echo $TARGET_PACKAGES` || die_error "Could not cat package list. THIS SHOULD NEVER HAPPEN." +} + worker_accept_ssl_cert () { mkdir -p /root/.subversion/auth/svn.ssl.server @@ -40,3 +49,10 @@ https://192.168.1.2:443 END EOF } + + +worker_configure_home () +{ + #TODO checkout from svn + true +} \ No newline at end of file diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index f41d5a9..dc879ee 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -104,14 +104,6 @@ worker_prepare_disks () true } -worker_package_list () -{ - $SVN export $SVN_BASE/ddm-configs/$TARGET_HOST/trunk/package-list $var_PKG_FILE || die_error "Could not export package list!" - # cat -> there are newlines in it -> var=`echo $var` -> not anymore :) - TARGET_PACKAGES=`cat $var_PKG_FILE` && TARGET_PACKAGES=`echo $TARGET_PACKAGES` || die_error "Could not cat package list. THIS SHOULD NEVER HAPPEN." - true -} - worker_install_packages () { @@ -121,13 +113,6 @@ worker_install_packages () } -worker_configure_home () -{ - #checkout from svn - true -} - - worker_set_clock () { #timezone="Europe/Brussels" diff --git a/src/core/procedures/base b/src/core/procedures/base index 632dda7..1c1d640 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -4,7 +4,7 @@ var_DEFAULTFS="/boot:32:ext2:+ swap:256:swap /:7500:ext3 /home:*:ext3" var_TARGET_DIR="/mnt" # When overriding this, do _not_ add a trailing /. It's not needed and maybe you could even break something var_RUNTIME_PACKAGES= -var_PKG_FILE=$RUNTIME_DIR/package-list +var_PKG_FILE=$RUNTIME_DIR/package-list # not used by default in base/interactive. can be used by custom procedures or profiles for the automatic procedure var_MIRRORLIST="/etc/pacman.d/mirrorlist" var_UI_TYPE="cli" # set to cli or dia for dialog var_ARCH=`uname -m` #works for i686 TODO: check if it works for x86_64 -- cgit v1.2.3-54-g00ecf From cd6c7c01579bc37c458eac1a649ef74f17def3cb Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 17:31:25 +0100 Subject: fixes/cleanups for runtime packages and repositories. Not much use in making yauort a module, its integrated now --- examples/deployconfig-dieter | 42 ++++++++++++++++++++++++++++++++++++++++-- src/core/procedures/automatic | 1 - src/core/procedures/base | 13 +++++++++++++ 3 files changed, 53 insertions(+), 3 deletions(-) (limited to 'src/core/procedures/base') diff --git a/examples/deployconfig-dieter b/examples/deployconfig-dieter index c626a64..9e80dc4 100644 --- a/examples/deployconfig-dieter +++ b/examples/deployconfig-dieter @@ -1,8 +1,13 @@ #!/bin/bash # An example config for the deployment procedure -#TODO: install ruby-gems too +# TODO: install ruby-gems too +# TODO * dieter/automatic: wait for yaourt --config fix ( http://forums.archlinux.fr/post23171.html#23171 ) +# TODO:* dieter/automatic: put config files from svn in place first, so that if a package has an update, it can do it's thing. +depend_module yaourt + +var_RUNTIME_REPOSITORIES=(archlinuxfr "Server = http://repo.archlinux.fr/$var_ARCH") var_RUNTIME_PACKAGES="svn" DEPLOY_CLASS=desktop-a7n8x @@ -23,6 +28,19 @@ worker_fetch_configs () } +worker_runtime_packages () +{ + for pkg in $var_RUNTIME_PACKAGES + do + $PACMAN -Sy --noconfirm --needed $pkg + done + + # We'll install packages on the target system, for that we need yaourt + _runtime_yaourt + _yaourt_replace_pacman +} + + worker_package_list () { $SVN export $SVN_BASE/ddm-configs/$DEPLOY_CLASS/trunk/package-list $var_PKG_FILE || die_error "Could not export package list!" @@ -55,4 +73,24 @@ worker_configure_home () { #TODO checkout from svn true -} \ No newline at end of file +} + + + +# See http://wiki.archlinux.org/index.php/Yaourt + +worker_install_packages () #pre_ / post_ callbacks would be useful here +{ + PACMAN_BACKUP=$PACMAN + PACMAN_TARGET_BACKUP=$PACMAN_TARGET + PACMAN=${PACMAN//pacman/yaourt} + PACMAN_TARGET=${PACMAN_TARGET//pacman/yaourt} + + target_prepare_pacman core + [ -z "$TARGET_PACKAGES" ] && die_error "No packages listed to be installed!" + installpkg + + PACMAN=$PACMAN_BACKUP + PACMAN_TARGET=$PACMAN_TARGET_BACKUP + +} diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index dc879ee..bb78437 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -5,7 +5,6 @@ # In theory, the only manual thing should maybe be configuring the runtime network and putting the configfile in place # TODO: I don't know if you can do non-interactive dm_crypt stuff.. maybe by pulling luks keyfiles from svn/git/..? -depend_module yaourt depend_procedure core base var_OPTS_STRING="c:" diff --git a/src/core/procedures/base b/src/core/procedures/base index 1c1d640..4fd32c8 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -3,6 +3,7 @@ #TODO: make this profile work on itself, eg some stuff from inheriting profiles should be moved in, stuff implemented etc var_DEFAULTFS="/boot:32:ext2:+ swap:256:swap /:7500:ext3 /home:*:ext3" var_TARGET_DIR="/mnt" # When overriding this, do _not_ add a trailing /. It's not needed and maybe you could even break something +var_RUNTIME_REPOSITORIES= # array like this ('name1' 'location of repo 1' ['name2' 'location of repo2',..]) var_RUNTIME_PACKAGES= var_PKG_FILE=$RUNTIME_DIR/package-list # not used by default in base/interactive. can be used by custom procedures or profiles for the automatic procedure var_MIRRORLIST="/etc/pacman.d/mirrorlist" @@ -17,6 +18,7 @@ phase_preparation=(\ sysprep \ select_source \ runtime_network \ + runtime_repositories \ runtime_packages) phase_basics=(\ @@ -77,6 +79,17 @@ worker_runtime_network () } +worker_runtime_repositories () +{ + for i in `seq 0 $((${#var_RUNTIME_REPOSITORIES[@]}/2-1))` + do + repo=${var_RUNTIME_REPOSITORIES[$(($i*2))]} + location=${var_RUNTIME_REPOSITORIES[$(($i*2+1))]} + list_pacman_repos runtime | grep -q $repo || add_pacman_repo runtime $repo $location + done +} + + worker_runtime_packages () { for pkg in $var_RUNTIME_PACKAGES -- cgit v1.2.3-54-g00ecf From 8d125d8781d43f5fc3522e30dd1fe617386118b4 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 17:38:28 +0100 Subject: fix for incomplete repo location string, making pacman segfault *oops* --- src/core/procedures/base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/procedures/base') diff --git a/src/core/procedures/base b/src/core/procedures/base index 4fd32c8..b0e9c9a 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -85,7 +85,7 @@ worker_runtime_repositories () do repo=${var_RUNTIME_REPOSITORIES[$(($i*2))]} location=${var_RUNTIME_REPOSITORIES[$(($i*2+1))]} - list_pacman_repos runtime | grep -q $repo || add_pacman_repo runtime $repo $location + list_pacman_repos runtime | grep -q $repo || add_pacman_repo runtime $repo "$location" done } -- cgit v1.2.3-54-g00ecf From 60737c99694d406562097eed5ede4ed7987a962f Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 30 Dec 2008 20:02:25 +0100 Subject: architecture more clarity --- src/core/procedures/base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/procedures/base') diff --git a/src/core/procedures/base b/src/core/procedures/base index b0e9c9a..93c711c 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -8,7 +8,7 @@ var_RUNTIME_PACKAGES= var_PKG_FILE=$RUNTIME_DIR/package-list # not used by default in base/interactive. can be used by custom procedures or profiles for the automatic procedure var_MIRRORLIST="/etc/pacman.d/mirrorlist" var_UI_TYPE="cli" # set to cli or dia for dialog -var_ARCH=`uname -m` #works for i686 TODO: check if it works for x86_64 +var_ARCH=`uname -m` #i686 or x86_64 [ -z "$var_ARCH" ] && die_error "Could not determine your architecture" ###### Phases ( can be overridden by more specific procedures) ###### -- cgit v1.2.3-54-g00ecf From 9506a6b2359e9c1ca8b3da9e6f6528e2bda97803 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 16:14:01 +0100 Subject: port of FS#13102 - fix, need to copy initial /etc/localtime --- src/core/procedures/base | 6 ++++++ src/core/procedures/interactive | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/procedures/base') diff --git a/src/core/procedures/base b/src/core/procedures/base index 93c711c..6aa7767 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -166,6 +166,12 @@ worker_locales () } +worker_initialtime () +{ + cp /etc/localtime ${var_TARGET_DIR}/etc/localtime +} + + worker_install_bootlader () { #TODO: ask which disk, install grub on it diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index 08bdf23..691652f 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -81,7 +81,8 @@ mainmenu() execute worker auto_locale ; } && NEXTITEM=6 ;; "6") check_depend worker install_packages && execute worker configure_system && { execute worker mkinitcpio ; \ - execute worker locales ; } && NEXTITEM=7 ;; #TODO: why is next item 4 if $?=0?. maybe fixed now + execute worker locales ; + execute worker initialtime ; } && NEXTITEM=7 ;; #TODO: why is next item 4 if $?=0?. maybe fixed now "7") check_depend worker configure_system && execute worker install_bootloader && NEXTITEM=8 ;; "8") -- cgit v1.2.3-54-g00ecf From ccc552ef115d3d7fcd5f92121ba9838e9b199361 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 18:43:11 +0100 Subject: port of FS#12944 - Pacman mirrorlist installer edits --- src/core/libs/lib-pacman.sh | 2 +- src/core/libs/lib-ui-interactive.sh | 9 ++++----- src/core/procedures/base | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/core/procedures/base') diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 89c3638..4497074 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -78,7 +78,7 @@ do then add_pacman_repo target ${repo} "Include = $var_MIRRORLIST" else - add_pacman_repo target ${repo} "Server = ${serverurl}" + add_pacman_repo target ${repo} "Server = ${serverurl/\/\$repo\//\/$repo\/}" # replace literal '/$repo/' in the serverurl string by "/$repo/" where $repo is our variable. fi done # Set up the necessary directories for pacman use diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 851e990..343ecc4 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -865,13 +865,12 @@ interactive_select_mirror() { local _server=$ANSWER_OPTION if [ "${_server}" = "Custom" ]; then ask_string "Enter the full URL to core repo." "ftp://ftp.archlinux.org/core/os/$var_ARCH" || return 1 - var_SYNC_URL=$ANSWER_STRING + var_SYNC_URL=${ANSWER_STRING/\/core\///\$repo/} #replace '/core/' by '/$repo/' else # Form the full URL for our mirror by grepping for the server name 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 - # only return one line for the mirror. - var_SYNC_URL=$(egrep -o "${_server}.*" "${var_MIRRORLIST}" | sed 's/\$repo/core/g' | head -n1) + # our mirrorlist and pulling the full URL out. + # Ensure that if it was listed twice we only return one line for the mirror. + var_SYNC_URL=$(egrep -o "${_server}.*" "${var_MIRRORLIST}" | head -n1) fi echo "Using mirror: $var_SYNC_URL" >$LOG } diff --git a/src/core/procedures/base b/src/core/procedures/base index 6aa7767..c22a01c 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -8,7 +8,7 @@ var_RUNTIME_PACKAGES= var_PKG_FILE=$RUNTIME_DIR/package-list # not used by default in base/interactive. can be used by custom procedures or profiles for the automatic procedure var_MIRRORLIST="/etc/pacman.d/mirrorlist" var_UI_TYPE="cli" # set to cli or dia for dialog -var_ARCH=`uname -m` #i686 or x86_64 +var_ARCH=`uname -m` #i686 or x86_64. NOTE: this assumes you want to install the same arch as the installation environment you're using. maybe we could decouple those someday.. [ -z "$var_ARCH" ] && die_error "Could not determine your architecture" ###### Phases ( can be overridden by more specific procedures) ###### @@ -67,7 +67,7 @@ worker_select_source () { var_PKG_SOURCE_TYPE='cd' var_FILE_URL="file:///src/core/pkg" - var_SYNC_URL= + var_SYNC_URL= # optional, points to a repository string something like ftp://ftp.belnet.be/mirror/archlinux.org/$repo/os/i686 (eg the same format as what you find in /etc/pacman.conf) # if you override to use ftp (or ask user and he chooses ftp) don't forget to configure the network and to select_mirrors } -- cgit v1.2.3-54-g00ecf