From 7fe1c5fe90a24780ca52c1315f76416a4bdbe2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 8 Sep 2010 16:52:15 +0000 Subject: [PATCH 01/14] Making eval-config not pass 'platform' as a nixpkgs parameter, but expect a nixpkgs config attribute. svn path=/nixos/branches/stdenv-updates/; revision=23688 --- lib/eval-config.nix | 2 +- modules/misc/nixpkgs.nix | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/eval-config.nix b/lib/eval-config.nix index 8a7b225e850..e3bccb775aa 100644 --- a/lib/eval-config.nix +++ b/lib/eval-config.nix @@ -60,7 +60,7 @@ rec { in { inherit system; - inherit (nixpkgsOptions) config platform; + inherit (nixpkgsOptions) config; }); # Optionally check wether all config values have corresponding diff --git a/modules/misc/nixpkgs.nix b/modules/misc/nixpkgs.nix index 8173d716d84..2fb61f686f0 100644 --- a/modules/misc/nixpkgs.nix +++ b/modules/misc/nixpkgs.nix @@ -13,12 +13,5 @@ ''; }; - nixpkgs.platform = pkgs.lib.mkOption { - default = pkgs.platforms.pc; - description = '' - The platform for the Nix Packages collection. - ''; - }; - }; } From ccf7852e115fd4d5a7dd0255f2f18debc4dcd1ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 8 Sep 2010 16:53:36 +0000 Subject: [PATCH 02/14] Updating the system-tarball work, having just tested that of the fuloong2f. svn path=/nixos/branches/stdenv-updates/; revision=23689 --- lib/make-system-tarball.nix | 2 +- .../cd-dvd/system-tarball-fuloong2f.nix | 152 ++++++++++++++++++ .../installer/cd-dvd/system-tarball-pc.nix | 6 + modules/installer/cd-dvd/system-tarball.nix | 30 +--- release.nix | 12 +- 5 files changed, 171 insertions(+), 31 deletions(-) create mode 100644 modules/installer/cd-dvd/system-tarball-fuloong2f.nix diff --git a/lib/make-system-tarball.nix b/lib/make-system-tarball.nix index 0fa34a186ad..301294e1964 100644 --- a/lib/make-system-tarball.nix +++ b/lib/make-system-tarball.nix @@ -1,7 +1,7 @@ { stdenv, perl, xz, pathsFromGraph , # The file name of the resulting tarball - fileName ? "nixos-built.tar.bz2" + fileName ? "nixos-system-${stdenv.system}" , # The files and directories to be placed in the tarball. # This is a list of attribute sets {source, target} where `source' diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix new file mode 100644 index 00000000000..8ef112cc476 --- /dev/null +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -0,0 +1,152 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + # A dummy /etc/nixos/configuration.nix in the booted CD that + # rebuilds the CD's configuration (and allows the configuration to + # be modified, of course, providing a true live CD). Problem is + # that we don't really know how the CD was built - the Nix + # expression language doesn't allow us to query the expression being + # evaluated. So we'll just hope for the best. + dummyConfiguration = pkgs.writeText "configuration.nix" + '' + {config, pkgs, ...}: + + { + require = [ ]; + + # Add your own options below and run "nixos-rebuild switch". + # E.g., + # services.openssh.enable = true; + } + ''; + + + pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l; + + options = { + + system.nixosVersion = mkOption { + default = "${builtins.readFile ../../../VERSION}"; + description = '' + NixOS version number. + ''; + }; + }; + +in + +{ + require = + [ options + ./system-tarball.nix + ../../hardware/network/rt73.nix + ]; + + + # Disable some other stuff we don't need. + security.sudo.enable = false; + + # Include only the en_US locale. This saves 75 MiB or so compared to + # the full glibcLocales package. + i18n.supportedLocales = ["en_US.UTF-8/UTF-8" "en_US/ISO-8859-1"]; + + # Include some utilities that are useful for installing or repairing + # the system. + environment.systemPackages = + [ pkgs.subversion # for nixos-checkout + pkgs.w3m # needed for the manual anyway + pkgs.testdisk # useful for repairing boot problems + pkgs.mssys # for writing Microsoft boot sectors / MBRs + pkgs.parted + pkgs.ddrescue + pkgs.ccrypt + pkgs.cryptsetup # needed for dm-crypt volumes + + # Some networking tools. + pkgs.sshfsFuse + pkgs.socat + pkgs.screen + pkgs.wpa_supplicant # !!! should use the wpa module + + # Hardware-related tools. + pkgs.sdparm + pkgs.hdparm + pkgs.dmraid + + # Tools to create / manipulate filesystems. + pkgs.ntfsprogs # for resizing NTFS partitions + pkgs.btrfsProgs + pkgs.jfsutils + pkgs.jfsrec + + # Some compression/archiver tools. + pkgs.unrar + pkgs.unzip + pkgs.zip + pkgs.xz + pkgs.dar # disk archiver + + # Some editors. + pkgs.nvi + pkgs.bvi # binary editor + pkgs.joe + ]; + + # The initrd has to contain any module that might be necessary for + # mounting the CD/DVD. + boot.initrd.availableKernelModules = + [ "vfat" "reiserfs" ]; + + boot.kernelPackages = pkgs.linuxPackages_2_6_35; + + boot.initrd.kernelModules = + [ # Wait for SCSI devices to appear. + "scsi_wait_scan" + ]; + + boot.postBootCommands = + '' + mkdir -p /mnt + + cp ${dummyConfiguration} /etc/nixos/configuration.nix + ''; + + # Some more help text. + services.mingetty.helpLine = + '' + + Log in as "root" with an empty password. ${ + if config.services.xserver.enable then + "Type `start xserver' to start\nthe graphical user interface." + else "" + } + ''; + + # Include the firmware for various wireless cards. + networking.enableRT73Firmware = true; + networking.enableIntel2200BGFirmware = true; + + # To speed up further installation of packages, include the complete stdenv + # in the Nix store of the tarball. + tarball.storeContents = pkgs2storeContents [ pkgs.stdenv ]; + + # Allow sshd to be started manually through "start sshd". It should + # not be started by default on the installation CD because the + # default root password is empty. + services.openssh.enable = true; + + jobs.openssh.startOn = pkgs.lib.mkOverride 50 {} ""; + + services.ttyBackgrounds.enable = false; + + boot.loader.grub.enable = false; + boot.loader.generationsDir.enable = false; + system.boot.loader.kernelFile = "/vmlinux"; + + nixpkgs.config = { + platform = (import /etc/nixos/nixpkgs/pkgs/top-level/platforms.nix).fuloong2f_n32; + }; +} diff --git a/modules/installer/cd-dvd/system-tarball-pc.nix b/modules/installer/cd-dvd/system-tarball-pc.nix index 5a01dec5202..0c0069c6058 100644 --- a/modules/installer/cd-dvd/system-tarball-pc.nix +++ b/modules/installer/cd-dvd/system-tarball-pc.nix @@ -170,6 +170,12 @@ in # in the Nix store of the tarball. tarball.storeContents = pkgs2storeContents [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ]; + tarball.contents = + [ { source = config.boot.kernelPackages.kernel + "/vmlinuz"; + target = "/boot/vmlinuz"; + } + ]; + # Allow sshd to be started manually through "start sshd". It should # not be started by default on the installation CD because the # default root password is empty. diff --git a/modules/installer/cd-dvd/system-tarball.nix b/modules/installer/cd-dvd/system-tarball.nix index 70bb12eac00..e5902de05e9 100644 --- a/modules/installer/cd-dvd/system-tarball.nix +++ b/modules/installer/cd-dvd/system-tarball.nix @@ -31,14 +31,6 @@ let }; - # A clue for the uboot loading - ubootKernelParams = pkgs.writeText "uboot-kernel-params.txt" '' - Kernel Parameters: - init=${config.system.build.bootStage2} - systemConfig=${config.system.build.toplevel} - ${toString config.boot.kernelParams} - ''; - versionFile = pkgs.writeText "nixos-version" config.system.nixosVersion; in @@ -52,14 +44,12 @@ in # !!! Hack - attributes expected by other modules. system.build.menuBuilder = "true"; - system.boot.loader.kernelFile = "bzImage"; - environment.systemPackages = [ pkgs.grub2 ]; # In stage 1 of the boot, mount the CD/DVD as the root FS by label # so that we don't need to know its device. fileSystems = [ { mountPoint = "/"; - label = "rootfs"; + device = "/dev/sda"; } ]; @@ -83,23 +73,9 @@ in # Individual files to be included on the CD, outside of the Nix # store on the CD. tarball.contents = - [ { source = config.boot.kernelPackages.kernel + "/bzImage"; - target = "/boot/bzImage"; - } - { source = config.system.build.initialRamdisk + "/initrd"; + [ { source = config.system.build.initialRamdisk + "/initrd"; target = "/boot/initrd"; } - { source = "${pkgs.grub2}/share/grub/unicode.pf2"; - target = "/boot/grub/unicode.pf2"; - } - { source = config.boot.loader.grub.splashImage; - target = "/boot/grub/splash.png"; - } -/* - { source = pkgs.ubootKernelParams; - target = "/uboot-kernelparams.txt"; - } -*/ { source = versionFile; target = "/nixos-version.txt"; } @@ -116,7 +92,7 @@ in '' # After booting, register the contents of the Nix store on the # CD in the Nix database in the tmpfs. - ${config.environment.nix}/bin/nix-store --load-db < /nix/store/nix-path-registration + ${config.environment.nix}/bin/nix-store --load-db < /nix-path-registration # nixos-rebuild also requires a "system" profile and an # /etc/NIXOS tag. diff --git a/release.nix b/release.nix index d0ae398289f..dacbeab0cbe 100644 --- a/release.nix +++ b/release.nix @@ -49,9 +49,7 @@ let }: with import nixpkgs {inherit system;}; - let - version = builtins.readFile ./VERSION + (if officialRelease then "" else "pre${toString nixosSrc.rev}"); versionModule = { system.nixosVersion = version; }; @@ -60,7 +58,7 @@ let inherit system nixpkgs; modules = [ module versionModule ]; }).config; - + tarball = config.system.build.tarball; in tarball // @@ -136,6 +134,14 @@ let module = ./modules/installer/cd-dvd/system-tarball-pc.nix; }; + system_tarball_fuloong2f = makeSystemTarball { + module = ./modules/installer/cd-dvd/system-tarball-fuloong2f.nix; + } { system = "mips64-linux"; }; + + system_tarball_sheevaplug = makeSystemTarball { + module = ./modules/installer/cd-dvd/system-tarball-sheevaplug.nix; + } { system = "armv5tel-linux"; }; + # Hacky: doesn't depend on configuration. Yet configuration is evaluated (TODO) minimal_install_archive = {system ? "i686-linux"}: (iso_minimal {inherit system;}) .config.system.build.minimalInstallArchive; From 9ba735714a6c5c445d145ca4d5df3fe698133e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 8 Sep 2010 17:15:31 +0000 Subject: [PATCH 03/14] Adding a system-tarball expression for the sheevaplug (which a previous commit already put a reference to) svn path=/nixos/branches/stdenv-updates/; revision=23690 --- .../cd-dvd/system-tarball-sheevaplug.nix | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 modules/installer/cd-dvd/system-tarball-sheevaplug.nix diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix new file mode 100644 index 00000000000..b834ae3ab3d --- /dev/null +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -0,0 +1,190 @@ +# This module contains the basic configuration for building a NixOS +# installation CD. + +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + # A dummy /etc/nixos/configuration.nix in the booted CD that + # rebuilds the CD's configuration (and allows the configuration to + # be modified, of course, providing a true live CD). Problem is + # that we don't really know how the CD was built - the Nix + # expression language doesn't allow us to query the expression being + # evaluated. So we'll just hope for the best. + dummyConfiguration = pkgs.writeText "configuration.nix" + '' + {config, pkgs, ...}: + + { + require = [ ]; + + # Add your own options below and run "nixos-rebuild switch". + # E.g., + # services.sshd.enable = true; + } + ''; + + + pkgs2storeContents = l : map (x: { object = x; symlink = "none"; }) l; + + options = { + + system.nixosVersion = mkOption { + default = "${builtins.readFile ../../../VERSION}"; + description = '' + NixOS version number. + ''; + }; + }; + + # A clue for the uboot loading + kernelParams = pkgs.writeText "kernel-params.txt" '' + Kernel Parameters: + init=${config.system.build.bootStage2} + systemConfig=${config.system.build.toplevel} + ${toString config.boot.kernelParams} + ''; + + +in + +{ + require = + [ options + ./system-tarball.nix + ../../hardware/network/rt73.nix + ]; + + # Disable some other stuff we don't need. + security.sudo.enable = false; + + # Include only the en_US locale. This saves 75 MiB or so compared to + # the full glibcLocales package. + i18n.supportedLocales = ["en_US.UTF-8/UTF-8" "en_US/ISO-8859-1"]; + + # Include some utilities that are useful for installing or repairing + # the system. + environment.systemPackages = + [ pkgs.subversion # for nixos-checkout + pkgs.w3m # needed for the manual anyway + pkgs.ddrescue + pkgs.ccrypt + pkgs.cryptsetup # needed for dm-crypt volumes + + # Some networking tools. + pkgs.sshfsFuse + pkgs.socat + pkgs.screen + pkgs.wpa_supplicant # !!! should use the wpa module + + # Hardware-related tools. + pkgs.sdparm + pkgs.hdparm + pkgs.dmraid + + # Tools to create / manipulate filesystems. + pkgs.btrfsProgs + + # Some compression/archiver tools. + pkgs.unrar + pkgs.unzip + pkgs.zip + pkgs.xz + pkgs.dar # disk archiver + + # Some editors. + pkgs.nvi + pkgs.bvi # binary editor + pkgs.joe + ]; + + boot.loader.grub.enable = false; + boot.loader.generationsDir.enable = false; + system.boot.loader.kernelFile = "/uImage"; + + boot.initrd.availableKernelModules = + [ "mvsdio" "mmc_block" "reiserfs" "ext3" "ums-cypress" "rtc_mv" + "ext4" ]; + + boot.initrd.kernelModules = + [ + "scsi_wait_scan" + ]; + + boot.postBootCommands = + '' + mkdir -p /mnt + + cp ${dummyConfiguration} /etc/nixos/configuration.nix + ''; + + boot.initrd.extraUtilsCommands = + '' + cp ${pkgs.utillinux}/sbin/hwclock $out/bin + ''; + + boot.initrd.postDeviceCommands = + '' + hwclock -s + ''; + + boot.kernelParams = + [ + "selinux=0" + "console=tty1" + ]; + + boot.kernelPackages = pkgs.linuxPackages_2_6_35; + + services.mingetty = { + ttys = [ "ttyS0" ]; + + # Some more help text. + helpLine = '' + Log in as "root" with an empty password. ${ + if config.services.xserver.enable then + "Type `start xserver' to start\nthe graphical user interface." + else "" + } + ''; + }; + + # Setting vesa, we don't get the nvidia driver, which can't work in arm. + services.xserver.videoDriver = "vesa"; + services.xserver.videoDrivers = []; + services.nixosManual.enable = false; + + # Include the firmware for various wireless cards. + networking.enableRT73Firmware = true; + networking.enableIntel2200BGFirmware = true; + + # To speed up further installation of packages, include the complete stdenv + # in the Nix store of the tarball. + tarball.storeContents = pkgs2storeContents [ pkgs.stdenv ]; + tarball.contents = [ + { source = kernelParams; + target = "/kernelparams.txt"; + } + { source = config.boot.kernelPackages.kernel + config.system.boot.loader.kernelFile; + target = "/boot/uImage"; + } + { source = pkgs.ubootSheevaplug; + target = "/boot/uboot"; + } + ]; + + # Allow sshd to be started manually through "start sshd". It should + # not be started by default on the installation CD because the + # default root password is empty. + services.openssh.enable = true; + services.ttyBackgrounds.enable = false; + jobs.openssh.startOn = pkgs.lib.mkOverride 50 {} ""; + + nixpkgs.config = { + packageOverrides = pkgs : rec { + }; + platform = (import /etc/nixos/nixpkgs/pkgs/top-level/platforms.nix).sheevaplug; + }; +} From 245df33c6c158eed36d9ee17fa41944437d536d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 13 Sep 2010 20:52:49 +0000 Subject: [PATCH 04/14] Making the system tarballs of fuloong and sheevaplug reference the proper nixpkgs, and not that of /etc/... svn path=/nixos/branches/stdenv-updates/; revision=23772 --- modules/installer/cd-dvd/system-tarball-fuloong2f.nix | 2 +- modules/installer/cd-dvd/system-tarball-sheevaplug.nix | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 8ef112cc476..72b358f846d 100644 --- a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -147,6 +147,6 @@ in system.boot.loader.kernelFile = "/vmlinux"; nixpkgs.config = { - platform = (import /etc/nixos/nixpkgs/pkgs/top-level/platforms.nix).fuloong2f_n32; + platform = pkgs.platforms.fuloong2f_n32; }; } diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index b834ae3ab3d..745e756a0b4 100644 --- a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -183,8 +183,6 @@ in jobs.openssh.startOn = pkgs.lib.mkOverride 50 {} ""; nixpkgs.config = { - packageOverrides = pkgs : rec { - }; - platform = (import /etc/nixos/nixpkgs/pkgs/top-level/platforms.nix).sheevaplug; + platform = pkgs.platforms.sheevaplug; }; } From 7672c36a70436841cfa25a620cc08c60cf3bd919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Wed, 15 Sep 2010 21:36:56 +0000 Subject: [PATCH 05/14] Trying to get system-tarball-pc build properly. svn path=/nixos/branches/stdenv-updates/; revision=23814 --- modules/installer/cd-dvd/system-tarball.nix | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball.nix b/modules/installer/cd-dvd/system-tarball.nix index e5902de05e9..3418afc9c3d 100644 --- a/modules/installer/cd-dvd/system-tarball.nix +++ b/modules/installer/cd-dvd/system-tarball.nix @@ -38,13 +38,6 @@ in { require = options; - # Don't build the GRUB menu builder script, since we don't need it - # here and it causes a cyclic dependency. - boot.loader.grub.enable = false; - - # !!! Hack - attributes expected by other modules. - system.build.menuBuilder = "true"; - # In stage 1 of the boot, mount the CD/DVD as the root FS by label # so that we don't need to know its device. fileSystems = From 83d012ba13c03ec373baa2b4cc0abbf8b6674e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 16 Sep 2010 19:24:52 +0000 Subject: [PATCH 06/14] Trying to fix again system-tarball-pc (again, the kernel file name) svn path=/nixos/branches/stdenv-updates/; revision=23824 --- modules/installer/cd-dvd/system-tarball-pc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball-pc.nix b/modules/installer/cd-dvd/system-tarball-pc.nix index 0c0069c6058..49d0e4eea54 100644 --- a/modules/installer/cd-dvd/system-tarball-pc.nix +++ b/modules/installer/cd-dvd/system-tarball-pc.nix @@ -171,8 +171,8 @@ in tarball.storeContents = pkgs2storeContents [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ]; tarball.contents = - [ { source = config.boot.kernelPackages.kernel + "/vmlinuz"; - target = "/boot/vmlinuz"; + [ { source = config.boot.kernelPackages.kernel + config.system.boot.loader.kernelFile; + target = "/boot/" + config.system.boot.loader.kernelFile; } ]; From 3b216865d22301a0b7b85a0f34198704b9849923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 16 Sep 2010 19:25:29 +0000 Subject: [PATCH 07/14] Writing better some sheevaplug system-tarball lines (kernel parameters in a single line, for example) svn path=/nixos/branches/stdenv-updates/; revision=23825 --- modules/installer/cd-dvd/system-tarball-sheevaplug.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index 745e756a0b4..5eb0cd503d7 100644 --- a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -39,12 +39,10 @@ let }; }; - # A clue for the uboot loading + # A clue for the kernel loading kernelParams = pkgs.writeText "kernel-params.txt" '' Kernel Parameters: - init=${config.system.build.bootStage2} - systemConfig=${config.system.build.toplevel} - ${toString config.boot.kernelParams} + init=${config.system.build.bootStage2} systemConfig=${config.system.build.toplevel} ${toString config.boot.kernelParams} ''; From 743b75fbaf69f01e4ca75016e66d9db80bb2456d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 16 Sep 2010 19:26:34 +0000 Subject: [PATCH 08/14] Making the fuloong2f system-tarball more specific for the fuloong, so, helping in how to use the system more easily. svn path=/nixos/branches/stdenv-updates/; revision=23826 --- .../cd-dvd/system-tarball-fuloong2f.nix | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 72b358f846d..127b6d30bc7 100644 --- a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -17,9 +17,11 @@ let { require = [ ]; - # Add your own options below and run "nixos-rebuild switch". + # Add your own options below # E.g., # services.openssh.enable = true; + + nixpkgs.config.platform = pkgs.platforms.fuloong2f_n32; } ''; @@ -35,6 +37,20 @@ let ''; }; }; + + # A clue for the kernel loading + kernelParams = pkgs.writeText "kernel-params.txt" '' + Kernel Parameters: + init=/boot/init systemConfig=/boot/init ${toString config.boot.kernelParams} + ''; + + # System wide nixpkgs config + nixpkgsUserConfig = pkgs.writeText "config.nix" '' + pkgs: + { + platform = pkgs.platforms.fuloong2f_n32; + } + ''; in @@ -101,6 +117,7 @@ in [ "vfat" "reiserfs" ]; boot.kernelPackages = pkgs.linuxPackages_2_6_35; + boot.kernelParams = [ "console=tty" ]; boot.initrd.kernelModules = [ # Wait for SCSI devices to appear. @@ -131,7 +148,29 @@ in # To speed up further installation of packages, include the complete stdenv # in the Nix store of the tarball. - tarball.storeContents = pkgs2storeContents [ pkgs.stdenv ]; + tarball.storeContents = pkgs2storeContents [ pkgs.stdenv ] + ++ [ + { + object = config.system.build.bootStage2; + symlink = "/boot/init"; + } + { + object = config.system.build.toplevel; + symlink = "/boot/system"; + } + ]; + + tarball.contents = [ + { source = kernelParams; + target = "/kernelparams.txt"; + } + { source = config.boot.kernelPackages.kernel + config.system.boot.loader.kernelFile; + target = "/boot/vmlinux"; + } + { source = nixpkgsUserConfig; + target = "/root/.nixpkgs/config.nix"; + } + ]; # Allow sshd to be started manually through "start sshd". It should # not be started by default on the installation CD because the @@ -146,6 +185,9 @@ in boot.loader.generationsDir.enable = false; system.boot.loader.kernelFile = "/vmlinux"; + # Needed for nixos to evaluate + system.build.menuBuilder = "true"; + nixpkgs.config = { platform = pkgs.platforms.fuloong2f_n32; }; From c1e4586ed1a7f68fc2e0de0f0df9f8c84f463fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 17 Sep 2010 17:25:46 +0000 Subject: [PATCH 09/14] Again trying to get the kernelFile paths right svn path=/nixos/branches/stdenv-updates/; revision=23836 --- modules/installer/cd-dvd/system-tarball-fuloong2f.nix | 6 +++--- modules/installer/cd-dvd/system-tarball-pc.nix | 2 +- modules/installer/cd-dvd/system-tarball-sheevaplug.nix | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 127b6d30bc7..41386069e73 100644 --- a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -164,8 +164,8 @@ in { source = kernelParams; target = "/kernelparams.txt"; } - { source = config.boot.kernelPackages.kernel + config.system.boot.loader.kernelFile; - target = "/boot/vmlinux"; + { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile; + target = "/boot/" + config.system.boot.loader.kernelFile; } { source = nixpkgsUserConfig; target = "/root/.nixpkgs/config.nix"; @@ -183,7 +183,7 @@ in boot.loader.grub.enable = false; boot.loader.generationsDir.enable = false; - system.boot.loader.kernelFile = "/vmlinux"; + system.boot.loader.kernelFile = "vmlinux"; # Needed for nixos to evaluate system.build.menuBuilder = "true"; diff --git a/modules/installer/cd-dvd/system-tarball-pc.nix b/modules/installer/cd-dvd/system-tarball-pc.nix index 49d0e4eea54..b81b7d5d0a9 100644 --- a/modules/installer/cd-dvd/system-tarball-pc.nix +++ b/modules/installer/cd-dvd/system-tarball-pc.nix @@ -171,7 +171,7 @@ in tarball.storeContents = pkgs2storeContents [ pkgs.stdenv pkgs.klibc pkgs.klibcShrunk ]; tarball.contents = - [ { source = config.boot.kernelPackages.kernel + config.system.boot.loader.kernelFile; + [ { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile; target = "/boot/" + config.system.boot.loader.kernelFile; } ]; diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index 5eb0cd503d7..f50d4353b34 100644 --- a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -100,7 +100,7 @@ in boot.loader.grub.enable = false; boot.loader.generationsDir.enable = false; - system.boot.loader.kernelFile = "/uImage"; + system.boot.loader.kernelFile = "uImage"; boot.initrd.availableKernelModules = [ "mvsdio" "mmc_block" "reiserfs" "ext3" "ums-cypress" "rtc_mv" @@ -165,8 +165,8 @@ in { source = kernelParams; target = "/kernelparams.txt"; } - { source = config.boot.kernelPackages.kernel + config.system.boot.loader.kernelFile; - target = "/boot/uImage"; + { source = config.boot.kernelPackages.kernel + "/" + config.system.boot.loader.kernelFile; + target = "/boot/" + config.system.boot.loader.kernelFile; } { source = pkgs.ubootSheevaplug; target = "/boot/uboot"; From 3c6e5ef88e4b8296e648794f00d1f119d5ee095b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 7 Oct 2010 21:03:23 +0000 Subject: [PATCH 10/14] Updating from trunk. I had to fix conflicts in the pcre expression, and as usual, all-packages.nix about stdenv2. svn path=/nixos/branches/stdenv-updates/; revision=24153 --- release.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release.nix b/release.nix index dacbeab0cbe..8a48f46ad35 100644 --- a/release.nix +++ b/release.nix @@ -1,4 +1,4 @@ -{ nixpkgs ? ../nixpkgs }: +{ nixpkgs ? ../stdenv-updates-svn }: let @@ -66,6 +66,7 @@ let description = "NixOS system tarball for ${system} - ${stdenv.platform.name}"; maintainers = map (x: lib.getAttr x lib.maintainers) maintainers; }; + inherit config; }; From 7eb7abdfd21c09530c76ab966850f71f7795fca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 7 Oct 2010 21:16:05 +0000 Subject: [PATCH 11/14] Set assertions requiring specific systems for some system tarballs. svn path=/nixos/branches/stdenv-updates/; revision=24154 --- release.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/release.nix b/release.nix index 8a48f46ad35..aa1fdb8469e 100644 --- a/release.nix +++ b/release.nix @@ -135,11 +135,15 @@ let module = ./modules/installer/cd-dvd/system-tarball-pc.nix; }; - system_tarball_fuloong2f = makeSystemTarball { + system_tarball_fuloong2f = + assert builtins.currentSystem == "mips64-linux"; + makeSystemTarball { module = ./modules/installer/cd-dvd/system-tarball-fuloong2f.nix; } { system = "mips64-linux"; }; - system_tarball_sheevaplug = makeSystemTarball { + system_tarball_sheevaplug = + assert builtins.currentSystem == "armv5tel-linux"; + makeSystemTarball { module = ./modules/installer/cd-dvd/system-tarball-sheevaplug.nix; } { system = "armv5tel-linux"; }; From 4894a15c70563e12d777efdc36564b58ca73c651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 10 Oct 2010 11:55:05 +0000 Subject: [PATCH 12/14] I had did a merge from trunk when nixos trunk was broken. Remerging after the trunk fix. svn path=/nixos/branches/stdenv-updates/; revision=24203 --- modules/module-list.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/module-list.nix b/modules/module-list.nix index 4bc46544d10..f70473f1b9b 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -14,7 +14,6 @@ ./config/users-groups.nix ./hardware/network/intel-2200bg.nix ./hardware/network/intel-3945abg.nix - ./hardware/network/rt2870.nix ./hardware/network/rt73.nix ./hardware/pcmcia.nix ./installer/generations-dir/generations-dir.nix From 6a08a791c99718d99716b3cac22f04ee2e8cceae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 18 Oct 2010 21:45:21 +0000 Subject: [PATCH 13/14] Fixing the reference to nixpkgs. I might have committed what there was on error. svn path=/nixos/branches/stdenv-updates/; revision=24353 --- release.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.nix b/release.nix index aa1fdb8469e..c50cfa03095 100644 --- a/release.nix +++ b/release.nix @@ -1,4 +1,4 @@ -{ nixpkgs ? ../stdenv-updates-svn }: +{ nixpkgs ? ../nixpkgs }: let From 8c27201ce0170a0fb38e5c808f359cea2bbcbe2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sun, 31 Oct 2010 19:34:39 +0000 Subject: [PATCH 14/14] Fixing mkOverride and openssh things on system-tarballs svn path=/nixos/branches/stdenv-updates/; revision=24554 --- modules/installer/cd-dvd/system-tarball-fuloong2f.nix | 2 +- modules/installer/cd-dvd/system-tarball-pc.nix | 2 +- modules/installer/cd-dvd/system-tarball-sheevaplug.nix | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 41386069e73..7ece0716df6 100644 --- a/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -177,7 +177,7 @@ in # default root password is empty. services.openssh.enable = true; - jobs.openssh.startOn = pkgs.lib.mkOverride 50 {} ""; + jobs.openssh.startOn = pkgs.lib.mkOverrideTemplate 50 {} ""; services.ttyBackgrounds.enable = false; diff --git a/modules/installer/cd-dvd/system-tarball-pc.nix b/modules/installer/cd-dvd/system-tarball-pc.nix index 62b32c48144..a67f60a2c34 100644 --- a/modules/installer/cd-dvd/system-tarball-pc.nix +++ b/modules/installer/cd-dvd/system-tarball-pc.nix @@ -34,5 +34,5 @@ in # not be started by default on the installation CD because the # default root password is empty. services.openssh.enable = true; - jobs.sshd.startOn = pkgs.lib.mkOverrideTemplate 50 {} ""; + jobs.openssh.startOn = pkgs.lib.mkOverrideTemplate 50 {} ""; } diff --git a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index f50d4353b34..77e09ec2265 100644 --- a/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -22,7 +22,7 @@ let # Add your own options below and run "nixos-rebuild switch". # E.g., - # services.sshd.enable = true; + # services.openssh.enable = true; } ''; @@ -178,7 +178,7 @@ in # default root password is empty. services.openssh.enable = true; services.ttyBackgrounds.enable = false; - jobs.openssh.startOn = pkgs.lib.mkOverride 50 {} ""; + jobs.openssh.startOn = pkgs.lib.mkOverrideTemplate 50 {} ""; nixpkgs.config = { platform = pkgs.platforms.sheevaplug;