トップ 一覧 Farm 検索 ヘルプ RSS ログイン

Diary/2022-12-10の変更点

  • 追加された行はこのように表示されます。
  • 削除された行はこのように表示されます。
!KV260のoverlayroot化

Ubuntu 22.04とPYNQをセットアップしたKV260で,
行儀悪く電源をオフしたりリブートしたりできるようにoverlayroot化.

やることは単純で,まず,おそらく既にインストール済みだけど,
 $ sudo apt install overlayroot
として,overlayrootをインストールあるいは意図してインストールしたものとしてマーク.
インストールしたら,/etc/overlayroot.conf の最後の行に
 overlayroot=""
とあるのを
 overlayroot="tmpfs"
に変更してリブートすればいい.
リブートすると,
 tmpfs-root /media/root-rw tmpfs rw,relatime,inode64 0 0
 overlayroot /var/snap/firefox/common/host-hunspell overlay ro,noexec,noatime,lowerdir=/media/root-ro,upperdir=/media/root-rw/overlay,workdir=/media/root-rw/overlay-workdir/_ 0 0
 overlayroot / overlay rw,relatime,lowerdir=/media/root-ro,upperdir=/media/root-rw/overlay,workdir=/media/root-rw/overlay-workdir/_ 0 0
 /dev/mmcblk1p2 /media/root-ro ext4 ro,relatime 0 0
とか表示されてオーバーレイされてそう.


mountコマンド叩いてみるとリブート前は,
 sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
 proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
 udev on /dev type devtmpfs (rw,nosuid,relatime,size=1452052k,nr_inodes=363013,mode=755,inode64)
 devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
 tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=400036k,mode=755,inode64)
 /dev/mmcblk1p2 on / type ext4 (rw,relatime,discard,errors=remount-ro)
 securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
 tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
 tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
 cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
 pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
 bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
 systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=23919)
 mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
 hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
 debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
 tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
 fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
 configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
 none on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
 /var/lib/snapd/snaps/bare_5.snap on /snap/bare/5 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/core20_1522.snap on /snap/core20/1522 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/core20_1740.snap on /snap/core20/1740 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/firefox_1440.snap on /snap/firefox/1440 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/firefox_2155.snap on /snap/firefox/2155 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gnome-3-38-2004_107.snap on /snap/gnome-3-38-2004/107 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gnome-3-38-2004_122.snap on /snap/gnome-3-38-2004/122 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gtk-common-themes_1534.snap on /snap/gtk-common-themes/1534 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gtk-common-themes_1535.snap on /snap/gtk-common-themes/1535 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snap-store_581.snap on /snap/snap-store/581 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snap-store_639.snap on /snap/snap-store/639 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snapd_17885.snap on /snap/snapd/17885 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snapd-desktop-integration_15.snap on /snap/snapd-desktop-integration/15 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snapd-desktop-integration_44.snap on /snap/snapd-desktop-integration/44 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /dev/mmcblk1p2 on /var/snap/firefox/common/host-hunspell type ext4 (ro,noexec,noatime,discard,errors=remount-ro)
 /dev/mmcblk1p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
 sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
 binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
 configfs on /configfs type configfs (rw,relatime)
 tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=400032k,nr_inodes=100008,mode=700,uid=1000,gid=1000,inode64)
 portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
 tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,nodev,noexec,relatime,size=400036k,mode=755,inode64)
 gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
 nsfs on /run/snapd/ns/snapd-desktop-integration.mnt type nsfs (rw)
となっているが,
 sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
 proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
 udev on /dev type devtmpfs (rw,nosuid,relatime,size=1452052k,nr_inodes=363013,mode=755,inode64)
 devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
 tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=400036k,mode=755,inode64)
 /dev/mmcblk1p2 on /media/root-ro type ext4 (ro,relatime)
 tmpfs-root on /media/root-rw type tmpfs (rw,relatime,inode64)
 overlayroot on / type overlay (rw,relatime,lowerdir=/media/root-ro,upperdir=/media/root-rw/overlay,workdir=/media/root-rw/overlay-workdir/_)
 securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
 tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
 tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
 cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
 pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
 bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
 systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=26273)
 mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
 hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
 debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
 tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
 fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
 configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
 none on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
 /var/lib/snapd/snaps/bare_5.snap on /snap/bare/5 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/core20_1522.snap on /snap/core20/1522 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/core20_1740.snap on /snap/core20/1740 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/firefox_1440.snap on /snap/firefox/1440 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/firefox_2155.snap on /snap/firefox/2155 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gnome-3-38-2004_107.snap on /snap/gnome-3-38-2004/107 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gnome-3-38-2004_122.snap on /snap/gnome-3-38-2004/122 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gtk-common-themes_1534.snap on /snap/gtk-common-themes/1534 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/gtk-common-themes_1535.snap on /snap/gtk-common-themes/1535 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snap-store_581.snap on /snap/snap-store/581 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snap-store_639.snap on /snap/snap-store/639 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snapd_17885.snap on /snap/snapd/17885 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snapd-desktop-integration_15.snap on /snap/snapd-desktop-integration/15 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 /var/lib/snapd/snaps/snapd-desktop-integration_44.snap on /snap/snapd-desktop-integration/44 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
 overlayroot on /var/snap/firefox/common/host-hunspell type overlay (ro,noexec,noatime,lowerdir=/media/root-ro,upperdir=/media/root-rw/overlay,workdir=/media/root-rw/overlay-workdir/_)
 /dev/mmcblk1p1 on /boot/firmware type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
 sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
 binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
 configfs on /configfs type configfs (rw,relatime)
 tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=400032k,nr_inodes=100008,mode=700,uid=1000,gid=1000,inode64)
 gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
 portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
 tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,nodev,noexec,relatime,size=400036k,mode=755,inode64)
 nsfs on /run/snapd/ns/snapd-desktop-integration.mnt type nsfs (rw)
となっている.

overlayroot環境下で実行中にファイルに恒久的な変更をしたくなったら
 $ overlayroot-chroot
とかするとよい.