#!/bin/ash
set -e

mkdir /media/setup
cp -a /media/sda/* /media/setup
mkdir /lib/setup
cp -a /.modloop/* /lib/setup
# Now everything is in RAM, unmount disks
/etc/init.d/modloop stop
umount /dev/sda
# Move the data so scripts can find it
mv /media/setup/* /media/sda/
mv /lib/setup/* /.modloop/

setup-keymap gb gb-extd
setup-hostname crazyhorse
rc-service hostname restart

killall udhcpc
setup-interfaces -a
rc-service networking start
rc-update add networking boot

echo -n "W3lcomeHome55\nW3lcomeHome55" |passwd

setup-timezone -z Europe/London
setup-apkrepos -1

apk add grub-efi efibootmgr

export BOOT_SIZE=512
export SWAP_SIZE=1024
export ROOT_SIZE=10240
export BOOTLOADER=grub
export USE_EFI=1

# setup-disk /dev/sda

