Skip to content

Instantly share code, notes, and snippets.

@BorysVrublevskyi
Last active January 19, 2024 14:40
Show Gist options
  • Save BorysVrublevskyi/0bf16f906aeb7bff67dc9a4b791d5c51 to your computer and use it in GitHub Desktop.
Save BorysVrublevskyi/0bf16f906aeb7bff67dc9a4b791d5c51 to your computer and use it in GitHub Desktop.
How to compile CUPS print server for the latest OpenWRT (tested on v21)

Compile CUPS print server for the latest OpenWrt (v21)

Sources

https://github.com/TheMMcOfficial/cups-for-openwrt
Deps https://openwrt.org/docs/guide-developer/toolchain/install-buildsystem
Single package https://openwrt.org/docs/guide-developer/toolchain/single.package
http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/
https://openwrt.org/docs/guide-developer/toolchain/using_the_sdk
https://openwrt.org/ru/doc/howto/build
https://github.com/syb999/openwrt-musl-cups/tree/master/x86_64

Run on Linux machine

git clone https://github.com/lede-project/source

cd source

echo "src-git cups https://github.com/TheMMcOfficial/lede-cups.git" >> feeds.conf.default

./scripts/feeds update -a && ./scripts/feeds install -a

make menuconfig

### Set the target system to your router's "Platform" and set Network -> Printing -> cups as "M"

make tools/install && make toolchain/install

# ???
# ./scripts/feeds install cups

make package/cups/compile 
# make package/cups/install
find ./ -name \*ipk

Copy .ipk files to your router

Run on router

opkg install ./packages/*.ipk
opkg install ./packages/libcups_2.3.0-2_x86_64.ipk
opkg install ./packages/libcups_2.3.0-2_x86_64.ipk

### CONFIG: Alow local admin (need to test)
cupsctl --remote-admin

/etc/init.d/cupsd restart

Open in browser. Add your printer

http://192.168.1.1:631/admin

Copy printer's url, add printer by url, but edit it to use http (not https)

@PrvtN00b
Copy link

PrvtN00b commented Mar 26, 2023

../compile_pkgs prepare -t omnia

following your process and for some reason this is popping up and wont let me compile, not sure how do I fix this

image

@logicplace
Copy link

I don't know, like my post says it's incomplete and I gave up. Do not attempt unless you're confident you can actually fix the issues and contribute the full tutorial.

@BorysVrublevskyi
Copy link
Author

@logicplace, just like you, I saved my experience and shared it with everyone who is searching for a solution.
Without any logs or error text, distro family where you're compiling this, I can't even imagine what went wrong.

@PrvtN00b

  1. Build it on a PC or laptop. It took me a couple of hours to be done with a high CPU load.
  2. These errors say, that your system missing dependencies (packages) to build it. It could be that OpenWRT does not have them.

Currently I'm using a Keenetic router and Intel Atom-based media server with Linux and CUPS from repo.

@PrvtN00b
Copy link

thi is the lines i´m using, because I´m trying to use CUPS with gutenprint for a canon printer:

git clone https://github.com/lede-project/source

cd source

echo 'src-git printing https://github.com/logicplace/openwrt-printing-packages.git' >> feeds.conf.default


./scripts/feeds update -a && ./scripts/feeds install -a

make menuconfig

make package/cups/compile

@BorysVrublevskyi
Copy link
Author

Currently, I have an openSUSE Leap 15.4 on my laptop. So the result of the execution command make menuconfig was like this:

Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'proper-umask'... ok.
Checking 'gcc'... failed.
Checking 'working-gcc'... ok.
Checking 'g++'... ok.
Checking 'working-g++'... failed.
Checking 'ncurses.h'... failed.
Checking 'git'... ok.
...

This will show you the components that your system does not have (Checking ... failed), so you need to find the package name that contains that component and install it.

You can try to search for it in repos:

# For openSUSE
sudo zypper search COMPONENT_NAME
sudo zypper install MISSING_PACKAGE

# Fedora
sudo dnf search COMPONENT_NAME
sudo dnf install MISSING_PACKAGE

# Debian / Ubuntu
sudo apt update
sudo apt-cache search COMPONENT_NAME
sudo apt install MISSING_PACKAGE

Or Google it.

In my case the result was:

sudo zypper install make gcc glibc gcc-c++ ncurses-devel patch

@Vladdrako
Copy link

https://github.com/Vladdrako/openwrt-printing-packages
Trying to update some stuff) Works fine on my qcom/ipq60xx/linksys-mr7350

@hidasw
Copy link

hidasw commented Jan 7, 2024

is possible to enable tls?
android print service restrict to use tls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment