aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-04-12 07:30:24 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2011-05-25 15:46:05 -0400
commit079f85e624189292d1c818b47764916bf8cf84a8 (patch)
tree05414be199e196dc597c34910df12e7fd778e49b /arch
parent61c4f2c81c61f73549928dfd9f3e8f26aa36a8cf (diff)
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/boot/Makefile9
-rw-r--r--arch/x86/boot/tools/build.c33
2 files changed, 5 insertions, 37 deletions
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile
index f7cb086b4add..95365a82b6a0 100644
--- a/arch/x86/boot/Makefile
+++ b/arch/x86/boot/Makefile
@@ -9,12 +9,6 @@
9# Changed by many, many contributors over the years. 9# Changed by many, many contributors over the years.
10# 10#
11 11
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
16ROOT_DEV := CURRENT
17
18# If you want to preset the SVGA mode, uncomment the next line and 12# If you want to preset the SVGA mode, uncomment the next line and
19# set SVGA_MODE to whatever number you want. 13# set SVGA_MODE to whatever number you want.
20# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. 14# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
75$(obj)/bzImage: asflags-y := $(SVGA_MODE) 69$(obj)/bzImage: asflags-y := $(SVGA_MODE)
76 70
77quiet_cmd_image = BUILD $@ 71quiet_cmd_image = BUILD $@
78cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ 72cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
79 $(ROOT_DEV) > $@
80 73
81$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE 74$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
82 $(call if_changed,image) 75 $(call if_changed,image)
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
index ee3a4ea923ac..fdc60a0b3c20 100644
--- a/arch/x86/boot/tools/build.c
+++ b/arch/x86/boot/tools/build.c
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
130 130
131static void usage(void) 131static void usage(void)
132{ 132{
133 die("Usage: build setup system [rootdev] [> image]"); 133 die("Usage: build setup system [> image]");
134} 134}
135 135
136int main(int argc, char ** argv) 136int main(int argc, char ** argv)
@@ -138,39 +138,14 @@ int main(int argc, char ** argv)
138 unsigned int i, sz, setup_sectors; 138 unsigned int i, sz, setup_sectors;
139 int c; 139 int c;
140 u32 sys_size; 140 u32 sys_size;
141 u8 major_root, minor_root;
142 struct stat sb; 141 struct stat sb;
143 FILE *file; 142 FILE *file;
144 int fd; 143 int fd;
145 void *kernel; 144 void *kernel;
146 u32 crc = 0xffffffffUL; 145 u32 crc = 0xffffffffUL;
147 146
148 if ((argc < 3) || (argc > 4)) 147 if (argc != 3)
149 usage(); 148 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);
174 149
175 /* Copy the setup code */ 150 /* Copy the setup code */
176 file = fopen(argv[1], "r"); 151 file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
193 memset(buf+c, 0, i-c); 168 memset(buf+c, 0, i-c);
194 169
195 /* Set the default root device */ 170 /* Set the default root device */
196 buf[508] = minor_root; 171 buf[508] = DEFAULT_MINOR_ROOT;
197 buf[509] = major_root; 172 buf[509] = DEFAULT_MAJOR_ROOT;
198 173
199 fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i); 174 fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
200 175