summaryrefslogtreecommitdiffstats
path: root/bootstrap-stage1-install.sh
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-06-02 11:55:26 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-06-02 11:55:26 (EDT)
commitbdbde0bc56eaff9da051b867294d8fe93d69b563 (patch)
tree48e103463c0da78c601b6d0b6e396fcb64f7ef80 /bootstrap-stage1-install.sh
parentc81ad4ad65555424c3547abf88ab13e7bd94d641 (diff)
bootstrap-stage1-install.sh: Run {pre,post}inst.
Diffstat (limited to 'bootstrap-stage1-install.sh')
-rwxr-xr-xbootstrap-stage1-install.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/bootstrap-stage1-install.sh b/bootstrap-stage1-install.sh
index c85e915..59e293c 100755
--- a/bootstrap-stage1-install.sh
+++ b/bootstrap-stage1-install.sh
@@ -38,6 +38,7 @@ main()
install_packages
install_elf_interp_link
install_archplat_sysconf
+ configure_packages
}
log()
@@ -101,4 +102,38 @@ install_archplat_sysconf()
cd ..
}
+configure_packages()
+{
+ local opk pkg entry file
+
+ cd root
+
+ info='var/lib/opkg/info'
+ mkdir -p "${info}"
+
+ for opk in ../pkg/*_${ARCH}_${PLAT}.opk ../pkg/*_${ARCH}_all.opk \
+ ../pkg/*_all_${PLAT}.opk ../pkg/*_all_all.opk; do
+ [ -f "${opk}" ] || continue
+ pkg="${opk#../pkg/}"
+ pkg="${pkg%%_*}"
+ for entry in $(tar -xzOf "${opk}" control.tar.gz | tar -tz); do
+ file="${entry##*/}"
+ case "${file}" in
+ preinst | postinst)
+ tar -xzOf "${opk}" control.tar.gz | \
+ tar -xzO "${entry}" \
+ >"${info}/${pkg}.${file}"
+ chmod a+x "${info}/${pkg}.${file}"
+ log 'Running %s...' "${pkg}.${file}"
+ sudo chroot . \
+ "/${info}/${pkg}.${file}" \
+ configure
+ ;;
+ esac
+ done
+ done
+
+ cd ..
+}
+
main "${@}"