Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on Ubuntu Server #9

Closed
bitinerant opened this issue Oct 21, 2019 · 4 comments
Closed

Not working on Ubuntu Server #9

bitinerant opened this issue Oct 21, 2019 · 4 comments

Comments

@bitinerant
Copy link
Contributor

@bitinerant bitinerant commented Oct 21, 2019

I have been unable to get this working on Ubuntu 18.04 Server on a Raspberry Pi 3.

As far as I can tell, everything is installed correctly (note Ubuntu uses /boot/firmware rather than /boot):

$ uname -a
Linux rpi3 4.15.0-1048-raspi2 #52-Ubuntu SMP PREEMPT Wed Sep 18 08:58:33 UTC 2019 armv7l armv7l armv7l GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.3 LTS
Release:	18.04
Codename:	bionic

$ mount |grep mmc
/dev/mmcblk0p2 on / type ext4 (rw,relatime,data=ordered)
/dev/mmcblk0p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

$ grep initramfs /boot/firmware/config.txt 
#initramfs initrd.img followkernel
initramfs initrd.gz followkernel

$ grep overlay /etc/initramfs-tools/modules
overlay

$ ls -al /etc/initramfs-tools/hooks/hooks-overlay /etc/initramfs-tools/scripts/init-bottom/init-bottom-overlay
-rwxr-xr-x 1 root root  324 Oct 21 14:26 /etc/initramfs-tools/hooks/hooks-overlay
-rwxr-xr-x 1 root root 1973 Oct 21 14:30 /etc/initramfs-tools/scripts/init-bottom/init-bottom-overlay

$ ls -al /boot/firmware/init.gz 
-rwxr-xr-x 1 root root 18609106 Oct 21 15:14 /boot/firmware/init.gz

$ ls -al /usr/share/initramfs-tools/scripts/functions /usr/share/initramfs-tools/hook-functions
-rw-r--r-- 1 root root 22234 Apr 17  2019 /usr/share/initramfs-tools/hook-functions
-rw-r--r-- 1 root root 20067 Dec 12  2018 /usr/share/initramfs-tools/scripts/functions

$ 

However, after rebooting, there is no sign that init-bottom-overlay is even being run:

$ ls -al / |grep overlay

$ cat /var/log/syslog |grep overlay

$ mount |grep overlay

$ cat /proc/cmdline |grep overlay

$ cat /etc/fstab |grep overlay

$ 
@chesty
Copy link
Owner

@chesty chesty commented Oct 22, 2019

Hi, I have an ubuntu desktop but I haven't tried installing this on it.

My ubuntu doesn't have a /boot/firmware, it's initrd images are in /boot, eg /boot/initrd.img-5.0.0-32-generic

On ubuntu I also use update-initramfs -k `uname -r` -u rather than mkinitramfs

Would you like to try backing out the change to made to /boot/firmware/config.txt and use update-initramfs to create the initrd?

@bitinerant
Copy link
Contributor Author

@bitinerant bitinerant commented Oct 22, 2019

@chesty - thank you for the response. :-)

I think only Ubuntu ARM images use /boot/firmware, and maybe only 18.04 and above. I'm not sure.

Your suggestion worked! My assumption that initramfs images go in /boot/firmware was wrong. I undid my config.txt changes, removed /boot/firmware/init.gz, ran sudo update-initramfs -k $(uname -r) -u (which updated /boot/initrd.img-4.15.0-1048-raspi2), and rebooted.

Here are DRAFT install instructions for ARM Ubuntu Server:

sudo vi /etc/initramfs-tools/modules
#in vi, add line: overlay
sudo wget -O /etc/initramfs-tools/hooks/hooks-overlay https://raw.githubusercontent.com/chesty/overlayroot/master/hooks-overlay
sudo wget -O /etc/initramfs-tools/scripts/init-bottom/init-bottom-overlay https://raw.githubusercontent.com/chesty/overlayroot/master/init-bottom-overlay
sudo wget -O /bin/rootwork https://raw.githubusercontent.com/chesty/overlayroot/master/rootwork
sudo chmod +x /bin/rootwork
sudo apt-get install -y busybox  # removes: busybox-static ubuntu-standard
sudo update-initramfs -k $(uname -r) -u
vi ~/.bashrc
#in vi, add line: if [ ! -z "${IMCHROOTED}" ]; then
#in vi, add line:         PS1="chroot(${IMCHROOTED})\w:# "
#in vi, add line: fi
sudo reboot

I'll do additional testing and also rebuild the image from scratch to test my procedure, and then hopefully be able to write beter instructions.

Thanks again.

@chesty
Copy link
Owner

@chesty chesty commented Oct 22, 2019

awesome. nice work. feel free to send me a pull request if you want to add your docs.

this line
sudo apt-get install -y busybox # removes: busybox-static ubuntu-standard

If you already had busybox-static installed, I would keep it if it works OK. I'm assume it's the same thing as busybox but should be more resilient if the file system goes pear shaped.

@bitinerant
Copy link
Contributor Author

@bitinerant bitinerant commented Oct 24, 2019

It's still working well for me, and I updated the documentation as part of PR#11. Closing.

@bitinerant bitinerant closed this Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants