116631Sdl// SPDX-License-Identifier: GPL-2.0-only 216631Sdl/* 316631Sdl * linux/init/version.c 416631Sdl * 516631Sdl * Copyright (C) 1992 Theodore Ts'o 616631Sdl * 716631Sdl * May be freely distributed as part of Linux. 816631Sdl */ 916631Sdl 1016631Sdl#include <generated/compile.h> 1116631Sdl#include <linux/build-salt.h> 1216631Sdl#include <linux/elfnote-lto.h> 1316631Sdl#include <linux/export.h> 1416631Sdl#include <linux/init.h> 1516631Sdl#include <linux/printk.h> 1616631Sdl#include <linux/uts.h> 1716631Sdl#include <linux/utsname.h> 1816631Sdl#include <linux/proc_ns.h> 1916631Sdl 2016631Sdlstatic int __init early_hostname(char *arg) 2116631Sdl{ 2216631Sdl size_t bufsize = sizeof(init_uts_ns.name.nodename); 2316631Sdl size_t maxlen = bufsize - 1; 2416631Sdl ssize_t arglen; 2516631Sdl 2616631Sdl arglen = strscpy(init_uts_ns.name.nodename, arg, bufsize); 2716631Sdl if (arglen < 0) { 2816631Sdl pr_warn("hostname parameter exceeds %zd characters and will be truncated", 2916631Sdl maxlen); 3016631Sdl } 3116631Sdl return 0; 3216631Sdl} 3316631Sdlearly_param("hostname", early_hostname); 3416631Sdl 3516631Sdlconst char linux_proc_banner[] = 3616631Sdl "%s version %s" 3716631Sdl " (" LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST ")" 3816631Sdl " (" LINUX_COMPILER ") %s\n"; 3916631Sdl 4016631SdlBUILD_SALT; 4116631SdlBUILD_LTO_INFO; 4216631Sdl 4316631Sdl/* 4416631Sdl * init_uts_ns and linux_banner contain the build version and timestamp, 4516631Sdl * which are really fixed at the very last step of build process. 4616631Sdl * They are compiled with __weak first, and without __weak later. 4716631Sdl */ 4816631Sdl 4916631Sdlstruct uts_namespace init_uts_ns __weak; 5016631Sdlconst char linux_banner[] __weak; 5116631Sdl 5216631Sdl#include "version-timestamp.c" 5316631Sdl 5416631SdlEXPORT_SYMBOL_GPL(init_uts_ns); 5516631Sdl