Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For RPi 4, sfdisk command not found #7

Closed
dhogaivannan opened this issue Aug 11, 2020 · 17 comments
Closed

For RPi 4, sfdisk command not found #7

dhogaivannan opened this issue Aug 11, 2020 · 17 comments

Comments

@dhogaivannan
Copy link

dhogaivannan commented Aug 11, 2020

As I tried to build using make build-rpi, i faced this error

pi@raspberrypi ~/docker-openwrt> make build-rpi RPI_SOURCE_IMG=openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img
./build-rpi.sh openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img
* mounting image
./build-rpi.sh: line 18: sfdisk: command not found
./build-rpi.sh: line 21: 512 * : syntax error: operand expected (error token is "* ")
* building Docker image
Sending build context to Docker daemon  1.583kB
Step 1/7 : FROM scratch
 ---> 
Step 2/7 : COPY . .
 ---> Using cache
 ---> 038182f6fc5f
Step 3/7 : ARG ROOT_PW
 ---> Using cache
 ---> 7d5abb2bb6fa
Step 4/7 : RUN echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd
 ---> Running in 75dc8fe1eebc
OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
* cleaning up
umount: ./tmp.Du5nc6jCkJ: not mounted.
make: *** [Makefile:15: build-rpi] Error 32

While trying to skip that issue by running either in sudo or sudo -s, I ended up facing this -

root@raspberrypi /h/p/docker-openwrt# make build-rpi RPI_SOURCE_IMG=openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img
./build-rpi.sh openwrt-bcm27xx-bcm2711-rpi-4-squashfs-factory.img
* mounting image
mount: /home/pi/docker-openwrt/tmp.k46Z6c0N7d: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
* cleaning up
umount: ./tmp.k46Z6c0N7d: not mounted.
make: *** [Makefile:15: build-rpi] Error 32

Is this error related somewhat related to snapshot builds or not related to it?

@oofnikj
Copy link
Owner

oofnikj commented Aug 11, 2020

Hi @dhogaivannan , you need to have sfdisk installed. For Raspbian I believe you can install it by

$ sudo apt-get install fdisk

@dhogaivannan
Copy link
Author

Hi @dhogaivannan , you need to have sfdisk installed. For Raspbian I believe you can install it by

$ sudo apt-get install fdisk

Well, that issue was solved as running in sudo fixed it, what about the second part of code, that seems new

@oofnikj
Copy link
Owner

oofnikj commented Aug 11, 2020

Running with sudo did not fix the first problem. The script is not supposed to be run with sudo. You still have to have sfdisk installed.

@dhogaivannan
Copy link
Author

Running with sudo did not fix the first problem. The script is not supposed to be run with sudo. You still have to have sfdisk installed.

Still no clue

pi@raspberrypi ~/docker-openwrt> sudo apt-get install fdisk
Reading package lists... Done
Building dependency tree       
Reading state information... Done
fdisk is already the newest version (2.33.1-0.1).
The following package was automatically installed and is no longer required:
  rpi-eeprom-images
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~/docker-openwrt> make build-rpi RPI_SOURCE_IMG=openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img
./build-rpi.sh openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img
* mounting image
./build-rpi.sh: line 18: sfdisk: command not found
./build-rpi.sh: line 21: 512 * : syntax error: operand expected (error token is "* ")
* building Docker image
Sending build context to Docker daemon  1.583kB
Step 1/7 : FROM scratch
 ---> 
Step 2/7 : COPY . .
 ---> Using cache
 ---> 453cf7d4f825
Step 3/7 : ARG ROOT_PW
 ---> Using cache
 ---> 61e6978442d6
Step 4/7 : RUN echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd
 ---> Running in 12484afe59a3
OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown
* cleaning up
umount: ./tmp.DTYDE05UwS: not mounted.
make: *** [Makefile:15: build-rpi] Error 32

Same error again, any idea?

@oofnikj
Copy link
Owner

oofnikj commented Aug 12, 2020

That's very odd, as I just checked the latest base Raspberry Pi OS image and sfdisk is included.
Are you using a different OS?

Can you share the output of the following commands (one by one)?:

lsb_release -a
dpkg -l fdisk | grep sfdisk
which sfdisk
echo $PATH

@dhogaivannan
Copy link
Author

Yeah sure thing!

lsb_release -a

pi@raspberrypi ~/docker-openwrt> lsb_release -a                                                                        
 No LSB modules are available.                                                                                           
Distributor ID: Raspbian                                                                                                
Description:    Raspbian GNU/Linux 10 (buster)                                                                          
Release:        10                                                                                                     
Codename:       buster

dpkg -l fdisk | grep sfdisk
which sfdisk
echo $PATH

pi@raspberrypi ~/docker-openwrt> dpkg -l fdisk | grep sfdisk                                                            
pi@raspberrypi ~/docker-openwrt> which sfdisk                                                                           
pi@raspberrypi ~/docker-openwrt> echo $PATH                                                                             
/usr/local/bin /usr/bin /bin /usr/games                                               

@hllhll
Copy link

hllhll commented Aug 19, 2020

Same here, it's not a sfdisk problem for me, rather the image does not mount, even when I tried manually with the proper offset. The pi4 image does not mount

@hllhll
Copy link

hllhll commented Aug 19, 2020

Ok, I Was able to troubleshoot this.
The filesystem of the 2nd paratition in the Rpi4 images are squashfs, not ext4; So, youll have to replace -t ext4 with -t squashfs in mount_rootfs()
Additional thing that might also cause problem is that they truncate 0's from the file, So I had to inflate the file according to what the partition table says (Not sure this is needed, tough)

But now I'm having

Step 4/7 : RUN echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd
 ---> Running in 0d71e1801eab
standard_init_linux.go:211: exec user process caused "exec format error"
The command '/bin/sh -c echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd' returned a non-zero code: 1
* cleaning up
make: *** [Makefile:15: build-rpi] Error 1

Edit: The issue here is that the pi4 openwrt image has 64bit kernel; which the standard raspberry pi 4 os does not comes with...

@dhogaivannan
Copy link
Author

Ok, I Was able to troubleshoot this.
The filesystem of the 2nd paratition in the Rpi4 images are squashfs, not ext4; So, youll have to replace -t ext4 with -t squashfs in mount_rootfs()
Additional thing that might also cause problem is that they truncate 0's from the file, So I had to inflate the file according to what the partition table says (Not sure this is needed, tough)

But now I'm having

Step 4/7 : RUN echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd
 ---> Running in 0d71e1801eab
standard_init_linux.go:211: exec user process caused "exec format error"
The command '/bin/sh -c echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd' returned a non-zero code: 1
* cleaning up
make: *** [Makefile:15: build-rpi] Error 1

Edit: The issue here is that the pi4 openwrt image has 64bit kernel; which the standard raspberry pi 4 os does not comes with...

Hey, that's pretty good!
Well for the 64bit kernel issue, you could give a try in Ubuntu 20 LTS which has 64bit kernel I think , I faced different issue while trying to run that over there, let me know how your build goes.

ubuntu@ubuntu ~/docker-openwrt (master)> make build-rpi RPI_SOURCE_IMG=openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img
./build-rpi.sh openwrt-bcm27xx-bcm2711-rpi-4-ext4-factory.img
* mounting image
* building Docker image
Sending build context to Docker daemon  13.99MB
Step 1/7 : FROM scratch
 --->
Step 2/7 : COPY . .
 ---> Using cache
 ---> 23f0e8d504cc
Step 3/7 : ARG ROOT_PW
 ---> Using cache
 ---> d895d1f8a9ad
Step 4/7 : RUN echo -e "${ROOT_PW}\n${ROOT_PW}" | passwd
 ---> Using cache
 ---> 3ef6f9766359
Step 5/7 : RUN mkdir -p /var/lock
 ---> Using cache
 ---> 9f2455106aa5
Step 6/7 : RUN opkg update &&     opkg install       iperf3       ip-full &&     opkg list-upgradable | awk '{print $1}' | xargs opkg upgrade
 ---> Running in 3d2d996ef3db
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/kmods/5.4.52-1-6b9b38032e2b529d6fd8d86a546ac48f/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_kmods
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/kmods/5.4.52-1-6b9b38032e2b529d6fd8d86a546ac48f/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/freifunk/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_freifunk
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/freifunk/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/telephony/Packages.sig
Signature check passed.
Installing iperf3 (3.7-1) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/iperf3_3.7-1_aarch64_cortex-a72.ipk
Installing ip-full (5.7.0-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/ip-full_5.7.0-2_aarch64_cortex-a72.ipk
Installing zlib (1.2.11-3) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/zlib_1.2.11-3_aarch64_cortex-a72.ipk
Installing libelf1 (0.179-1) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/libelf1_0.179-1_aarch64_cortex-a72.ipk
Installing libmnl0 (1.0.4-2) to root...
Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/base/libmnl0_1.0.4-2_aarch64_cortex-a72.ipk
Configuring zlib.
Configuring libelf1.
Configuring libmnl0.
Configuring ip-full.
Configuring iperf3.
Upgrading kmod-usb-core on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-usb-core_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-sound-arm-bcm2835 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-sound-arm-bcm2835_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-reject6 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-reject6_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-flow on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-flow_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-lib-crc-ccitt on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-lib-crc-ccitt_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-pppoe on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-pppoe_5.4.58-1_aarch64_cortex-a72.ipkFailed to connect to ubus
Failed to connect to ubus
umount: can't unmount /sys/firmware: Operation not permitted
umount: can't unmount /proc/scsi: Operation not permitted
umount: can't unmount /proc/sched_debug: Operation not permitted
umount: can't unmount /proc/timer_list: Operation not permitted
umount: can't unmount /proc/latency_stats: Operation not permitted
umount: can't unmount /proc/keys: Operation not permitted
umount: can't unmount /proc/kcore: Operation not permitted
umount: can't unmount /proc/asound: Operation not permitted
umount: can't unmount /proc/sysrq-trigger: Operation not permitted
umount: can't unmount /proc/sys: Operation not permitted
umount: can't unmount /proc/irq: Operation not permitted
umount: can't unmount /proc/fs: Operation not permitted
umount: can't unmount /proc/bus: Operation not permitted
umount: can't unmount /etc/hosts: Operation not permitted
umount: can't unmount /etc/hostname: Operation not permitted
umount: can't unmount /etc/resolv.conf: Operation not permitted
umount: can't unmount /dev/shm: Operation not permitted
umount: can't unmount /dev/mqueue: Operation not permitted
umount: can't unmount /sys/fs/cgroup/blkio: Operation not permitted
umount: can't unmount /sys/fs/cgroup/devices: Operation not permitted
umount: can't unmount /sys/fs/cgroup/perf_event: Operation not permitted
umount: can't unmount /sys/fs/cgroup/net_cls,net_prio: Operation not permitted
umount: can't unmount /sys/fs/cgroup/cpuset: Operation not permitted
umount: can't unmount /sys/fs/cgroup/freezer: Operation not permitted
umount: can't unmount /sys/fs/cgroup/cpu,cpuacct: Operation not permitted
umount: can't unmount /sys/fs/cgroup/rdma: Operation not permitted
umount: can't unmount /sys/fs/cgroup/pids: Operation not permitted
umount: can't unmount /sys/fs/cgroup/systemd: Operation not permitted
umount: can't unmount /sys/fs/cgroup: Operation not permitted
umount: can't unmount /sys: Operation not permitted
umount: can't unmount /dev/pts: Operation not permitted
umount: can't unmount /dev: Operation not permitted
umount: can't unmount /proc: Operation not permitted
umount: can't unmount /: Operation not permitted

Upgrading kmod-pppox on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-pppox_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-ipt-conntrack on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-ipt-conntrack_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-reject on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-reject_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading base-files on root from 227-r14189-48c3d5c884 to 227-r14198-da98603597...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/base-files_227-r14198-da98603597_aarch64_cortex-a72.ipk
Upgrading kmod-nf-nat on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-nat_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-input-core on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-input-core_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-usb-hid on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-usb-hid_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-fs-vfat on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-fs-vfat_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-ipt on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-ipt_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-mmc on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-mmc_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-ip6tables on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-ip6tables_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-input-evdev on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-input-evdev_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nls-utf8 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nls-utf8_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nls-cp437 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nls-cp437_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-brcmfmac on root from 5.4.52+5.8-1-1 to 5.4.58+5.8-1-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-brcmfmac_5.4.58%2b5.8-1-1_aarch64_cortex-a72.ipk
Upgrading kmod-sound-core on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-sound-core_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-brcmutil on root from 5.4.52+5.8-1-1 to 5.4.58+5.8-1-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-brcmutil_5.4.58%2b5.8-1-1_aarch64_cortex-a72.ipk
Upgrading kmod-ipt-core on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-ipt-core_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-ppp on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-ppp_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-conntrack on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-conntrack_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-hid-generic on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-hid-generic_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-ipt6 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-ipt6_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nls-iso8859-1 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nls-iso8859-1_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nf-conntrack6 on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nf-conntrack6_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-nls-base on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-nls-base_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-hid on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-hid_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-ipt-offload on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-ipt-offload_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-slhc on root from 5.4.52-1 to 5.4.58-1sysctl: error setting key 'vm.min_free_kbytes': Read-only file system
/etc/rc.common: line 32: can't create /proc/sys/net/ipv6/conf/default/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/all/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/default/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/eth0/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/lo/accept_ra: Read-only file system
sysctl: error setting key 'kernel.panic': Read-only file system
sysctl: error setting key 'kernel.core_pattern': Read-only file system
sysctl: error setting key 'fs.suid_dumpable': Read-only file system
sysctl: error setting key 'fs.protected_hardlinks': Read-only file system
sysctl: error setting key 'fs.protected_symlinks': Read-only file system
sysctl: error setting key 'net.ipv4.conf.default.arp_ignore': Read-only file system
sysctl: error setting key 'net.ipv4.conf.all.arp_ignore': Read-only file system
sysctl: error setting key 'net.ipv4.ip_forward': Read-only file system
sysctl: error setting key 'net.ipv4.icmp_echo_ignore_broadcasts': Read-only file system
sysctl: error setting key 'net.ipv4.icmp_ignore_bogus_error_responses': Read-only file system
sysctl: error setting key 'net.ipv4.igmp_max_memberships': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_fin_timeout': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_keepalive_time': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_syncookies': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_timestamps': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_sack': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_dsack': Read-only file system
sysctl: error setting key 'net.ipv6.conf.default.forwarding': Read-only file system
sysctl: error setting key 'net.ipv6.conf.all.forwarding': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_acct': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_checksum': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_max': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_tcp_timeout_established': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_udp_timeout': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_udp_timeout_stream': Read-only file system
Failed to connect to ubus
Failed to connect to ubus
sysctl: error setting key 'vm.min_free_kbytes': Read-only file system
/etc/rc.common: line 32: can't create /proc/sys/net/ipv6/conf/default/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/all/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/default/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/eth0/accept_ra: Read-only file system
/etc/rc.common: line 34: can't create /proc/sys/net/ipv6/conf/lo/accept_ra: Read-only file system
sysctl: error setting key 'kernel.panic': Read-only file system
sysctl: error setting key 'kernel.core_pattern': Read-only file system
sysctl: error setting key 'fs.suid_dumpable': Read-only file system
sysctl: error setting key 'fs.protected_hardlinks': Read-only file system
sysctl: error setting key 'fs.protected_symlinks': Read-only file system
sysctl: error setting key 'net.ipv4.conf.default.arp_ignore': Read-only file system
sysctl: error setting key 'net.ipv4.conf.all.arp_ignore': Read-only file system
sysctl: error setting key 'net.ipv4.ip_forward': Read-only file system
sysctl: error setting key 'net.ipv4.icmp_echo_ignore_broadcasts': Read-only file system
sysctl: error setting key 'net.ipv4.icmp_ignore_bogus_error_responses': Read-only file system
sysctl: error setting key 'net.ipv4.igmp_max_memberships': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_fin_timeout': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_keepalive_time': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_syncookies': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_timestamps': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_sack': Read-only file system
sysctl: error setting key 'net.ipv4.tcp_dsack': Read-only file system
sysctl: error setting key 'net.ipv6.conf.default.forwarding': Read-only file system
sysctl: error setting key 'net.ipv6.conf.all.forwarding': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_acct': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_checksum': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_max': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_tcp_timeout_established': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_udp_timeout': Read-only file system
sysctl: error setting key 'net.netfilter.nf_conntrack_udp_timeout_stream': Read-only file system
Collected errors:
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-core:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-sound-arm-bcm2835:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-reject6:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-flow:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-lib-crc-ccitt:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-pppoe:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-pppox:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ipt-conntrack:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-reject:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * extract_archive: Cannot create symlink from ./etc/resolv.conf to '/tmp/resolv.conf': File exists.
 * resolve_conffiles: Existing conffile /etc/group is different from the conffile in the new package. The new conffile will be placed at /etc/group-opkg.
 * resolve_conffiles: Existing conffile /etc/hosts is different from the conffile in the new package. The new conffile will be placed at /etc/hosts-opkg.
 * resolve_conffiles: Existing conffile /etc/passwd is different from the conffile in the new package. The new conffile will be placed at /etc/passwd-opkg.
 * resolve_conffiles: Existing conffile /etc/shadow is different from the conffile in the new package. The new conffile will be placed at /etc/shadow-opkg.
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-nat:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-input-core:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-usb-hid:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-fs-vfat:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-ipt:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-mmc:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ip6tables:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-input-evdev:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nls-utf8:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nls-cp437:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-brcmfmac:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-sound-core:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-brcmutil:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ipt-core:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ppp:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-conntrack:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-hid-generic:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-ipt6:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nls-iso8859-1:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nf-conntrack6:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-nls-base:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-hid:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ipt-offload:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-slhc:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-cfg80211:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
 * satisfy_dependencies_for: Cannot satisfy the following dependencies for kmod-ipt-nat:
 *      kernel (= 5.4.58-1-6b9b38032e2b529d6fd8d86a546ac48f)
...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-slhc_5.4.58-1_aarch64_cortex-a72.ipk
Upgrading kmod-cfg80211 on root from 5.4.52+5.8-1-1 to 5.4.58+5.8-1-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-cfg80211_5.4.58%2b5.8-1-1_aarch64_cortex-a72.ipk
Upgrading kmod-ipt-nat on root from 5.4.52-1 to 5.4.58-1...
Downloading http://downloads.openwrt.org/snapshots/targets/bcm27xx/bcm2711/packages/kmod-ipt-nat_5.4.58-1_aarch64_cortex-a72.ipk
Configuring base-files.
xargs: opkg: exited with status 255; aborting
The command '/bin/sh -c opkg update &&     opkg install       iperf3       ip-full &&     opkg list-upgradable | awk '{print $1}' | xargs opkg upgrade' returned a non-zero code: 124
* cleaning up
make: *** [Makefile:15: build-rpi] Error 124

@hllhll
Copy link

hllhll commented Aug 19, 2020

I Booted the beta for raspberry pi os 64 bit; I Got the same error as u, I guess there aren't any upgradable packages? I removed that part from the Dockerfile.rpi && opkg list-upgradeble.. to the end. . Eventually build succeeded but then I got into the realm of make run script and from there I got error message something about the chipset/devices for I think one of the NICs, No clue how to go on from here

pi@raspberrypi:~/server/openwrt_build/docker-openwrt $ make run
./run.sh
wlp2s0 is not a valid phy80211 device
make: *** [Makefile:18: run] Error 1

@oofnikj
Copy link
Owner

oofnikj commented Aug 20, 2020

Ok, I Was able to troubleshoot this.
The filesystem of the 2nd paratition in the Rpi4 images are squashfs, not ext4; So, youll have to replace -t ext4 with -t squashfs in mount_rootfs()
Additional thing that might also cause problem is that they truncate 0's from the file, So I had to inflate the file according to what the partition table says (Not sure this is needed, tough)

Hi @hllhll, thanks for looking in to this! I don't have a RPi 4 to test with unfortunately, so I can't be of much help here.
It seems both you and @dhogaivannan are able to mount the image successfully now.

I'm considering setting up a build server to automate building these RPi images since it can be a real challenge given the variations in software and hardware on the RPi platform.

@oofnikj
Copy link
Owner

oofnikj commented Aug 20, 2020

I Booted the beta for raspberry pi os 64 bit; I Got the same error as u, I guess there aren't any upgradable packages? I removed that part from the Dockerfile.rpi && opkg list-upgradeble.. to the end. . Eventually build succeeded but then I got into the realm of make run script and from there I got error message something about the chipset/devices for I think one of the NICs, No clue how to go on from here

pi@raspberrypi:~/server/openwrt_build/docker-openwrt $ make run
./run.sh
wlp2s0 is not a valid phy80211 device
make: *** [Makefile:18: run] Error 1

You're getting this error because there is no Wi-Fi device called wlp2s0 on your hardware.

I suspect the default Wi-Fi device name here is wlan0. Try setting WIFI_IFACE in openwrt.conf to this value.

@hllhll
Copy link

hllhll commented Aug 21, 2020

Ok, I needed to further understand the configuration file
Just saying, OMG It actually worked! Thank you @oofnikj for providing the only solution I know for running OpenWRT+Other stuff on the same Pi...

pi@raspberrypi:~/server/openwrt-build/docker-openwrt $ make run
./run.sh
* got 'phy0' for device 'wlan0'
* setting up docker network
49cc5547232214dfe667362916395e4172092e79a26c14a50f0eac2cf95bfd66
f8800c2102629b3474e283201402bc45d4f6d1a842132350b13a23e5638b4662
* creating container openwrt_1
WARNING: Localhost DNS setting (--dns=127.0.0.1) may fail in containers.
* generating network config
* got 'phy0' for device 'wlan0'
openwrt_1
* moving device phy0 to docker network namespace
* creating netns symlink 'openwrt_1'
* set hairpin mode on interface 'wlan0'..........
couldn't set hairpin mode, wifi clients will probably be unable to talk to each other
* setting up host macvlan interface
* getting address via DHCP
* reloading firewall rules
* ready

@oofnikj
Copy link
Owner

oofnikj commented Aug 21, 2020

@hllhll that's great news 🥳 I'm glad to hear you got it working. I should improve the documentation in the config file to better explain what each option does.

I'd be interested to hear more about your experience running OpenWrt in Docker on the RPi 4. And please feel free to open a PR to fix the build script so that it works with the RPi 4 image!

@Antexa
Copy link

Antexa commented Aug 26, 2020

Hey,
@hllhll To get this works, you run a 64 bits kernel on your host (RPI4) and go with wlan0 in openwrt.conf ?

@oofnikj Yes, or also a detailed step by step guide with some recomandations could be really appreciate on the PI build

This issue is really helpfull

@hllhll
Copy link

hllhll commented Aug 26, 2020

@Antexa Yeah, everything worked eventually; used the pi4 64 bit beta image, fixed the .img file change the filesystem. occational problems with the docker cmd that update the packages so I removed id.

Under rpi-config I've activated predictable NIC names (not sure if needed, seems reasonable) and I connected a usb-eth to the Pi. change WAN if to it; WLAN is as mentioned earlier wlan0. Voilla! it works, just needed to install LuCI via SSH.

And yeah, it's not very clear from the documentation, the configuration file is a mix of some magic to set up the container networking properly (macvaln etc) + setting up the configuration files inside OpenWRT.

@oofnikj, I Might... hopefully... when I'll have time...

@ALL: I have a 500mbit optical link and it usually ~480; However, with the docker-wrt as router I get ~250mbit; Any ideas why? (in a peculiar way this is somehow 50% of my downlink speed); While native users reports 850Mbit

@oofnikj
Copy link
Owner

oofnikj commented Aug 28, 2020

@hllhll re: speed difference, it could be due to the optimizations present in the OpenWrt kernel that are not enabled in the kernel you are currently running. I don't have an RPi 4 otherwise I'd be interested in investigating further.

In other news, I've added some automated builds for the RPi. Images are available on Docker Hub, and I'd be happy to get some feedback whether they work.

More info in the RPi readme.

@oofnikj oofnikj closed this as completed Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants