Solved

Missing {Kernel Source}/Documentation/lguest on ver 3x under debian linux.

Posted on 2011-09-23
13
722 Views
Last Modified: 2012-05-12
Hi...

I have been trying to compile version 3.0.4, 3.1 rc6 and 3.1 rc7 of the linux kernel obtained from github and have tried to compile several times with the same results each time.

I am missing a directory called {Kernel Source}/Documentation/lguest. I have re-downloaded the source several times as well and it appears that the folder is missing from the downloaded file(s). If this is missing from the source, I wonder what else is missing? (just a fore thought)

If I copy the missing folders from a known viable source to the new source and then compile, will this even work? or am I asking for more problems with adding possible instabilities with different kernel versions?

Thanks,
John
0
Comment
Question by:jschultz0614
  • 8
  • 3
  • 2
13 Comments
 
LVL 8

Expert Comment

by:eager
ID: 36591445
It looks like a documentation file which didn't get checked in correctly.  Copying it from a different source tree is not likely to cause any problems.
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 36591993
Do you have Documentation/virtual/lguest? Maybe you can just move it.
It was in linux-3.0 that I fetched from ftp.kernel.org some time before they went off the air, and that built fine.
0
 

Author Comment

by:jschultz0614
ID: 36592423
@eager:
I will definitely give that a try. My only concern is if that did not get checked in, what else did not make it :)

@duncan_roe:
I tried retreiving the source for 3 different 3.x sources from github and all three do not have the same files (so far).
0
 

Author Comment

by:jschultz0614
ID: 36592436
@eager:
I'm definitely not familiar with GIT. I'm more familiar with subversion. Is there a way to compare the two source trees, say 2.6.39 and 3.1 rc7, and get the files from 2.6.39 that 3.1 rc7 is missing?
0
 

Author Comment

by:jschultz0614
ID: 36592555
@duncan_roe:
My mistake... did not see the "virtual" let me check
0
 

Author Comment

by:jschultz0614
ID: 36592562
@duncan_roe:
Yes, the Documentation/virtual/lguest folder exists and contains files
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 8

Expert Comment

by:eager
ID: 36592699
I don't know of a way to compare two different git repositories, but git has a large number of functions.  It's possible that you might find one if you go a search.  

I generally compare trees by doing "ls -R" on each tree, sorting the output, and diffing the result.  
0
 

Author Comment

by:jschultz0614
ID: 36592924
OK...
I copied the lguest files from the virtual folder ---- Was not a good idea. Below is the result of the compile:

make[1]: Entering directory `/usr/160gb/kernel/torvalds-linux-4cf670b/Documentation/lguest'
cc -m32 -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -U_FORTIFY_SOURCE    lguest.c   -o lguest
lguest.c:52:52: error: ../../../include/linux/lguest_launcher.h: No such file or directory
lguest.c:149: error: field ‘config’ has incomplete type
lguest.c: In function ‘get_feature_bits’:
lguest.c:249: error: invalid use of undefined type ‘struct lguest_device_desc’
lguest.c:250: error: invalid application of ‘sizeof’ to incomplete type ‘struct lguest_vqconfig’
lguest.c: In function ‘tell_kernel’:
lguest.c:559: error: ‘LHREQ_INITIALIZE’ undeclared (first use in this function)
lguest.c:559: error: (Each undeclared identifier is reported only once
lguest.c:559: error: for each function it appears in.)
lguest.c: In function ‘trigger_irq’:
lguest.c:627: error: ‘LHREQ_IRQ’ undeclared (first use in this function)
lguest.c:627: warning: initialization makes integer from pointer without a cast
lguest.c:627: error: request for member ‘irq’ in something not a structure or union
lguest.c:627: warning: initialization makes integer from pointer without a cast
lguest.c:641: error: request for member ‘irq’ in something not a structure or union
lguest.c:641: warning: format ‘%i’ expects type ‘int’, but argument 3 has type ‘long unsigned int *’
lguest.c: In function ‘reset_device’:
lguest.c:1008: error: request for member ‘num’ in something not a structure or union
lguest.c:1008: error: ‘LGUEST_VRING_ALIGN’ undeclared (first use in this function)
lguest.c:1008: warning: passing argument 1 of ‘vring_size’ makes integer from pointer without a cast
/usr/include/linux/virtio_ring.h:106: note: expected ‘unsigned int’ but argument is of type ‘long unsigned int *’
lguest.c:1008: warning: passing argument 2 of ‘vring_size’ makes integer from pointer without a cast
/usr/include/linux/virtio_ring.h:106: note: expected ‘long unsigned int’ but argument is of type ‘long unsigned int *’
lguest.c: In function ‘create_thread’:
lguest.c:1027: error: ‘LHREQ_EVENTFD’ undeclared (first use in this function)
lguest.c:1027: warning: initialization makes integer from pointer without a cast
lguest.c:1028: error: request for member ‘pfn’ in something not a structure or union
lguest.c:1028: error: invalid operands to binary * (have ‘long unsigned int *’ and ‘int’)
lguest.c:1028: warning: initialization makes integer from pointer without a cast
lguest.c: In function ‘update_device_status’:
lguest.c:1091: error: dereferencing pointer to incomplete type
lguest.c:1091: error: request for member ‘status’ in something not a structure or union
lguest.c:1093: error: dereferencing pointer to incomplete type
lguest.c:1093: error: request for member ‘status’ in something not a structure or union
lguest.c:1093: error: invalid operands to binary & (have ‘long unsigned int *’ and ‘int’)
lguest.c: In function ‘handle_output’:
lguest.c:1127: error: request for member ‘pfn’ in something not a structure or union
lguest.c:1127: error: invalid operands to binary * (have ‘long unsigned int *’ and ‘int’)
lguest.c:1127: warning: comparison between pointer and integer
lguest.c: In function ‘device_config’:
lguest.c:1161: error: invalid use of undefined type ‘struct lguest_device_desc’
lguest.c:1163: error: invalid application of ‘sizeof’ to incomplete type ‘struct lguest_vqconfig’
lguest.c: In function ‘new_dev_desc’:
lguest.c:1173: error: variable ‘d’ has initializer but incomplete type
lguest.c:1173: error: unknown field ‘type’ specified in initializer
lguest.c:1173: warning: excess elements in struct initializer
lguest.c:1173: warning: (near initialization for ‘d’)
lguest.c:1173: error: storage size of ‘d’ isn’t known
lguest.c:1179: error: dereferencing pointer to incomplete type
lguest.c:1179: error: request for member ‘config_len’ in something not a structure or union
lguest.c:1179: error: invalid operands to binary + (have ‘u8 *’ and ‘long unsigned int *’)
lguest.c:1184: error: invalid operands to binary + (have ‘void *’ and ‘long unsigned int *’)
lguest.c:1184: warning: comparison of distinct pointer types lacks a cast
lguest.c:1188: warning: passing argument 3 of ‘memcpy’ makes integer from pointer without a cast
/usr/include/string.h:43: note: expected ‘size_t’ but argument is of type ‘long unsigned int *’
lguest.c:1173: warning: unused variable ‘d’
lguest.c: In function ‘add_virtqueue’:
lguest.c:1203: error: ‘LGUEST_VRING_ALIGN’ undeclared (first use in this function)
lguest.c:1203: warning: passing argument 2 of ‘vring_size’ makes integer from pointer without a cast
/usr/include/linux/virtio_ring.h:106: note: expected ‘long unsigned int’ but argument is of type ‘long unsigned int *’
lguest.c:1220: error: request for member ‘num’ in something not a structure or union
lguest.c:1220: warning: statement with no effect
lguest.c:1221: error: request for member ‘irq’ in something not a structure or union
lguest.c:1221: warning: statement with no effect
lguest.c:1222: error: request for member ‘pfn’ in something not a structure or union
lguest.c:1222: warning: statement with no effect
lguest.c:1225: warning: passing argument 4 of ‘vring_init’ makes integer from pointer without a cast
/usr/include/linux/virtio_ring.h:96: note: expected ‘long unsigned int’ but argument is of type ‘long unsigned int *’
lguest.c:1233: error: dereferencing pointer to incomplete type
lguest.c:1233: error: request for member ‘config_len’ in something not a structure or union
lguest.c:1233: error: dereferencing pointer to incomplete type
lguest.c:1233: error: request for member ‘feature_len’ in something not a structure or union
lguest.c:1234: warning: passing argument 3 of ‘memcpy’ makes integer from pointer without a cast
/usr/include/string.h:43: note: expected ‘size_t’ but argument is of type ‘long unsigned int *’
lguest.c:1236: error: dereferencing pointer to incomplete type
lguest.c:1236: error: request for member ‘num_vq’ in something not a structure or union
lguest.c:1236: error: lvalue required as increment operand
lguest.c:1236: warning: statement with no effect
lguest.c: In function ‘add_feature’:
lguest.c:1257: error: dereferencing pointer to incomplete type
lguest.c:1257: error: request for member ‘feature_len’ in something not a structure or union
lguest.c:1257: warning: comparison between pointer and integer
lguest.c:1258: error: dereferencing pointer to incomplete type
lguest.c:1258: error: request for member ‘config_len’ in something not a structure or union
lguest.c:1259: error: dereferencing pointer to incomplete type
lguest.c:1259: error: request for member ‘feature_len’ in something not a structure or union
lguest.c:1259: warning: assignment makes integer from pointer without a cast
lguest.c: In function ‘set_config’:
lguest.c:1278: error: dereferencing pointer to incomplete type
lguest.c:1278: error: request for member ‘config_len’ in something not a structure or union
lguest.c:1278: warning: statement with no effect
lguest.c:1281: error: dereferencing pointer to incomplete type
lguest.c:1281: error: request for member ‘config_len’ in something not a structure or union
lguest.c:1281: warning: comparison between pointer and integer
make[1]: *** [lguest] Error 1
make[1]: Leaving directory `/usr/160gb/kernel/torvalds-linux-4cf670b/Documentation/lguest'
make: *** [debian/stamp/build/kernel] Error 2

Ok,.. so I am going to try and do a GIT difference (dont even know if this is even possible) to add the folders i am missing. AHHHH,... CRAP!!! I dont think that will actually work.

Any other Ideas?
0
 
LVL 34

Accepted Solution

by:
Duncan Roe earned 500 total points
ID: 36594152
Looks to me like all you need do is modify the #include line at lguest.c:52 in its new location. lguest.c was always in Documentation/lguest except at linux-2.3.0
12:29:18$ locate lguest.c
/usr/src/linux-2.6.33.4/Documentation/lguest/lguest.c
/usr/src/linux-2.6.27.7/Documentation/lguest/lguest.c
/usr/src/linux-2.6.25.4/Documentation/lguest/lguest.c
/usr/src/linux-2.6.27.5/Documentation/lguest/lguest.c
/usr/src/linux-2.6.30.6/Documentation/lguest/lguest.c
/usr/src/linux-2.6.31.1/Documentation/lguest/lguest.c
/usr/src/linux-2.6.29.2/Documentation/lguest/lguest.c
/usr/src/linux-2.6.32.8/Documentation/lguest/lguest.c
/usr/src/linux-2.6.36.2/Documentation/lguest/lguest.c
/usr/src/linux-2.6.37.1/Documentation/lguest/lguest.c
/usr/src/linux-2.6.38.2/Documentation/lguest/lguest.c
/usr/src/linux-2.6.39/Documentation/lguest/lguest.c
/usr/src/linux-3.0/Documentation/virtual/lguest/lguest.c

Open in new window

A diff shows a few changes - mostly code removal(?) apart from the changed include
12:31:07$ diff -r /usr/src/linux-2.6.39/Documentation/lguest /usr/src/linux-3.0/Documentation/virtual/lguest
diff -r /usr/src/linux-2.6.39/Documentation/lguest/Makefile /usr/src/linux-3.0/Documentation/virtual/lguest/Makefile
2c2
< # Missing headers?  Add "-I../../include -I../../arch/x86/include"
---
> # Missing headers?  Add "-I../../../include -I../../../arch/x86/include"
diff -r /usr/src/linux-2.6.39/Documentation/lguest/lguest.c /usr/src/linux-3.0/Documentation/virtual/lguest/lguest.c
52c52
< #include "../../include/linux/lguest_launcher.h"
---
> #include "../../../include/linux/lguest_launcher.h"
138,140d137
<       /* Does Guest want an intrrupt on empty? */
<       bool irq_on_empty;
< 
640,643c637
<               /* ... unless they've asked us to force one on empty. */
<               if (!vq->dev->irq_on_empty
<                   || lg_last_avail(vq) != vq->vring.avail->idx)
<                       return;
---
>               return;
1060,1068d1053
< static bool accepted_feature(struct device *dev, unsigned int bit)
< {
<       const u8 *features = get_feature_bits(dev) + dev->feature_len;
< 
<       if (dev->feature_len < bit / CHAR_BIT)
<               return false;
<       return features[bit / CHAR_BIT] & (1 << (bit % CHAR_BIT));
< }
< 
1082,1083d1066
<       dev->irq_on_empty = accepted_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
< 
1567d1549
<       add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY);
diff -r /usr/src/linux-2.6.39/Documentation/lguest/lguest.txt /usr/src/linux-3.0/Documentation/virtual/lguest/lguest.txt
77c77,78
<       Documentation/lguest/lguest 64 vmlinux --tunnet=192.168.19.1 --block=rootfile root=/dev/vda
---
>       Documentation/virtual/lguest/lguest 64 vmlinux --tunnet=192.168.19.1 \
>         --block=rootfile root=/dev/vda

Open in new window

The Makefile change is just a comment
0
 

Author Comment

by:jschultz0614
ID: 36594922
OMG... I should have noticed that... my apologies for posting that and DAMN you are a genius :). Cross your fingers, i'll give that a try.
0
 

Author Comment

by:jschultz0614
ID: 36594939
OK,... I am definately not a C programmer (more of a C#, ASP.NET programmer), but will try and change the include line from:
include "../../include/linux/lguest_launcher.h"

Open in new window


to:
#include <linux/lguest_launcher.h>

Open in new window


and see if that works. If not, I will have to use the first one and statically set the location.

Thanks again.
0
 
LVL 34

Expert Comment

by:Duncan Roe
ID: 36595016
Just change from ../../../include/linux/lguest_launcher.h to ../../include/linux/lguest_launcher.h (i.e. as per the diff, but backwards)
0
 

Author Comment

by:jschultz0614
ID: 36595188
@dunca_roe:
Thanks for your help man.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now