diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/boot/Makefile | 9 | ||||
-rw-r--r-- | arch/x86/boot/tools/build.c | 33 |
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 | |||
16 | ROOT_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 | ||
77 | quiet_cmd_image = BUILD $@ | 71 | quiet_cmd_image = BUILD $@ |
78 | cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ | 72 | cmd_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 | ||
131 | static void usage(void) | 131 | static void usage(void) |
132 | { | 132 | { |
133 | die("Usage: build setup system [rootdev] [> image]"); | 133 | die("Usage: build setup system [> image]"); |
134 | } | 134 | } |
135 | 135 | ||
136 | int main(int argc, char ** argv) | 136 | int 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 | ||