Follow this instructions with active chroot, first mount partitions and before chroot mount follow file systems;
$ sudo mount --bind /dev $CHROOT/dev $ sudo mount -vt devpts devpts $CHROOT/dev/pts $ sudo mount -vt tmpfs shm $CHROOT/dev/shm $ sudo mount -vt proc proc $CHROOT/proc $ sudo mount -vt sysfs sysfs $CHROOT/sys
Now you can chroot;
$ sudo chroot $CHROOT /usr/bin/env -i \ HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login
Install kernel with default crux configuration using pkgutils;
# cd /usr/ports/c9-ports/linux-crux # pkgmk -d # pkgadd /usr/ports/packages/linux-crux#4.1.30-1.pkg.tar.gz
Install dracut;
# cd /usr/ports/c9-ports/dracut # pkgmk -d # pkgadd /usr/ports/packages/dracut#044-2.pkg.tar.gz
Run dracut to create init ram filesystem;
# dracut -v -H --fstab /boot/initramfs-4.1.30-crux.img 4.1.30-crux
Create grub file in /etc/default/grub with values;
GRUB_DISABLE_LINUX_UUID=false GRUB_ENABLE_LINUX_LABEL=false
Grub Manual, install grub on MBR of disk sdb;
# grub-install /dev/sdb Installation finished. No error reported.
If you are installing on removable media;
# grub-install --removable /dev/sdb Installation finished. No error reported.
grub-mkconfig generates grub.cfg, it will try to discover available kernels and attempt to generate menu entries for them;
# grub-mkconfig -o /boot/grub/grub.cfg Generating grub.cfg ... Found linux image: /boot/vmlinuz-4.1.30-crux Found initrd image: /boot/initramfs-4.1.30-crux.img done #
Check /boot/grub/grub.cfg, if is wrong add menu to /etc/grub.d/40_custom, replace correct msdos partition from grub-prob output and correct UUID from fstab or blkid
# grub-probe --target=hints_string /
If you have qemu installed you can see if it boots, in this example sdb is usb external drive;
# qemu-system-x86_64 -curses -usb -usbdevice disk:/dev/sdb
# qemu-system-x86_64 -kernel /boot/vmlinuz-linux -initrd /boot/initramfs-linux.img -append root=/dev/sdb /dev/sdb2
# qemu-img convert crux-img.qcow2 -O raw crux.img # dd if=crux.img of=/dev/sdXCore OS Index
This is part of the c9-doc Manual. Copyright (C) 2016 c9 team. See the file Gnu Free Documentation License for copying conditions.