set -eux
DIST=squeeze
+ARCH=amd64
script_dir="$( cd "$( dirname "$0" )" && pwd )"
liveboot_id="$LIVEBOOT_BUILD_NUMBER"
# assemble ethoip6 debug directory
run_in_chroot aptitude download profitbricks-linux-source-pserver=$kernel_ver
-run_in_chroot dpkg -x profitbricks-linux-source-pserver_$kernel_ver*.deb kernel_source
-run_in_chroot mv kernel_source/usr/src/linux-*-pserver $assembledir/
+run_in_chroot dpkg -x profitbricks-linux-source-pserver_${kernel_ver}_${ARCH}.deb kernel_source
+run_in_chroot bash -c "mv kernel_source/usr/src/linux-*-pserver $assembledir/"
run_in_chroot aptitude download profitbricks-linux-image-pserver-dbg=$kernel_ver
-run_in_chroot dpkg -x profitbricks-linux-image-pserver-dbg_$kernel_ver*.deb kernel_dbg
+run_in_chroot dpkg -x profitbricks-linux-image-pserver-dbg_${kernel_ver}_${ARCH}.deb kernel_dbg
run_in_chroot mkdir -p $assembledir/linux-$kernel_ver-pserver-dbg
-run_in_chroot mv kernel_dbg/usr/lib/debug/vmlinux* kernel_dbg/usr/lib/debug/lib/modules/*-pserver $assembledir/linux-$kernel_ver-pserver-dbg
+run_in_chroot bash -c "mv kernel_dbg/usr/lib/debug/vmlinux* kernel_dbg/usr/lib/debug/lib/modules/*-pserver $assembledir/linux-$kernel_ver-pserver-dbg"
# assemble ethoip6 debug directory
run_in_chroot aptitude download ethoip6-sources=$ethoip6_ver
-run_in_chroot dpkg -x ethoip6-sources_$ethoip6_ver*.deb ethoip6_src
-run_in_chroot mv ethoip6_src/usr/src/ethoip6* $assembledir/
+run_in_chroot dpkg -x ethoip6-sources_${ethoip6_ver}_${ARCH}.deb ethoip6_src
+run_in_chroot bash -c "mv ethoip6_src/usr/src/ethoip6* $assembledir/"
run_in_chroot aptitude download profitbricks-ethoip6-modules-pserver-dbg=$ethoip6_ver
-run_in_chroot dpkg -x profitbricks-ethoip6-modules-pserver-dbg_$ethoip6_ver*.deb ethoip6_dbg
+run_in_chroot dpkg -x profitbricks-ethoip6-modules-pserver-dbg_${ethoip6_ver}_${ARCH}.deb ethoip6_dbg
run_in_chroot mkdir -p $assembledir/ethoip6-$ethoip6_ver-dbg
run_in_chroot find ethoip6_dbg -name "*.ko" -exec mv {} $assembledir/ethoip6-$ethoip6_ver-dbg/ \;