summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 "${@}"