Skip to content

Commit 7bad57c

Browse files
authored
Merge pull request #11 from bitinerant/master
add support for Ubuntu for ARM
2 parents ca1c9e5 + d79d24b commit 7bad57c

File tree

2 files changed

+50
-9
lines changed

2 files changed

+50
-9
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ I use this for my Raspberry Pi, but it should work on any Debian or derivative.
66
The root file system on the sd-card is mounted read-only on /overlay/lower, and / is a
77
read-write copy on write overlay.
88

9+
There are two sets of instructions below: [Raspbian](#raspbian) and [Ubuntu for ARM](#ubuntu-for-arm).
10+
11+
## Raspbian
12+
913
It uses initramfs. Stock Raspbian doesn't use one so step one would be to get initramfs working.
1014
Something like:
1115

@@ -39,6 +43,33 @@ then rerun
3943
```bash
4044
sudo mkinitramfs -o /boot/init.gz
4145
```
46+
Now skip down to [all distributions](#all-distributions) to finish the installation.
47+
48+
## Ubuntu for ARM
49+
50+
Add the following line to /etc/initramfs-tools/modules
51+
```
52+
overlay
53+
```
54+
55+
Copy the following files
56+
- hooks-overlay to /etc/initramfs-tools/hooks/
57+
- init-bottom-overlay to /etc/initramfs-tools/scripts/init-bottom/
58+
59+
install busybox-static
60+
```bash
61+
sudo apt-get install busybox-static
62+
```
63+
64+
then run
65+
66+
```bash
67+
sudo update-initramfs -k $(uname -r) -u
68+
```
69+
70+
Now continue to [all distributions](#all-distributions) to finish the installation.
71+
72+
## all distributions
4273

4374
add to .bashrc
4475

@@ -72,12 +103,18 @@ It's probably a good idea to reboot now for 2 reasons:
72103
- leaving /overlay/lower read-write could cause file corruption on power loss.
73104
- to test it still boots ok after the changes you've just made.
74105

75-
Whenever the kernel is updated you need to rerun
106+
Whenever the kernel is updated, for Raspbian you need to rerun
76107

77108
```bash
78109
sudo mkinitramfs -o /boot/init.gz
79110
```
80111

112+
and for Ubuntu for ARM
113+
114+
```bash
115+
sudo update-initramfs -k $(uname -r) -u
116+
```
117+
81118
TODO: see if there's a hook to automatically run `sudo mkinitramfs -o /boot/init.gz`
82119
on kernel install
83120

rootwork

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ test_mountpoints () {
5656
}
5757

5858
mount -o remount,rw "$ROOT" || { echo "error remounting $ROOT rw"; exit 1; }
59-
if is_mounted /boot; then
60-
mount -o remount,rw /boot || { echo "error remounting /boot rw"; exit 1; }
61-
fi
59+
for DIR in boot boot/firmware; do
60+
if is_mounted "/$DIR"; then
61+
mount -o remount,rw "/$DIR" || { echo "error remounting \"/$DIR\" rw"; exit 1; }
62+
fi
63+
done
6264

63-
for DIR in boot run; do
65+
for DIR in boot boot/firmware run; do
6466
if test_mountpoints "/$DIR" "$ROOT/$DIR"; then
6567
mount --rbind "/$DIR" "$ROOT/$DIR"
6668
fi
@@ -90,15 +92,17 @@ fi
9092

9193
# with mount --rbind /run $ROOT/run, umounting $ROOT/run is problematic as it's busy and if you umount -lf it umounts directories in /run/.
9294
# I think because / is an overlay of $ROOT. So we don't unmount $ROOT/run
93-
for DIR in boot; do
95+
for DIR in boot/firmware boot; do
9496
if is_mounted "$ROOT/$DIR"; then
9597
umount -lf "$ROOT/$DIR"
9698
fi
9799
done
98100

99-
if is_mounted /boot; then
100-
mount -o remount,ro /boot
101-
fi
101+
for DIR in boot/firmware boot; do
102+
if is_mounted "/$DIR"; then
103+
mount -o remount,ro "/$DIR"
104+
fi
105+
done
102106

103107
mount -o remount,ro "$ROOT" || {
104108
echo "Failed to remount $ROOT read-only, possibly because of an open file."

0 commit comments

Comments
 (0)