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>
This commit is contained in:
parent
61c4f2c81c
commit
079f85e624
@ -9,12 +9,6 @@
|
|||||||
# Changed by many, many contributors over the years.
|
# Changed by many, many contributors over the years.
|
||||||
#
|
#
|
||||||
|
|
||||||
# ROOT_DEV specifies the default root-device when making the image.
|
|
||||||
# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
|
|
||||||
# the default of FLOPPY is used by 'build'.
|
|
||||||
|
|
||||||
ROOT_DEV := CURRENT
|
|
||||||
|
|
||||||
# If you want to preset the SVGA mode, uncomment the next line and
|
# If you want to preset the SVGA mode, uncomment the next line and
|
||||||
# set SVGA_MODE to whatever number you want.
|
# set SVGA_MODE to whatever number you want.
|
||||||
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
|
# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
|
||||||
@ -75,8 +69,7 @@ GCOV_PROFILE := n
|
|||||||
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
|
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
|
||||||
|
|
||||||
quiet_cmd_image = BUILD $@
|
quiet_cmd_image = BUILD $@
|
||||||
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
|
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
|
||||||
$(ROOT_DEV) > $@
|
|
||||||
|
|
||||||
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
|
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
|
||||||
$(call if_changed,image)
|
$(call if_changed,image)
|
||||||
|
@ -130,7 +130,7 @@ static void die(const char * str, ...)
|
|||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
die("Usage: build setup system [rootdev] [> image]");
|
die("Usage: build setup system [> image]");
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
@ -138,39 +138,14 @@ int main(int argc, char ** argv)
|
|||||||
unsigned int i, sz, setup_sectors;
|
unsigned int i, sz, setup_sectors;
|
||||||
int c;
|
int c;
|
||||||
u32 sys_size;
|
u32 sys_size;
|
||||||
u8 major_root, minor_root;
|
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
int fd;
|
int fd;
|
||||||
void *kernel;
|
void *kernel;
|
||||||
u32 crc = 0xffffffffUL;
|
u32 crc = 0xffffffffUL;
|
||||||
|
|
||||||
if ((argc < 3) || (argc > 4))
|
if (argc != 3)
|
||||||
usage();
|
usage();
|
||||||
if (argc > 3) {
|
|
||||||
if (!strcmp(argv[3], "CURRENT")) {
|
|
||||||
if (stat("/", &sb)) {
|
|
||||||
perror("/");
|
|
||||||
die("Couldn't stat /");
|
|
||||||
}
|
|
||||||
major_root = major(sb.st_dev);
|
|
||||||
minor_root = minor(sb.st_dev);
|
|
||||||
} else if (strcmp(argv[3], "FLOPPY")) {
|
|
||||||
if (stat(argv[3], &sb)) {
|
|
||||||
perror(argv[3]);
|
|
||||||
die("Couldn't stat root device.");
|
|
||||||
}
|
|
||||||
major_root = major(sb.st_rdev);
|
|
||||||
minor_root = minor(sb.st_rdev);
|
|
||||||
} else {
|
|
||||||
major_root = 0;
|
|
||||||
minor_root = 0;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
major_root = DEFAULT_MAJOR_ROOT;
|
|
||||||
minor_root = DEFAULT_MINOR_ROOT;
|
|
||||||
}
|
|
||||||
fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
|
|
||||||
|
|
||||||
/* Copy the setup code */
|
/* Copy the setup code */
|
||||||
file = fopen(argv[1], "r");
|
file = fopen(argv[1], "r");
|
||||||
@ -193,8 +168,8 @@ int main(int argc, char ** argv)
|
|||||||
memset(buf+c, 0, i-c);
|
memset(buf+c, 0, i-c);
|
||||||
|
|
||||||
/* Set the default root device */
|
/* Set the default root device */
|
||||||
buf[508] = minor_root;
|
buf[508] = DEFAULT_MINOR_ROOT;
|
||||||
buf[509] = major_root;
|
buf[509] = DEFAULT_MAJOR_ROOT;
|
||||||
|
|
||||||
fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
|
fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user