Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f9bb71d9
Commit
f9bb71d9
authored
Mar 09, 2003
by
Anton Blanchard
Browse files
Options
Browse Files
Download
Plain Diff
Merge samba.org:/scratch/anton/linux-2.5
into samba.org:/scratch/anton/export
parents
ef9eb933
c7650146
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
5 deletions
+113
-5
arch/i386/pci/irq.c
arch/i386/pci/irq.c
+1
-1
usr/Makefile
usr/Makefile
+22
-4
usr/gen_init_cpio.c
usr/gen_init_cpio.c
+90
-0
No files found.
arch/i386/pci/irq.c
View file @
f9bb71d9
...
...
@@ -817,7 +817,7 @@ int pirq_enable_irq(struct pci_dev *dev)
/* With IDE legacy devices the IRQ lookup failure is not a problem.. */
if
(
dev
->
class
>>
8
==
PCI_CLASS_STORAGE_IDE
&&
!
(
dev
->
class
&
0x5
))
return
;
return
0
;
printk
(
KERN_WARNING
"PCI: No IRQ known for interrupt pin %c of device %s.%s
\n
"
,
'A'
+
pin
-
1
,
dev
->
slot_name
,
msg
);
...
...
usr/Makefile
View file @
f9bb71d9
obj-y
:=
initramfs_data.o
host-progs
:=
gen_init_cpio
host-progs
:=
gen_init_cpio
clean-files
:=
initramfs_data.cpio.gz
LDFLAGS_initramfs_data.o
:=
$(LDFLAGS_BLOB)
-r
-T
$(obj)/initramfs_data.o
:
$(src)/initramfs_data.scr $(obj)/initramfs_data.cpio.gz FORCE
$(obj)/initramfs_data.o
:
$(src)/initramfs_data.scr
\
$(obj)/initramfs_data.cpio.gz FORCE
$(
call
if_changed,ld
)
$(obj)/initramfs_data.cpio.gz
:
$(obj)/gen_init_cpio
./
$<
|
gzip
-9c
>
$@
# initramfs-y are the programs which will be copied into the CPIO
# archive. Currently, the filenames are hardcoded in gen_init_cpio,
# but we need the information for the build as well, so it's duplicated
# here.
# Commented out for now
# initramfs-y := $(obj)/root/hello
quiet_cmd_cpio
=
CPIO
$@
cmd_cpio
=
./
$<
>
$@
$(obj)/initramfs_data.cpio
:
$(obj)/gen_init_cpio $(initramfs-y) FORCE
$(
call
if_changed,cpio
)
targets
+=
$(obj)
/initramfs_data.cpio
$(obj)/initramfs_data.cpio.gz
:
$(obj)/initramfs_data.cpio FORCE
$(
call
if_changed,gzip
)
targets
+=
$(obj)
/initramfs_data.cpio.gz
usr/gen_init_cpio.c
View file @
f9bb71d9
...
...
@@ -5,10 +5,28 @@
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <fcntl.h>
static
unsigned
int
offset
;
static
unsigned
int
ino
=
721
;
static
void
push_string
(
const
char
*
name
)
{
unsigned
int
name_len
=
strlen
(
name
)
+
1
;
fputs
(
name
,
stdout
);
putchar
(
0
);
offset
+=
name_len
;
}
static
void
push_pad
(
void
)
{
while
(
offset
&
3
)
{
putchar
(
0
);
offset
++
;
}
}
static
void
push_rest
(
const
char
*
name
)
{
unsigned
int
name_len
=
strlen
(
name
)
+
1
;
...
...
@@ -120,6 +138,78 @@ static void cpio_mknod(const char *name, unsigned int mode,
push_rest
(
name
);
}
/* Not marked static to keep the compiler quiet, as no one uses this yet... */
void
cpio_mkfile
(
const
char
*
filename
,
const
char
*
location
,
unsigned
int
mode
,
uid_t
uid
,
gid_t
gid
)
{
char
s
[
256
];
char
*
filebuf
;
struct
stat
buf
;
int
file
;
int
retval
;
int
i
;
mode
|=
S_IFREG
;
retval
=
stat
(
filename
,
&
buf
);
if
(
retval
)
{
fprintf
(
stderr
,
"Filename %s could not be located
\n
"
,
filename
);
goto
error
;
}
file
=
open
(
filename
,
O_RDONLY
);
if
(
file
<
0
)
{
fprintf
(
stderr
,
"Filename %s could not be opened for reading
\n
"
,
filename
);
goto
error
;
}
filebuf
=
malloc
(
buf
.
st_size
);
if
(
!
filebuf
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
goto
error_close
;
}
retval
=
read
(
file
,
filebuf
,
buf
.
st_size
);
if
(
retval
<
0
)
{
fprintf
(
stderr
,
"Can not read %s file
\n
"
,
filename
);
goto
error_free
;
}
sprintf
(
s
,
"%s%08X%08X%08lX%08lX%08X%08lX"
"%08X%08X%08X%08X%08X%08X%08X"
,
"070701"
,
/* magic */
ino
++
,
/* ino */
mode
,
/* mode */
(
long
)
uid
,
/* uid */
(
long
)
gid
,
/* gid */
1
,
/* nlink */
(
long
)
buf
.
st_mtime
,
/* mtime */
(
int
)
buf
.
st_size
,
/* filesize */
3
,
/* major */
1
,
/* minor */
0
,
/* rmajor */
0
,
/* rminor */
strlen
(
location
)
+
1
,
/* namesize */
0
);
/* chksum */
push_hdr
(
s
);
push_string
(
location
);
push_pad
();
for
(
i
=
0
;
i
<
buf
.
st_size
;
++
i
)
fputc
(
filebuf
[
i
],
stdout
);
close
(
file
);
free
(
filebuf
);
push_pad
();
return
;
error_free:
free
(
filebuf
);
error_close:
close
(
file
);
error:
exit
(
-
1
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
cpio_mkdir
(
"/dev"
,
0700
,
0
,
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment