diff options
author | P. J. McDermott <pjm@nac.net> | 2013-05-31 19:03:46 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-05-31 19:12:36 (EDT) |
commit | 0c9f031d1599ff47d3a122baadd260a68556cc38 (patch) | |
tree | adb321edad402c090907db6cf600796a88430834 | |
parent | 1685dbfead4dbb853f28ae18526044a71e5671fa (diff) |
Move package installation into a new script.
-rwxr-xr-x | bootstrap-main.sh | 18 | ||||
-rwxr-xr-x | bootstrap-stage1-install.sh | 41 |
2 files changed, 43 insertions, 16 deletions
diff --git a/bootstrap-main.sh b/bootstrap-main.sh index d7cb1de..26e3555 100755 --- a/bootstrap-main.sh +++ b/bootstrap-main.sh @@ -12,6 +12,7 @@ main() setup_arch_plat "${SCRIPT_DIR}/bootstrap-prepare.sh" "${SCRIPT_DIR}/bootstrap-stage1-build.sh" + "${SCRIPT_DIR}/bootstrap-stage1-install.sh" stage1 } @@ -23,22 +24,7 @@ setup_arch_plat() stage1() { - local opk elf_interp zlib_upstream_ver - - [ -d "root_${ARCH}" ] && rm -Rf "root_${ARCH}" - mkdir "root_${ARCH}" - cd "root_${ARCH}" - - for opk in ../pkg/*_${ARCH}_${PLAT}.opk ../pkg/*_${ARCH}_all.opk \ - ../pkg/*_all_${PLAT}.opk ../pkg/*_all_all.opk; do - [ -f "${opk}" ] || continue - tar -xzOf "${opk}" data.tar.gz | tar -xz - done - - elf_interp="$(readelf -l bin/busybox | sed -n \ - 's|^.*\[Requesting program interpreter: /\(.*\)\].*$|\1|p')" - mkdir -p "${elf_interp%/*}" - ln -sf "/lib/${ARCH}/${elf_interp##*/}" "${elf_interp}" + local zlib_upstream_ver sudo chroot . true sudo chroot . readelf -hl /usr/bin/readelf diff --git a/bootstrap-stage1-install.sh b/bootstrap-stage1-install.sh new file mode 100755 index 0000000..40b2d34 --- /dev/null +++ b/bootstrap-stage1-install.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +set -e + +ARCH= + +main() +{ + ARCH="$(cat /etc/proteanos_arch)" + + cat <<-EOF + installing packages in stage 1... + ================================= + EOF + + install_packages +} + +install_packages() +{ + local opk elf_interp + + [ -d root ] && rm -Rf root + mkdir root + cd root + + for opk in ../pkg/*_${ARCH}_${PLAT}.opk ../pkg/*_${ARCH}_all.opk \ + ../pkg/*_all_${PLAT}.opk ../pkg/*_all_all.opk; do + [ -f "${opk}" ] || continue + tar -xzOf "${opk}" data.tar.gz | tar -xz + done + + elf_interp="$(readelf -l bin/busybox | sed -n \ + 's|^.*\[Requesting program interpreter: /\(.*\)\].*$|\1|p')" + mkdir -p "${elf_interp%/*}" + ln -sf "/lib/${ARCH}/${elf_interp##*/}" "${elf_interp}" + + cd .. +} + +main "${@}" |