10-06-2018, 05:42 PM
(10-06-2018, 07:37 AM)khaosgrille Wrote:If you use a microSD card of smaller size the kernel will complaint that part of the filesystem is outside the device. You will have to make a custom disk image, copy the first 6 partitions, create the 7th, format it as your favourite filesystem, mount it, and copy the files.(10-06-2018, 07:23 AM)zener Wrote: I gave it a try, but I does not respond to ping when I boot.
The Ubuntu image responds to ping and let me log in on ssh. But the gentoo image does not even respond to ping.
Is it set up to run DHCP?
Thanks!
Nope I didnt do it/ tried it yet. I will make a new image with DHCP setup. Since I am busy right now it may take 2 weeks or so.
-Unpack the file, let's to use sparse files to avoid wasting disk space with zeroes
$ xz -dc gentoo2.xz | dd of=gentoo2 conv=sparse
-Check the partition table with "parted"
$ parted gentoo2
...
(parted) unit b
(parted) print
Model: (file)
Disk /home/jose/rockpro64/stretch-minimal-rockpro64-0.7.9-1067-arm64.img: 2144337920B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 32768B 4128767B 4096000B loader1
2 4128768B 4194303B 65536B reserved1
3 4194304B 8388607B 4194304B reserved2
4 8388608B 12582911B 4194304B loader2
5 12582912B 16777215B 4194304B atf
6 16777216B 134217727B 117440512B fat16 boot msftdata
7 134217728B 2143289343B 2009071616B ext4 root legacy_boot
(parted) quit
-Create an empty disk image for your SD card, for example 16000000000 bytes
$ truncate -s 16000000000 sd.raw
-Copy the partition table and the first 6 partitions
$ dd if=gentoo2 of=sd.raw bs=134217728 count=1
-Make the filesystem for the seventh partition
$ mke2fs -t ext4 -E offset=134217728 sd.raw $[16000000000-134217728]
-Become root
-Mount the 7th partition of both images
# mkdir tmp tmp2
# mount -o loop,offset=134217728 gentoo2 tmp
# mount -o loop,offset=134217728 sd.raw tmp2
-Copy the files
# cp -a tmp/* tmp2
-Unmount
# umount tmp
# umount tmp2
# rmdir tmp tmp2
-Done