LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 08-18-2013, 08:13 AM   #1
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Rep: Reputation: 85
Can't compile fakeroot in LFS 7.4rc1


I'm trying out the new version of LFS. The lfs-packages built fine, but I have some problems with the extra packages I want to have. I installed pacman in the toolchain, and he had some problems with the new version of curl. In Arch they had added a headerfile to curl, so I tried it out and it worked.

Now I'm stuck on fakeroot. To me it looks like the actual code of the program is not compatible with, I don't know if it is gcc or which package(s).
Code:
Making all in test
make[2]: Entering directory `/tmp/build/fakeroot/src/fakeroot-1.19/test'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/build/fakeroot/src/fakeroot-1.19/test'
make[2]: Entering directory `/tmp/build/fakeroot/src/fakeroot-1.19'
awk -f ./wrapawk < ./wrapfunc.inp
/bin/sh ./libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.     -O2 -march=core2 -mtune=corei7 -MT libfakeroot.lo -MD -MP -MF .deps/libfakeroot.Tpo -c -o libfakeroot.lo libfakeroot.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -O2 -march=core2 -mtune=corei7 -MT libfakeroot.lo -MD -MP -MF .deps/libfakeroot.Tpo -c libfakeroot.c  -fPIC -DPIC -o .libs/libfakeroot.o
In file included from libfakeroot.c:223:0:
wrapped.h:125:27: error: unknown type name 'cap_user_header_t'
 extern int (*next_capset)(cap_user_header_t hdrp, const cap_user_data_t datap);
                           ^
wrapped.h:125:27: error: unknown type name 'cap_user_data_t'
In file included from libfakeroot.c:224:0:
wraptmpf.h:373:17: error: unknown type name 'cap_user_header_t'
 int tmp_capset (cap_user_header_t hdrp, const cap_user_data_t datap){
                 ^
wraptmpf.h:373:17: error: unknown type name 'cap_user_data_t'
In file included from libfakeroot.c:225:0:
wrapdef.h:125:20: error: unknown type name 'cap_user_header_t'
 int (*next_capset)(cap_user_header_t hdrp, const cap_user_data_t datap)=tmp_capset;
                    ^
wrapdef.h:125:20: error: unknown type name 'cap_user_data_t'
In file included from libfakeroot.c:226:0:
wrapstruct.h:126:14: error: 'next_capset' undeclared here (not in a function)
   {(void(*))&next_capset, "capset"},
              ^
libfakeroot.c:1565:12: error: unknown type name 'cap_user_header_t'
 int capset(cap_user_header_t hdrp, const cap_user_data_t datap)
            ^
libfakeroot.c:1565:12: error: unknown type name 'cap_user_data_t'
libfakeroot.c: In function 'fts_read':
libfakeroot.c:1948:5: warning: passing argument 1 of 'send_get_stat64' from incompatible pointer type [enabled by default]
     SEND_GET_STAT64(r->fts_statp, _STAT_VER);
     ^
In file included from libfakeroot.c:60:0:
communicate.h:209:13: note: expected 'struct stat64 *' but argument is of type 'struct stat *'
 extern void send_get_stat64(struct stat64 *buf);
             ^
libfakeroot.c: In function 'fts_children':
libfakeroot.c:1971:7: warning: passing argument 1 of 'send_get_stat64' from incompatible pointer type [enabled by default]
       SEND_GET_STAT64(r->fts_statp, _STAT_VER);
       ^
In file included from libfakeroot.c:60:0:
communicate.h:209:13: note: expected 'struct stat64 *' but argument is of type 'struct stat *'
 extern void send_get_stat64(struct stat64 *buf);
             ^
make[2]: *** [libfakeroot.lo] Error 1
make[2]: Leaving directory `/tmp/build/fakeroot/src/fakeroot-1.19'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/build/fakeroot/src/fakeroot-1.19'
make: *** [all] Error 2
I tried to google, but didn't find anything relevant. I checked the PKGBUILD for Arch, but there was nothing special about fakeroot. They have the same version of fakeroot, glibc and gcc.

Does anyone have an idea? If the solution is not to change something in fakeroot, but in some other package, I don't know what that could be.
 
Old 08-18-2013, 09:04 AM   #2
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
He he, as usual, the best way to clear the mind and think better, is to ask about the problem here. I found the buildscripts for debian sid, and there it said fakeroot now depend on libcap. So I installed attr and libcap, and then fakeroot built fine. (I now remember I updated fakeroot after I built 7.3, so I haven't installed this version in "chapter 6" before.)

Now I feel that I have successfully built LFS-7.4rc1.
 
1 members found this post helpful.
Old 09-02-2013, 01:02 AM   #3
DeeGee
Member
 
Registered: Apr 2013
Distribution: Debian, Linux From Scratch, Mint
Posts: 118

Rep: Reputation: 24
Quote:
Originally Posted by Lennie View Post
He he, as usual, the best way to clear the mind and think better, is to ask about the problem here. I found the buildscripts for debian sid, and there it said fakeroot now depend on libcap. So I installed attr and libcap, and then fakeroot built fine. (I now remember I updated fakeroot after I built 7.3, so I haven't installed this version in "chapter 6" before.)

Now I feel that I have successfully built LFS-7.4rc1.
Hi Lennie,
What are the instructions you are using here?
I've been attempting to build using this hint but already encountered a problem in the first stage. I am trying to build fakeroot in the chroot environment and tried to install libcap and its dependency attr.

This gives the error due to gettext not being there.

Curious to find out which method you used.
 
1 members found this post helpful.
Old 09-02-2013, 02:19 AM   #4
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Gettext should be installed in both the chapter 5 and 6...

I didn't install fakeroot in the toolschain. I built chapter 6 as root, and installed fakeroot at the end of chapter 6.

The extra packages I installed in chapter 5 was: zlib, openssl, libarchive, curl, and pacman.
In chapter 6 I installed: openssl, libarchive, curl, attr, libcap, fakeroot, sudo and pacman.
Then I reinstalled pacman after I installed gpgme.
 
2 members found this post helpful.
Old 09-02-2013, 03:39 AM   #5
DeeGee
Member
 
Registered: Apr 2013
Distribution: Debian, Linux From Scratch, Mint
Posts: 118

Rep: Reputation: 24
Quote:
Originally Posted by Lennie View Post
Gettext should be installed in both the chapter 5 and 6...

I didn't install fakeroot in the toolschain. I built chapter 6 as root, and installed fakeroot at the end of chapter 6.

The extra packages I installed in chapter 5 was: zlib, openssl, libarchive, curl, and pacman.
In chapter 6 I installed: openssl, libarchive, curl, attr, libcap, fakeroot, sudo and pacman.
Then I reinstalled pacman after I installed gpgme.
Gettext in Chapter 5 installs just the msgfmt binary. attr requires msgmerge as well. Trying to install it and continue. Will report back on it.

Would there be any documentation or anything I could refer to understand the workings of the method you use, please? Would be a great help indeed! Thanks
 
1 members found this post helpful.
Old 09-02-2013, 09:46 AM   #6
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
I have been reading through the hint you linked to. I must say it was the worst crap I've ever read! Please don't follow it. It's unbelievable how much one can complicate a thing that is actually quite easy. I'll give you some detailed instructions of how to do this in a much easier way.

I've been going through my scripts, and removed the parts that is specific for my system, and made them more generic. I think I'll better run through them and make sure I didn't introduce new bugs, then I can upload them somewhere so you can get them. (If they work as expected it'll take 33 minutes for the toolchain and <2 hours for chapter 6.)

In the meantime you can look at the scripts from baho-utot. I learned how to build lfs with pacman from them. They are a bit outdated, and pacman has changed quite a lot since then and has different dependencies, but you can still learn a lot from them.
 
2 members found this post helpful.
Old 09-02-2013, 01:21 PM   #7
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
I hope this works now. I'm quite tired of thinking and writing and more thinking, so I hope I didn't screw it up. It's different things to think of when writing scripts for others to use, than to just do it for oneself... And I'm not so used to writing how-tos.

You can download the tarball from https://dl.dropboxusercontent.com/u/...ild-lfs.tar.gz
Here is the README that is also included in the tarball.

Code:
These are the scripts I used for my last build of lfs-7.4rc2. It's a work 
in progress, and they will change when I get better ideas. You can use them 
at your own risk, but don't blame me if they bork your system, or whatever 
catastrophy might happen if you run them. But you really should look through 
them first and see what they'll do. You most likely want to change some 
of them. 

These scripts will not do everything for you. They will only automate the
actual building of the packages, so you'll also need to do a lot of stuff 
manually. 

Follow the book until chapter 5.4, when the actual building starts, with 
the exception that you should put the sources in a different place. For 
these scripts to work without the need to change too much you need to put 
the sources in $LFS/build/sources. You also need to create the same 
directory structure as this tarball has, or just untar it in $LFS. 

So when you have done up to and including chapter 5.3, you should be loged-in
as the lfs user, cd to $LFS/build/scripts and from there run the script
'build-tools'. That should build chapter 5 for you.

When the script has completed you should go back to the book in chapter
5.35 and follow the book until chapter 6.7, where the actual building of 
chapter 6 starts. Before you run the next script, you might want to change 
a few thing.

	* $LFS/tools/etc/makepkg.conf
	You might want to uncomment CFLAGS CXXFLAGS and MAKEFLAGS, and change them 
	to what is right for your system. 

	* tzdata/PKGBUILD
	It sets the timezone to Europe/Stockholm, change it to your timezone.

	* glibc/locales
	That file list which languages will be generated. Now it only includes 
	US english. If you want another language you need to add it. (Instructions 
	of how to do that is in that file.) You might need to manually run 
	'locale-gen' as root after the script has completed. 

Inside the chroot, cd /build/scrips and from there run 'first-build-lfs'.
After this script has finished, before you can continue building and 
installing packages with pacman, you need to edit the the new configuration 
files /etc/makepkg.conf and /etc/pacman.conf. (Pacman must be the last 
package installed in this script. If you want to add more packages in this 
script, put them before pacman.)

When it has completed, go back to the book in chapter 6.66 and complete 
the book. You don't need to do the stripping, as makepkg has already done 
it for you. (Unless you change it in makepkg.conf.) You have already 
installed the bootscripts and most of the scripts in chapter 7. You just 
need to look through them to see what you need to change. 

I don't build grub, so I have no PKGBUILD for it. 

When you have finished the book, you can enter the chroot again and continue
building the packages in 'build-lfs'. I recommend recompiling util-linux
now, when udev is installed, to get some extra features. Then 'lsblk -f' 
is a very useful command to get info about partitions.

If one of the scripts stops for whatever reason, they can be started again
and they'll continue where they left off.
 
2 members found this post helpful.
Old 09-03-2013, 12:35 AM   #8
DeeGee
Member
 
Registered: Apr 2013
Distribution: Debian, Linux From Scratch, Mint
Posts: 118

Rep: Reputation: 24
Thanks so much Lennie!

I am studying your scripts at the moment and you really should make that a LFS hint!

Just to sum up the steps. Please do correct me if I'm wrong.

1. The toolchain in Chapter 5 is build as per book instructions. At the end openssl,libarchive,curl and pacman are built and the ca-certificates are copied over.

2. After chrooting, the final lfs system is built using PKGBUILDs of the LFS programs, as well as well as openssl, libarchive, curl, attr, libcap, fakeroot, sudo and pacman. Grub(if required) will be installed in this stage.

3. Finally, after completing the book, build pacman again.

This is the first time I'm going over a LFSers automated code and am learning a lot. I gad a very bare bone version with a whole muddle of switch cases!
 
1 members found this post helpful.
Old 09-03-2013, 01:56 AM   #9
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Yes, that is correct. The reason to rebuild pacman is to add some features from gpgme. It's needed for package signing and to have makepkg check signatures of source code. If you don't want those features, you don't have to rebuild pacman.
 
2 members found this post helpful.
Old 09-04-2013, 01:52 AM   #10
DeeGee
Member
 
Registered: Apr 2013
Distribution: Debian, Linux From Scratch, Mint
Posts: 118

Rep: Reputation: 24
Hi,

Currently working through first-build-lfs.

For the benefit of anyone else reading this, I got an error when running first-build-lfs
Code:
error: failed to initialize alpm library (could not find or read directory)
Resolved by
Code:
mkdir /var/lib/pacman
Currently having an issue with md5sums ...

Lennie, could you please give me a pointer on how you got the md5sums for the locale file in glibc? I can't figure out what went wrong as I am using the same as yours (en_US.UTF-8 UTF-8) but with a different timezone.

Thanks again heaps for your help
 
Old 09-04-2013, 02:02 AM   #11
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
I just realized some tests fail because the languages isn't generated after glibc is installed, when building with my scripts. In case someone wants to use my scripts as they are, I have added a line to generate the languages. I have uploaded a new tarball, but if you already have it you can just add it to the script 'first-build-lfs'. Part of the script should look like this:
Code:
# Install the package
case ${i} in
	filesystem)     pacman --force --noconfirm -Syy ${pkgname} ;;					
	bash)		pacman --force --noconfirm -Syydd ${pkgname} ;;
	binutils)	pacman --force --noconfirm -Syydd ${pkgname} ;;
	coreutils)	pacman --force --noconfirm -Syydd ${pkgname} ;;
	gcc)		pacman --force --noconfirm -Syydd ${pkgname} ;;
	perl)		pacman --force --noconfirm -Syydd ${pkgname} ;;
	glibc)		pacman --noconfirm -Syydd ${pkgname} && locale-gen ;;
	*)		pacman --noconfirm -Syydd ${pkgname} ;;
esac
Just add the line about glibc.
 
1 members found this post helpful.
Old 09-04-2013, 02:13 AM   #12
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Sorry, I forgot about a few things...

Run this before starting the script 'first-build-lfs':
Code:
mkdir -p "$LFS"/var/{cache/pacman/pkg,lib/pacman}

I have uploaded a new tarball with correct md5sum.

Otherwise you can get it by running, from the directory where the PKGBUILD is:
Code:
makepkg -g
Just copy the output the the PKGBUILD.
 
1 members found this post helpful.
Old 09-04-2013, 02:23 AM   #13
DeeGee
Member
 
Registered: Apr 2013
Distribution: Debian, Linux From Scratch, Mint
Posts: 118

Rep: Reputation: 24
Quote:
Originally Posted by Lennie View Post
Code:
# Install the package
case ${i} in
	filesystem)     pacman --force --noconfirm -Syy ${pkgname} ;;					
	bash)		pacman --force --noconfirm -Syydd ${pkgname} ;;
	binutils)	pacman --force --noconfirm -Syydd ${pkgname} ;;
	coreutils)	pacman --force --noconfirm -Syydd ${pkgname} ;;
	gcc)		pacman --force --noconfirm -Syydd ${pkgname} ;;
	perl)		pacman --force --noconfirm -Syydd ${pkgname} ;;
	glibc)		pacman --noconfirm -Syydd ${pkgname} && locale-gen ;;
	*)		pacman --noconfirm -Syydd ${pkgname} ;;
esac
Just add the line about glibc.
Really sorry but, nah :s
Also deleted the glibc related logfiles.
Still getting the error

Code:
==> Making package: glibc 2.18-1 (Wed Sep  4 07:20:50 UTC 2013)
==> WARNING: Skipping dependency checks.
==> Retrieving sources...
  -> Found glibc-2.18.tar.xz
  -> Found ld.so.conf
  -> Found locale-gen
  -> Found locales
  -> Found nsswitch.conf
==> Validating source files with md5sums...
    glibc-2.18.tar.xz ... Passed
    ld.so.conf ... Passed
    locale-gen ... Passed
    locales ... FAILED
    nsswitch.conf ... Passed
==> ERROR: One or more files did not pass the validity check!
 
Old 09-04-2013, 03:38 AM   #14
DeeGee
Member
 
Registered: Apr 2013
Distribution: Debian, Linux From Scratch, Mint
Posts: 118

Rep: Reputation: 24
Quote:
Originally Posted by Lennie View Post
Sorry, I forgot about a few things...

Run this before starting the script 'first-build-lfs':
Code:
mkdir -p "$LFS"/var/{cache/pacman/pkg,lib/pacman}

I have uploaded a new tarball with correct md5sum.

Otherwise you can get it by running, from the directory where the PKGBUILD is:
Code:
makepkg -g
Just copy the output the the PKGBUILD.
Oops seems I completely foresaw this post! Works now !
 
Old 09-11-2013, 11:48 AM   #15
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
I have been a bit off-topic lately in my threads, but now I want to go back to topic for this thread, which is fakeroot and LFS 7.4. The problem is that I can't get fakeroot working in 7.4. I have built several packages with it, and in most of them my user ends up as the owner of the files. But for some reason, in some packages it works, and root is the owner, and it seems to be all the time the same packages.

I got no error when I build fakeroot, and also in the logs for the packages I've built with fakeroot there are no errors. I don't know if it is glibc or the kernel, I think it must be one of those.

I made one build with linux-api-headers 3.4.61, but I was running linux 3.10.10 when I build it. It was the same problem, that I ended up as the owner of most packages. I compiled linux 3.4.61 on the host and booted with, and then compiled some packages in the chroot, but the problem was the same.

In Arch they have 2 patches for glibc
Code:
# upstream commit 91ce4085
patch -p1 -i $srcdir/glibc-2.18-readdir_r-CVE-2013-4237.patch
  
# hack fix for strstr issues on x86
patch -p1 -i $srcdir/glibc-2.18-strstr-hackfix.patch
They have nothing special for fakeroot. I might try one or both and see if it works.


I have also tried fakeroot-ng I needed to add a sed to get it compile
Code:
sed -i -e 's|linux/ptrace.h|asm/ptrace.h|' arch/os.c
To get the script makepkg (from pacman) to work with it I created a symlink /usr/bin/fakeroot --> fakeroot-ng and I removed (from line 2889)

Code:
else
    if [[ -z $FAKEROOTKEY ]]; then
	error "$(gettext "Do not use the %s option. This option is only for use by %s.")" "'-F'" "makepkg"
	exit 1 # TODO: error code
    fi
It entered fakeroot and started the package function and 'make install', but then it stopped with an error
Code:
make[3]: Entering directory `/tmp/build/util-linux/src/util-linux-2.23.2'
 /bin/mkdir -p '/tmp/build/util-linux/pkg/util-linux/bin'
  /bin/sh ./libtool   --mode=install /usr/bin/install -c more dmesg mount umount wdctl mountpoint lsblk findmnt kill '/tmp/build/util-linux/pkg/util-linux/bin'
/bin/sh: line 24: 31522 Trace/breakpoint trap   /bin/sh ./libtool --mode=install /usr/bin/install -c $files "/tmp/build/util-linux/pkg/util-linux/bin$dir"
make[3]: *** [install-binPROGRAMS] Error 133
make[3]: Leaving directory `/tmp/build/util-linux/src/util-linux-2.23.2'
This error definitely is from fakeroot-ng, the exact same buildscript installs with fakeroot (but with wrong owner).

Has anyone got fakeroot to work with LFS 7.4?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
user lfs: need to be in root to compile jpeters Linux From Scratch 2 03-28-2009 11:53 AM
how to make xfce 4.4RC1 write arabic tony safari Linux - Desktop 0 08-06-2007 05:41 PM
Xfce4.4RC1 fails to build missing dbus ? exvor Linux - Software 2 10-02-2006 04:34 PM
Xfce4.4RC1 on Slackware 11.0RC4 fcaraballo Slackware 2 09-06-2006 06:11 PM
ndiswrapper 1.4rc1 is buggy kaon Linux - Wireless Networking 2 10-02-2005 08:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration