so that the 32bit boot loader starts after installation
Not sure, but it seems to work
#! / bin / sh
# Linuxium installation script for booting from a 32-bit bootloader
DEFAULT_GATEWAY = `ip r | grep default | cut -d '' -f 3`
if (! ping -q -w 1 -c 1 ya.ru>/ dev / null 2>&one ); then
echo "$ 0: Not connected to internet ... exiting."
exit
fi
TARGETMOUNT = `mount | grep / target`
if ["x $ {TARGETMOUNT}" = "x"]; then
mkdir -p / target
mount / dev / mmcblk0p2 / target
mount / dev / mmcblk0p1 / target / boot / efi
fi
cat<<+ >/target/etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
+
chroot / target mount -t proc proc / proc
chroot / target mount -t sysfs sysfs / sys
mount --bind / dev / target / dev
mount --bind / run / target / run
chroot / target apt-get -y purge grub-efi-amd64 grub-efi-amd64-bin grub-efi-amd64-signed
chroot / target rm -rf / boot / grub /
chroot / target rm -rf / boot / efi / EFI / ubuntu /
chroot / target apt-get update
chroot / target apt-get -y install grub-efi-ia32-bin grub-efi-ia32 grub-common grub2-common
chroot / target grub-install --target = i386-efi / dev / mmcblk0p1 --efi-directory = / boot / efi / --boot-directory = / boot /
chroot / target grub-mkconfig -o /boot/grub/grub.cfg
chroot / target umount / sys
chroot / target umount / proc
umount / target / run
umount / target / dev
if ["x $ {TARGETMOUNT}" = "x"]; then
umount / target / boot / efi
umount / target
fi
Create a script from this, change the permissions to access it:
sudo chmod 700<script name>
And run it:
sudo ./<script name>