先日ひさしぶりに火を入れたBeagleBone Blackをoverlayroot化してみました。BeagleBone Blackの場合にはhttps://github.com/chesty/overlayroot を使えば非常に簡単でした。
インストール
https://github.com/chesty/overlayroot をcloneしてきて、install.sh をルート権限で実行すると勝手にやってくれます。最初の initramfs を作るあたりが何も表示が出ないので心配になりますが。
2 | Cloning into 'overlayroot' ... |
3 | remote: Enumerating objects: 8, done . |
4 | remote: Counting objects: 100% (8/8), done . |
5 | remote: Compressing objects: 100% (6/6), done . |
6 | remote: Total 92 (delta 2), reused 4 (delta 2), pack-reused 84 |
7 | Unpacking objects: 100% (92/92), done . |
8 | debian@beaglebone:~$ cd overlayroot/ |
9 | debian@beaglebone:~/overlayroot$ sudo ./ install .sh |
10 | grep : /boot/config.txt: No such file or directory |
11 | Reading package lists... Done |
12 | Building dependency tree |
13 | Reading state information... Done |
14 | The following NEW packages will be installed: |
16 | 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. |
17 | Need to get 419 kB of archives. |
18 | After this operation, 630 kB of additional disk space will be used. |
20 | Fetched 419 kB in 0s (4518 kB/s) |
21 | perl: warning: Setting locale failed. |
22 | perl: warning: Please check that your locale settings: |
25 | LC_TIME = "ja_JP.UTF-8" , |
26 | LC_MONETARY = "ja_JP.UTF-8" , |
27 | LC_ADDRESS = "ja_JP.UTF-8" , |
28 | LC_TELEPHONE = "ja_JP.UTF-8" , |
29 | LC_NAME = "ja_JP.UTF-8" , |
30 | LC_MEASUREMENT = "ja_JP.UTF-8" , |
31 | LC_IDENTIFICATION = "ja_JP.UTF-8" , |
32 | LC_NUMERIC = "ja_JP.UTF-8" , |
33 | LC_PAPER = "ja_JP.UTF-8" , |
35 | are supported and installed on your system. |
36 | perl: warning: Falling back to the standard locale ( "C" ). |
37 | locale: Cannot set LC_CTYPE to default locale: No such file or directory |
38 | locale: Cannot set LC_MESSAGES to default locale: No such file or directory |
39 | locale: Cannot set LC_ALL to default locale: No such file or directory |
40 | Selecting previously unselected package busybox. |
41 | (Reading database ... 73157 files and directories currently installed.) |
42 | Preparing to unpack .../busybox_1%3a1.30.1-4_armhf.deb ... |
43 | Unpacking busybox (1:1.30.1-4) ... |
44 | Setting up busybox (1:1.30.1-4) ... |
45 | Processing triggers for man -db (2.8.5-2) ... |
46 | Processing triggers for initramfs-tools (0.133+deb10u1) ... |
47 | update-initramfs: Generating /boot/initrd.img-4.19.94-ti-r42 |
48 | debian@beaglebone:~/overlayroot$ |
これで再起動するとoverlayroot化されていますが、再起動する前に .bashrc をRaspberry Piの時と同様に修正して区別が付くようにしておきます。
アップデートの適用などが必要な場合にはroot権限でoverlay/rootworkを実行するとchrootによってoverlay無しの環境で作業できます。
1 | ~ $ ssh debian@beaglebone.local |
3 | BeagleBoard.org Debian Buster IoT Image 2020-04-06 |
5 | default username:password is [debian:temppwd] |
7 | debian@beaglebone.local's password: |
8 | Last login: Thu Dec 17 13:01:28 2020 from 192.168.1.252 |
10 | *CAUTION*: overlayfs enabled |
11 | debian@beaglebone:~ $ sudo overlayroot/rootwork |
12 | root@beaglebone:/# mount |
13 | /dev/mmcblk0p1 on / type ext4 (rw,relatime) |
14 | tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=49504k,mode=755) |
15 | tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) |
16 | sysfs on /sys type sysfs (rw,relatime) |
17 | proc on /proc type proc (rw,relatime) |
18 | devtmpfs on /dev type devtmpfs (rw,relatime,size=218800k,nr_inodes=54700,mode=755) |
19 | root@beaglebone:/# sudo apt update |
21 | 2 packages can be upgraded. Run 'apt list --upgradable' to see them. |
22 | root@beaglebone:/# sudo apt upgrade |
24 | root@beaglebone:/# exit |
25 | mount: /overlay/lower: mount point is busy. |
26 | Failed to remount /overlay/lower read-only, possibly because of an open file. |
27 | The best thing to do would be to reboot now |
28 | debian@beaglebone:~ $ sudo reboot |