careyjames
Posts: 8
Joined: Mon Nov 16, 2015 10:40 pm

boot stuck at "random: nonblocking pool is initiated"

Mon Nov 16, 2015 10:46 pm

Stuck on booting up at "random: nonblocking pool is initiated" after fresh install...

Raspberry Pi 2 kali linux 2.0 with encrypted luks and early dropbear ssh

I did the encypted install with dropbear ssh kali 2
# https://www.offensive-security.com/k...sk-encryption/

#this line is in the cmdline.txt
dwc_otg.fiq_fix_enable=2 console=tty1 console=tty1 root=/dev/mapper/crypt_sdcard cryptdevice=/dev/mmcblk0p2:crypt_sdcard rootfstype=ext4 rootwait rootflags=noload


#I wonder if the "rootwait & rootflags=noload" really needs to be there at the end?????

#I also noticed that my config.txt is blank also when i open it...
#I wonder if in this step:
echo initramfs initramfs.gz 0x00f00000 & /boot/config.txt

#was anything supposed to make it into the config.txt file?

User avatar
rpdom
Posts: 12949
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 6:44 am

Almost certainly that line was supposed to be something like

Code: Select all

echo initramfs initramfs.gz 0x00f00000 >> /boot/config.txt
which will add "initramfs initramfs.gz 0x00f00000" to the end of the config.txt file.

Without that line the bootloader won't know to load the initial ram filesystem containing the code needed to access your encrypted file system. Try adding that line.

careyjames
Posts: 8
Joined: Mon Nov 16, 2015 10:40 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 2:40 pm

so some show a ">>" and on the blog page they show a "&" and I've also seen ">"

so which is correct thing for in-between the 0x00f00000 "?" /boot/config.txt

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 3:31 pm

The one that works :)

careyjames
Posts: 8
Joined: Mon Nov 16, 2015 10:40 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 3:40 pm

the one what? are you saying there should be one ">" ?

careyjames
Posts: 8
Joined: Mon Nov 16, 2015 10:40 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 3:41 pm

#so this is the EXACT command to send that text into config.txt????

echo initramfs initramfs.gz 0x00f00000 > /boot/config.tx

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5372
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 3:46 pm

careyjames wrote:so this is the EXACT command to send that text into config.txt????
rpdom wrote: echo initramfs initramfs.gz 0x00f00000 >> /boot/config.txt
It's worth getting to grips with the linux shell so that you understand what >>, > and & are.
https://www.raspberrypi.org/magpi-issue ... ash_v1.pdf

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 3:52 pm

& means run in the background
> means overwrite (truncate)
>> means append
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 3:56 pm

I'm surprised that no one has "strongly suggested" (as is the custom around here) that OP (or anyone else) should really not be using things like "echo" and redirection to edit the boot configuration files.

Surely, using a regular editor is much more likely to work and much more likely to make sense - that is, you can see what you are doing and are able to adjust accordingly if things aren't as you expect.

The editor more commonly recommended around here is something called "nano", but I see no value in using that. If you want GUI, you should use "leafpad".
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

fruit-uk
Posts: 609
Joined: Wed Aug 06, 2014 4:19 pm
Location: Suffolk, UK

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 4:39 pm

Joe Schmoe wrote:I'm surprised that no one has "strongly suggested" (as is the custom around here) that OP (or anyone else) should really not be using things like "echo" and redirection to edit the boot configuration files
Read the OP, he's following a script and asked for advice, that's hardly other posters suggesting he uses those commands

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 4:50 pm

fruit-uk wrote:
Joe Schmoe wrote:I'm surprised that no one has "strongly suggested" (as is the custom around here) that OP (or anyone else) should really not be using things like "echo" and redirection to edit the boot configuration files
Read the OP, he's following a script and asked for advice, that's hardly other posters suggesting he uses those commands
Irrelevant.

It is standard on these support boards/forums that if someone is doing something wrong, we chime in and tell them to do it an entirely different way. Or not to do it at all (see any/all items about running Windows on the Pi; they all get an immediate response from Dougie telling them something about lawn mowers and trucks, er, lorries).
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

careyjames
Posts: 8
Joined: Mon Nov 16, 2015 10:40 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 9:11 pm

ok so, i went thru with your help and modified a few things...

here is my list of commands/actions... that i changed from their tutorial here:
https://www.offensive-security.com/kali ... ncryption/

mkdir -p /mnt/chroot/boot
mount /dev/mmcblk0p2 /mnt/chroot/
mount /dev/mmcblk0p1 /mnt/chroot/boot/
mount -t proc none /mnt/chroot/proc
mount -t sysfs none /mnt/chroot/sys
mount -o bind /dev /mnt/chroot/dev
mount -o bind /dev/pts /mnt/chroot/dev/pts
cp /usr/bin/qemu-arm-static /mnt/chroot/usr/bin/
LANG=C chroot /mnt/chroot/

mkinitramfs -o /boot/initramfs.gz 3.18.16-v7

update-rc.d ssh enable
passwd

nano /boot/cmdline.txt

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMAO,115200 console=tty1 elevator=deadline root=/dev/mapper/crypt_sdcard cryptdevice=/dev/mmcblk0p2:crypt_sdcard rootfstype=ext4 rootwait

nano /boot/config.txt

initramfs initramfs.gz 0x00f00000

cat /etc/initramfs-tools/root/.ssh/id_rsa

nano key

nano /etc/initramfs-tools/root/.ssh/authorized_keys

command="/scripts/local-top/cryptroot && kill -9 `ps | grep -m 1 'cryptroot' | cut -d ' ' -f 3`"

nano /etc/fstab

proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mapper/crypt_sdcard / ext4 defaults,noatime 0 1
/dev/mmcblk0p3 swap swap defaults 0 0

nano /etc/crypttab

crypt_sdcard /dev/mmcblk0p2 none luks

nano /usr/share/initramfs-tools/scripts/init-premount/dropbear

echo "Waiting 5 seconds for USB to wake"
sleep 5

mkinitramfs -o /boot/initramfs.gz 3.18.16-v7

exit

umount /mnt/chroot/boot
umount /mnt/chroot/sys
umount /mnt/chroot/proc
mkdir -p /mnt/backup
rsync -avh /mnt/chroot/* /mnt/backup/

umount /mnt/chroot/dev/pts
umount /mnt/chroot/dev
umount /mnt/chroot

echo -e "d\n2\nw" | fdisk /dev/mmcblk0

echo -e "n\np\n2\n\n\nw" | fdisk /dev/mmcblk0

fdisk -l /dev/mmcblk0

cryptsetup -v -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/mmcblk0p2

cryptsetup -v luksOpen /dev/mmcblk0p2 crypt_sdcard

mkfs.ext4 /dev/mapper/crypt_sdcard

mkdir -p /mnt/encrypted
mount /dev/mapper/crypt_sdcard /mnt/encrypted/
rsync -avh /mnt/backup/* /mnt/encrypted/
umount /mnt/encrypted/
rm -rf /mnt/backup
sync

cryptsetup luksClose /dev/mapper/crypt_sdcard

cryptsetup luksAddNuke /dev/mmcblk0p2

********and it booted in the pi but got caught in a loop that said:

/sbin/cryptsetup: not found
cryptsetup: cryptsetup failed, bad password or options?
/scripts/local-top/cryptroot: /scripts/local-top/cryptroot: line 1: line 1: /lib/crypt/askpass: not found/sbin/cryptsetup: not found

over and over and over again until it stopped and said:

gave up waiting for root device common problems:
boot args (cat /proc/cmdline)
missing modules (cat /proc/modules; Is /dev)
ALERT! /dev/mapper/crypt_sdcard does not exist
dropping to a shell


so it never asked me for a password... to unlock luks

careyjames
Posts: 8
Joined: Mon Nov 16, 2015 10:40 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Tue Nov 17, 2015 9:35 pm

this line that they as us to add before the ssh key:

nano /etc/initramfs-tools/root/.ssh/authorized_keys

command="/scripts/local-top/cryptroot && kill -9 `ps | grep -m 1 'cryptroot' | cut -d ' ' -f 3`"


i notice on the sd there is no /scripts/local-top/ folder...


noahspurrier
Posts: 1
Joined: Thu Dec 06, 2018 2:01 pm

Re: boot stuck at "random: nonblocking pool is initiated"

Thu Dec 06, 2018 2:08 pm

Removing
dwc_otg.fiq_fix_enable=2
from cmdline.txt fixed it for me. Setting it to 2 doesn't make sense. Yes, anything not zero is true, but setting it to 2 makes it appear that this was a mistake. At any rate it fixed it for me.

Return to “Debian”