I needed to "inject" a first-boot script into the Raspbian image so I needed to "crack open" the .img file in order to add something to /etc/init/rc.local. I came across this article on how to do it: https://raspberrypi.stackexchange.com/questions/13137/how-can-i-mount-a-raspberry-pi-linux-distro-image
Here are the offsets and commands to mount up the Raspbian 2018-11-13 image:
fdisk -l 2018-11-13-raspbian-stretch.img
Disk 2018-11-13-raspbian-stretch.img: 3405 MB, 3405774848 bytes, 6651904 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x025ce4e3
Device Boot Start End Blocks Id System
2018-11-13-raspbian-stretch.img1 8192 98045 44927 c W95 FAT32 (LBA)
2018-11-13-raspbian-stretch.img2 98304 6651903 3276800 83 Linux
512 * 8192 = 4194304
512 * 98304 = 50331648
mkdir /mnt/img
mkdir /mnt/img/one
mkdir /mnt/img/two
mount -v -o offset=4194304 -t vfat 2018-11-13-raspbian-stretch.img /mnt/img/one
mount -v -o offset=50331648 -t ext4 2018-11-13-raspbian-stretch.img /mnt/img/two
Saturday, February 9, 2019
Subscribe to:
Posts (Atom)
Current Audible Reading List
Title You Never Forget Your First: A Biography of George Washington A Self-Made Man: The Politica...
-
As part of a project I'm working on right now I wanted to know what the "optimal" settings were for running OpenVAS on an ODRO...
-
By default the OPenVAS security assistant listens on port 80 and redirects connections to port 9392, this causes issues if you want to run a...
-
I often have need to use Tor for various testing purposes, mainly to determine how an adversary uses it, and I often just want to run it fro...