diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 451a6245..d5d707ce 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -200,9 +200,9 @@ export TMP=/tmp/ TMPDIR=/tmp/ username=$MY_USERNAME echo "warning: creating initial user $username with well known password!" password=$MY_PASSWORD -chroot $rootdir adduser --gecos $username --disabled-password $username +chroot "$rootdir" adduser --gecos $username --disabled-password $username echo $username:$password | chroot $rootdir /usr/sbin/chpasswd -chroot $rootdir adduser $username sudo +chroot "$rootdir" adduser $username sudo case "$MACHINE" in virtualbox) @@ -213,7 +213,7 @@ case "$MACHINE" in esac set_apt_sources $BUILD_MIRROR -chroot $rootdir apt-get update +chroot "$rootdir" apt-get update cat > $rootdir/usr/sbin/policy-rc.d <&1 | \ +chroot "$rootdir" freedombone-image-hardware-setup 2>&1 | \ tee $rootdir/var/log/freedombone-image-hardware-setup.log rm $rootdir/usr/sbin/policy-rc.d -chroot $rootdir /usr/lib/freedombone/setup 2>&1 | \ +chroot "$rootdir" /usr/lib/freedombone/setup 2>&1 | \ tee $rootdir/var/log/freedombone-setup.log # Remove SSH keys from the image rm $rootdir/etc/ssh/ssh_host_* || true +if [[ "$MACHINE" != "beaglebone" ]]; then + chroot $rootdir apt-get -y install haveged +else + chroot $rootdir apt-get -y install rng-tools + sed -i 's|#HRNGDEVICE=/dev/hwrng|HRNGDEVICE=/dev/hwrng|g' $rootdir/etc/default/rng-tools +fi + # copy u-boot to beginning of image case "$MACHINE" in beaglebone) - chroot $rootdir apt-get -y install rng-tools - sed -i 's|#HRNGDEVICE=/dev/hwrng|HRNGDEVICE=/dev/hwrng|g' $rootdir/etc/default/rng-tools - dd if=$rootdir/usr/lib/u-boot/am335x_boneblack/MLO of="$image" \ count=1 seek=1 conv=notrunc bs=128k dd if=$rootdir/usr/lib/u-boot/am335x_boneblack/u-boot.img of="$image" \ count=2 seek=1 conv=notrunc bs=384k ;; cubieboard2) - chroot $rootdir apt-get -y install haveged dd if=$rootdir/usr/lib/u-boot/Cubieboard2/u-boot-sunxi-with-spl.bin of="$image" \ seek=8 conv=notrunc bs=1k ;; @@ -269,7 +275,7 @@ if $use_eatmydata ; then fi set_apt_sources $MIRROR -chroot $rootdir apt-get update +chroot "$rootdir" apt-get update configure_ssh configure_networking