printer-installer builds and installs a CUPS printer queue for the institute Kyocera printer.
The project does not replace the Kyocera printer driver. It uses the Kyocera PPD and filters already installed on the computer, then adds a small custom CUPS backend that forces the LPD user field to your student ID before delegating the actual network upload to the system lpd backend.
For the detailed printing and project design notes, see docs/printing-principles.md.
The installer creates a CUPS printer queue named:
InstitutePrinter
The queue uses this device URI:
titech-lpd://172.20.83.212/kyocera
The custom titech-lpd backend converts that URI to:
lpd://172.20.83.212/kyocera
and passes the job to the operating system's built-in LPD backend.
Install these before building or running the installer:
- Rust toolchain with Cargo.
- CUPS command line tools such as
lpadmin,lpinfo,lpstat, andcups-config. - Kyocera ECOSYS P8060cdn driver software.
- Access to the school/internal network that can reach the printer IP address.
The installer checks for the Kyocera ECOSYS P8060cdn KPDL PPD through:
lpinfo -mIt also checks that the Kyocera filters exist in the CUPS filter directory:
kyofilter_F
kyoprefilter_F
On macOS this directory is usually:
/usr/libexec/cups/filter
On Linux it is usually:
/usr/lib/cups/filter
The installer asks cups-config --serverbin first and only uses platform defaults as a fallback.
Edit src/config.rs:
pub const STUDENT_ID: &str = "00B00000";Replace 00B00000 with your own student ID before building.
The required format is:
NNBNNNNN
The project performs a compile-time check. If STUDENT_ID has the wrong format, cargo check, cargo build, and make release fail before producing a binary.
Do not commit a real student ID to a public repository. Keep the committed placeholder as 00B00000 and change it only in your local working tree before building your own installer.
Use the Makefile for normal builds.
Release build:
make releaseDebug build:
make debugThe build script performs three steps:
- Builds the
titech-lpdbackend. - Copies the backend binary to
assets/titech-lpd. - Builds the
installerbinary, embeddingassets/titech-lpdwithinclude_bytes!.
The generated backend binary is ignored by Git because it is a build artifact.
Apple Silicon:
make release TARGET=aarch64-apple-darwin
make debug TARGET=aarch64-apple-darwinIntel:
make release TARGET=x86_64-apple-darwin
make debug TARGET=x86_64-apple-darwinWhen TARGET is set, the backend and installer are built for the same target. This matters because the installer embeds the backend binary.
The resulting installer is under:
target/<target>/<profile>/installer
For example:
target/aarch64-apple-darwin/release/installer
The Makefile calls scripts/build-installer.sh.
You can also run it directly:
./scripts/build-installer.shThis is equivalent to a default release build.
Explicit debug build:
./scripts/build-installer.sh "" debugExplicit target release build:
./scripts/build-installer.sh aarch64-apple-darwin releaseExplicit target debug build:
./scripts/build-installer.sh x86_64-apple-darwin debugThe second argument must be either debug or release.
Use:
make cleanor:
./scripts/clean.shThe clean script runs:
cargo clean
rm -f assets/titech-lpdThis removes Cargo build outputs and the generated embedded backend binary.
Cargo's built-in cargo clean does not know about assets/titech-lpd, so use the project clean script when you want a full project clean.
Run:
cargo testThis checks helper logic such as PPD parsing, CUPS backend path selection, copy handling, and LPD argument rewriting.
First build the release installer:
make releaseThen run it with root privileges:
sudo ./target/release/installerIf you built for an explicit target, run the target-specific binary:
sudo ./target/aarch64-apple-darwin/release/installeror:
sudo ./target/x86_64-apple-darwin/release/installerDebug builds ask for confirmation before each installation step:
make debug
sudo ./target/debug/installeror, for an explicit target:
sudo ./target/x86_64-apple-darwin/debug/installerThe installer:
- Requires root privileges.
- Locates the CUPS server binary directory with
cups-config --serverbin. - Verifies that the Kyocera driver filters are installed.
- Finds the Kyocera ECOSYS P8060cdn KPDL PPD from
lpinfo -m. - Installs the embedded
titech-lpdbackend into the CUPS backend directory. - Recreates the
InstitutePrinterqueue withlpadmin. - Accepts and enables the queue.
The backend is installed as:
<cups-serverbin>/backend/titech-lpd
On macOS this is usually:
/usr/libexec/cups/backend/titech-lpd
The backend is installed with mode 0700 and owned by root. This makes CUPS run it as a root backend, matching the system lpd backend behavior on macOS.
The queue creation command is equivalent to:
/usr/sbin/lpadmin -x InstitutePrinter
/usr/sbin/lpadmin -p InstitutePrinter -E \
-v titech-lpd://172.20.83.212/kyocera \
-m "<Kyocera ECOSYS P8060cdn KPDL PPD from lpinfo>" \
-o Option19=False \
-o Option26=False \
-o Option25=False \
-o Option21=False \
-o Option22=False \
-o Option17=None \
-o Option18=HardDisk
/usr/sbin/cupsaccept InstitutePrinter
/usr/sbin/cupsenable InstitutePrinterThe model name is discovered automatically from lpinfo -m; it is not hard-coded.
The installable options describe the physical printer hardware assumed by this project:
- no optional paper feeders
- no job separator
- no mailbox
- no punch unit
- no folding unit
- no document finisher
- hard disk enabled
Adjust these constants in src/bin/installer.rs if your physical printer has different optional hardware.
Check that CUPS can discover the backend:
sudo /usr/libexec/cups/backend/titech-lpdExpected output:
network titech-lpd "Unknown" "TiTech fixed-user LPD backend"
Check the installed printer:
lpstat -v InstitutePrinter
lpoptions -p InstitutePrinter -lSend a simple test print:
printf 'TiTech LPD test\n' | lp -d InstitutePrinterThe fixed student ID is a convenience guard, not strong authentication.
It prevents normal print dialogs from accidentally sending the local account name as the LPD user field, but a local administrator can still replace the backend, use another print client, capture traffic, or inspect the binary.
Do not treat a client-side embedded student ID as a secret or as a strong security boundary.