How to include a gnulib module...just some notes for now. Questions later

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

Post Reply
s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

How to include a gnulib module...just some notes for now. Questions later

Post by s243a »

I'm trying to compile empty. See github issue:

devX missing (some?) Multiarch Packages #2064

I'm missing openpty and login_tty

I think what I have to do is import these modules as follows:

Code: Select all

gnulib-tool --no-vc-files --import openpty and login_tty

http://wiki.opencsw.org/adding-gnulib

Not sure what the --no-vc-files switch does and if I need it. Also not sure if the following is helpful but here is the makefile:

Code: Select all

#
# Makefile for empty
#
# Usage:
# 	make all install clean
# or
# 	make `uname -s` install clean
# or 
# 	make `uname -s`-gcc install clean
#


CC =	cc
LIBS =	-lutil

PREFIX = /usr/local

all:
	${CC} ${CFLAGS} -Wall ${LIBS} -o empty empty.c

FreeBSD:	all
NetBSD:		all
OpenBSD:	all

Linux:		all
Cygwin:		all

UnixWare:	SunOS
OpenUNIX:	SunOS
AIX:		SunOS
OSF1:		SunOS
HP-UX:		SunOS
SunOS:
	cc -o empty empty.c

UnixWare-gcc:	SunOS-gcc
OpenUNIX-gcc:	SunOS-gcc
HP-UX-gcc:	SunOS-gcc
SunOS-gcc:
	gcc ${CFLAGS} -Wall -o empty empty.c

install:
	[ -f `which strip` ] && strip empty
	[ -d ${PREFIX}/bin ] && cp empty ${PREFIX}/bin || mkdir -p ${PREFIX}/bin && cp empty ${PREFIX}/bin
	[ -d ${PREFIX}/man/man1 ] && cp empty.1 ${PREFIX}/man/man1 || mkdir -p ${PREFIX}/man/man1 && cp empty.1 ${PREFIX}/man/man1
deinstall:
	rm ${PREFIX}/bin/empty
	rm ${PREFIX}/man/man1/empty.1
uninstall:	deinstall

clean:
	rm empty 

https://sourceforge.net/projects/empty/

Some links for further reference that may or may not be relevant:
http://www.linuxfromscratch.org/lfs/dow ... HUNKS.html

User avatar
OscarTalks
Posts: 623
Joined: Tue Jul 14, 2020 10:11 pm
Location: London UK
Has thanked: 2 times
Been thanked: 247 times

Re: How to include a gnulib module...just some notes for now. Questions later

Post by OscarTalks »

I don't really know what empty is, but I just wanted to let you know that I tried the 0.6.21b source bundle and it compiled without errors in Dpup Wheezy by just running the make command

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: How to include a gnulib module...just some notes for now. Questions later

Post by s243a »

OscarTalks wrote: Sun Feb 28, 2021 7:23 pm

I don't really know what empty is, but I just wanted to let you know that I tried the 0.6.21b source bundle and it compiled without errors in Dpup Wheezy by just running the make command

both @rufwoof and @BarryK use it to set up containers. I also use it based on rufwoof's code but don't understand it. I've tried an older debian version (see post) on buster and I had some issues but they may not have been related to "empty". Consequently, I've decided to try compiling it on upupGG+D.

I've tried installing gnulib and the missing dependencies of libc6-dev. I also tried mounting the kernal sources. I don't know if any of these things helped but after doing these things the following worked:

"Try moving '-lutil' after 'empty.c' on the gcc command line"
https://ubuntuforums.org/showthread.php?t=2131632

It now compiles with one warning:

Code: Select all

# make all
cc  -Wall -o empty empty.c -lutil
empty.c: In function ‘main’:
empty.c:585:4: warning: ‘strncat’ specified bound 1 equals source length [-Wstringop-overflow=]
  585 |    strncat(buf, " ", 1);
      |    ^~~~~~~~~~~~~~~~~~~~

I'd like to also resolve this warning but for now it appears to work. At least "empty --help" works but I haven't tested it beyond that and I don't really understand this "empty" utility. That said, here is some documentation:
http://empty.sourceforge.net/

P.S. I have no idea what this util libarary is that we are liking. I think it is related to an older version of glibc and this is likely why it compiles easier on older versions of linux.

s243a
Posts: 501
Joined: Mon Dec 09, 2019 7:29 pm
Has thanked: 90 times
Been thanked: 37 times

Re: How to include a gnulib module...just some notes for now. Questions later

Post by s243a »

OscarTalks wrote: Sun Feb 28, 2021 7:23 pm

I don't really know what empty is, but I just wanted to let you know that I tried the 0.6.21b source bundle and it compiled without errors in Dpup Wheezy by just running the make command

The Following is From BarryK's Blog:

empty and script utilities for Easy Containers
October 17, 2018 — BarryK
Prior to releasing Easy 0.9.7, there was a problem with launching apps in containers. For 'audacious' (music player) for example, a desktop icon is created, clicking on it runs /usr/sbin/ec-chroot-audacious, which has this in it:

#!/bin/sh
ec-chroot audacious

...which failed, yet does work from a terminal window and from the JWM menu, as I reported here:

http://bkhome.org/news/201810/easyos-py ... ready.html

I fixed it for 0.9.7, like this:

#!/bin/sh
urxvt -name eclaunch -iconic -e ec-chroot audacious

...where "-iconic" will launch the urxvt window minimized, and the name "eclaunch" is recognised by JWM to hide the window. This is clumsy, but it works.

...

I did some more research on this, and found this excellent discussion:

https://stackoverflow.com/questions/329 ... ny-command

...

The above link also mentions a command named 'empty', project page here:

http://empty.sourceforge.net/

...

Here is another interesting read:

https://stackoverflow.com/questions/140 ... 57#1401557

EDIT 2018-10-17:
Decided to use 'empty'. It is now compiled in oe-qky-src:

https://github.com/bkauler/oe-qky-src/t ... irky/empty

https://bkhome.org/news/201810/empty-an ... iners.html .

user1111

Re: How to include a gnulib module...just some notes for now. Questions later

Post by user1111 »

Some tasks require a tty and will exit with a error of

tcgetattr(): inappropriate ioctl for device

when one isn't available such as if run through pipes. ssh into another box for instance and some tasks wont work unless you also include a -t switch so that ssh allocates a pseudo terminal. In a similar vein a Xephyr session is another X Server, a bit like another box and using 'empty' is a means to ensure a pseudo terminal is available where otherwise a pipe would fail due to the absence of a pseudo terminal - similar to how ssh might fail with a 'no tty available' type error in some cases in the absence of a -t switch pseudo terminal assignment.

I can't express strongly enough that Barry is the brains behind the container setup/scripts. I just used that as a template for my own purposes within Fatdog and included the use of 'empty' in reflection of Barry having used that within EasyOS. Barry's depth and breadth of expertise is astounding and EasyOS is great, but for me isn't as refined/stable as Fatdog so for my own needs I just married the two (i.e. used the core container code within EasyOS to drop that into Fatdog).

Post Reply

Return to “Users”