diff options
-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 "${@}" |