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

Ubuntu 22.04 support #12

Open
ahmadSum1 opened this issue Jul 23, 2024 · 0 comments
Open

Ubuntu 22.04 support #12

ahmadSum1 opened this issue Jul 23, 2024 · 0 comments

Comments

@ahmadSum1
Copy link

ahmadSum1 commented Jul 23, 2024

On Rpi4, ubuntu 22.04_64bit_server

bash
 curl -O https://raw.githubusercontent.com/ahmadsum1/rpi-usb-gadget/master/rpi4-usb.sh
bash rpi4-usb.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 10311  100 10311    0     0  21782      0 --:--:-- --:--:-- --:--:-- 21845
This script will modify '/boot/firmware/config.txt', '/boot/firmware/cmdline.txt' and other files.
Warning, It might brick your device!

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Continue with modifications?
Are you sure? [y/N] y
Do you want to use a DHCP server for the USB network?
This will install dnsmasq and configure it for the USB network
Are you sure? [y/N] y

Enter the base IP address for the USB network
Only the first 3 groups
Example 10.55.0
Enter the base IP address: 10.55.0
[sudo] password for skb:

Add the line modules-load=dwc2,g_ether to /boot/firmware/cmdline.txt
Are you sure? [y/N] y

Add the line 'libcomposite' to '/etc/modules'
Are you sure? [y/N] y
libcomposite
grep: /etc/dhcpcd.conf: No such file or directory

Add the line 'denyinterfaces usb0' to '/etc/dhcpcd.conf'
Are you sure? [y/N] y
denyinterfaces usb0

Install dnsmasq
Are you sure? [y/N] y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  dns-root-data dnsmasq-base
Suggested packages:
  resolvconf
The following NEW packages will be installed:
  dns-root-data dnsmasq dnsmasq-base
0 upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 388 kB of archives.
After this operation, 988 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 dns-root-data all 2023112702~ubuntu0.22.04.1 [5,136 B]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 dnsmasq-base arm64 2.90-0ubuntu0.22.04.1 [363 kB]
Get:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 dnsmasq all 2.90-0ubuntu0.22.04.1 [19.7 kB]
Fetched 388 kB in 0s (777 kB/s)
Selecting previously unselected package dns-root-data.
(Reading database ... 209666 files and directories currently installed.)
Preparing to unpack .../dns-root-data_2023112702~ubuntu0.22.04.1_all.deb ...
Unpacking dns-root-data (2023112702~ubuntu0.22.04.1) ...
Selecting previously unselected package dnsmasq-base.
Preparing to unpack .../dnsmasq-base_2.90-0ubuntu0.22.04.1_arm64.deb ...
Unpacking dnsmasq-base (2.90-0ubuntu0.22.04.1) ...
Selecting previously unselected package dnsmasq.
Preparing to unpack .../dnsmasq_2.90-0ubuntu0.22.04.1_all.deb ...
Unpacking dnsmasq (2.90-0ubuntu0.22.04.1) ...
Setting up dnsmasq-base (2.90-0ubuntu0.22.04.1) ...
Setting up dns-root-data (2023112702~ubuntu0.22.04.1) ...
Setting up dnsmasq (2.90-0ubuntu0.22.04.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/dnsmasq.service → /lib/systemd/system/dnsmasq.service.
Job for dnsmasq.service failed because the control process exited with error code.
See "systemctl status dnsmasq.service" and "journalctl -xeu dnsmasq.service" for details.
invoke-rc.d: initscript dnsmasq, action "start" failed.
× dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
     Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2024-07-20 05:05:41 CEST; 42ms ago
    Process: 1536 ExecStartPre=/etc/init.d/dnsmasq checkconfig (code=exited, status=0/SUCCESS)
    Process: 1544 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
        CPU: 102ms

Jul 20 05:05:41 raspberrypi systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Jul 20 05:05:41 raspberrypi dnsmasq[1544]: dnsmasq: failed to create listening socket for port 53: Add
ress already in use
Jul 20 05:05:41 raspberrypi dnsmasq[1544]: failed to create listening socket for port 53: Address alre
ady in use
Jul 20 05:05:41 raspberrypi dnsmasq[1544]: FAILED to start up
Jul 20 05:05:41 raspberrypi systemd[1]: dnsmasq.service: Control process exited, code=exited, status=2
/INVALIDARGUMENT
Jul 20 05:05:41 raspberrypi systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Jul 20 05:05:41 raspberrypi systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS s
erver.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.
Created /etc/dnsmasq.d/usb-gadget
configure static ip '10.55.0.1' for interface usb0
tee: /etc/network/interfaces.d/usb0: No such file or directory
Created /etc/network/interfaces.d/usb0
Created /usr/local/sbin/usb-gadget.sh


Select network device type
1) RNDIS Network device type (best with windows)
2) ECM Network device type
Pick an option: 1

You selected 'net-rndis' which will be configured in
the systemd unit file for usb-gadget.

Created /lib/systemd/system/usb-gadget.service
Created symlink /etc/systemd/system/sysinit.target.wants/usb-gadget.service → /lib/systemd/system/usb-gadget.service.


Done setting up as USB gadget
You must reboot for changes to take effect

If you chose to use dnsmasq, then
you can reach the device on 10.55.0.1 when connected by USB.
If not then your host must assign an IP address to the usb0 interface.


If you want to disable the usb0/gadget interface then
please run 'sudo systemctl disable usb-gadget'
and reboot.
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

1 participant