summaryrefslogtreecommitdiff
path: root/archiso
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2013-09-21 18:11:43 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2013-09-21 18:11:43 -0300
commit997dabbce2f8b621dacdac268212c4cb1be8956d (patch)
treec9cda970acb9575ffe1b75d4b5d5a1e443a68db6 /archiso
parent4d25ed614ab34e093e477b1ceb491f6ad2300de7 (diff)
downloadarchiso32-997dabbce2f8b621dacdac268212c4cb1be8956d.tar.xz
[archiso] mkarchiso: use arch-install-scripts instead of own functions
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'archiso')
-rwxr-xr-xarchiso/mkarchiso43
1 files changed, 6 insertions, 37 deletions
diff --git a/archiso/mkarchiso b/archiso/mkarchiso
index fb65f09..e6a2195 100755
--- a/archiso/mkarchiso
+++ b/archiso/mkarchiso
@@ -47,42 +47,15 @@ _show_space_usage () {
_msg_info "Total: ${_total} MiB (100%) | Used: ${_used} MiB (${_pct_u}) | Avail: ${_avail} MiB ($((100 - ${_pct_u%\%}))%)"
}
-_chroot_mount () {
- mount -t devtmpfs dev "${work_dir}/root-image/dev"
- mount -t devpts devpts "${work_dir}/root-image/dev/pts"
- mount -t tmpfs devshm "${work_dir}/root-image/dev/shm"
- mount -t proc proc "${work_dir}/root-image/proc"
- mount -t tmpfs run "${work_dir}/root-image/run"
- mount -t sysfs sys "${work_dir}/root-image/sys"
- mount -t tmpfs tmp "${work_dir}/root-image/tmp"
-
- trap '_chroot_umount' EXIT HUP INT TERM
-}
-
-_chroot_umount () {
- umount "${work_dir}/root-image/tmp"
- umount "${work_dir}/root-image/sys"
- umount "${work_dir}/root-image/run"
- umount "${work_dir}/root-image/proc"
- umount "${work_dir}/root-image/dev/shm"
- umount "${work_dir}/root-image/dev/pts"
- umount "${work_dir}/root-image/dev"
-
- trap - EXIT HUP INT TERM
-}
-
_chroot_init() {
- if [[ ! -d ${work_dir}/root-image/var/cache/pacman ]]; then
- mkdir -p ${work_dir}/root-image/{dev,proc,run,sys,tmp,var/lib/pacman}
- _pacman "base"
- _pacman "syslinux"
+ if [[ ! -d ${work_dir}/root-image ]]; then
+ mkdir -p ${work_dir}/root-image
+ _pacman "base syslinux"
fi
}
_chroot_run() {
- _chroot_mount
- eval chroot ${work_dir}/root-image "${run_cmd}"
- _chroot_umount
+ eval arch-chroot ${work_dir}/root-image "${run_cmd}"
}
# Mount a filesystem (trap signals in case of error for unmounting it
@@ -218,16 +191,12 @@ _pacman ()
{
_msg_info "Installing packages to '${work_dir}/root-image/'..."
- _chroot_mount
-
if [[ "${quiet}" = "y" ]]; then
- pacman -Sy -r "${work_dir}/root-image" --config "${pacman_conf}" --needed --noconfirm $* &> /dev/null
+ pacstrap -C "${pacman_conf}" -c -d -G -M "${work_dir}/root-image" $* &> /dev/null
else
- pacman -Sy -r "${work_dir}/root-image" --config "${pacman_conf}" --needed --noconfirm $*
+ pacstrap -C "${pacman_conf}" -c -d -G -M "${work_dir}/root-image" $*
fi
- _chroot_umount
-
_msg_info "Packages installed successfully!"
}