Skip to content

a bash script to chroot to a rootfs with Network setup, make it easy to use APT and modifiy rootfs.

Notifications You must be signed in to change notification settings

xuminready/chroot_rootfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

chroot_rootfs

a bash script to chroot to a rootfs/*img with Network setup, make it easy to use APT and modifiy rootfs.

usage

same architecture

sudo ./chroot_rootfs.sh rootfs
sudo ./chroot_rootfs.sh rootfs.img

foreign architecture

if you want to chroot to a foreign filesystem, install qemu-user-static. For Ubuntu/Debian, you can use: apt-get install qemu qemu-user-static binfmt-support

sudo ./chroot_rootfs.sh arm_rootfs arm
sudo ./chroot_rootfs.sh aarch64_rootfs.img aarch64

In case running out of space for the partition on the disk image. We may need to add space to the disk image and expand the rootfs partition.

Resizing partition

qemu-img resize rootfs.img +1024M

or

sudo dd if=/dev/zero bs=1M count=1024 >> rootfs.img

Expand the filesystem

use Ubuntu Disk Utility, GParted, or parted to expand the filesystem

RaspberryPi qemu-user-static

About

a bash script to chroot to a rootfs with Network setup, make it easy to use APT and modifiy rootfs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages