Skip to content

Commit 079f85e

Browse files
michal42H. Peter Anvin
authored andcommitted
x86, build: Do not set the root_dev field in bzImage
This has been obsoleted by the root= commandline and the rdev utility for many, many years. People who still depend on this will surely have a copy of the rdev utility around, the rest of the world gets rid of another piece of buildhost-dependent data in the build. Thanks to Paul Bolle for the build.c cleanup. Cc: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Michal Marek <mmarek@suse.cz> Link: http://lkml.kernel.org/r/1302607824-24699-1-git-send-email-mmarek@suse.cz Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
1 parent 61c4f2c commit 079f85e

2 files changed

Lines changed: 5 additions & 37 deletions

File tree

‎arch/x86/boot/Makefile‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
# Changed by many, many contributors over the years.
1010
#
1111

12-
# ROOT_DEV specifies the default root-device when making the image.
13-
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
14-
# the default of FLOPPY is used by 'build'.
15-
16-
ROOT_DEV := CURRENT
17-
1812
# If you want to preset the SVGA mode, uncomment the next line and
1913
# set SVGA_MODE to whatever number you want.
2014
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
7569
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
7670

7771
quiet_cmd_image = BUILD $@
78-
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
79-
$(ROOT_DEV) > $@
72+
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
8073

8174
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
8275
$(call if_changed,image)

‎arch/x86/boot/tools/build.c‎

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -130,47 +130,22 @@ static void die(const char * str, ...)
130130

131131
static void usage(void)
132132
{
133-
die("Usage: build setup system [rootdev] [> image]");
133+
die("Usage: build setup system [> image]");
134134
}
135135

136136
int main(int argc, char ** argv)
137137
{
138138
unsigned int i, sz, setup_sectors;
139139
int c;
140140
u32 sys_size;
141-
u8 major_root, minor_root;
142141
struct stat sb;
143142
FILE *file;
144143
int fd;
145144
void *kernel;
146145
u32 crc = 0xffffffffUL;
147146

148-
if ((argc < 3) || (argc > 4))
147+
if (argc != 3)
149148
usage();
150-
if (argc > 3) {
151-
if (!strcmp(argv[3], "CURRENT")) {
152-
if (stat("/", &sb)) {
153-
perror("/");
154-
die("Couldn't stat /");
155-
}
156-
major_root = major(sb.st_dev);
157-
minor_root = minor(sb.st_dev);
158-
} else if (strcmp(argv[3], "FLOPPY")) {
159-
if (stat(argv[3], &sb)) {
160-
perror(argv[3]);
161-
die("Couldn't stat root device.");
162-
}
163-
major_root = major(sb.st_rdev);
164-
minor_root = minor(sb.st_rdev);
165-
} else {
166-
major_root = 0;
167-
minor_root = 0;
168-
}
169-
} else {
170-
major_root = DEFAULT_MAJOR_ROOT;
171-
minor_root = DEFAULT_MINOR_ROOT;
172-
}
173-
fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
174149

175150
/* Copy the setup code */
176151
file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
193168
memset(buf+c, 0, i-c);
194169

195170
/* Set the default root device */
196-
buf[508] = minor_root;
197-
buf[509] = major_root;
171+
buf[508] = DEFAULT_MINOR_ROOT;
172+
buf[509] = DEFAULT_MAJOR_ROOT;
198173

199174
fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
200175

0 commit comments

Comments
 (0)