Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 66 lines (52 sloc) 1.712 kb
#!/bin/sh
# -*- mode: shell-script; coding: utf-8-emacs-unix; sh-basic-offset: 8; indent-tabs-mode: t -*-
# This code is under Simplified BSD License, see LICENSE for more info
# Copyright (c) 2010-2012, Piotr Karbowski
# All rights reserved.
# Load functions.
. /functions.sh
# Prepare dirs
run dodir /dev /newroot /sbin /proc /sys /etc /var/log /var/run
[ -d /lib ] && run ln -s /lib /lib64
[ -d /usr/lib ] && run ln -s /usr/lib /usr/lib64
# Basic /dev content, we need it as fast as possible.
[ ! -e /dev/console ] && run mknod /dev/console c 5 1
[ ! -e /dev/null ] && run mknod /dev/null c 1 3
[ ! -e /dev/tty ] && run mknod /dev/tty c 5 0
[ ! -e /dev/urandom ] && run mknod /dev/urandom c 1 9
[ ! -e /dev/random ] && run mknod /dev/random c 1 8
[ ! -e /dev/zero ] && run mknod /dev/zero c 1 5
# Clear the screen
clear
# Save IFS so we can easly restore it if we ever change it.
readonly default_ifs="${IFS}"
# Basic
kernelver="$(uname -r)"
ver="$(cat /VERSION)"
einfo "better-initramfs ${ver}. Linux kernel ${kernelver}.\n"
echo -e "\nWelcome to better-initramfs ${ver}. Linux kernel ${kernelver}.\n" > /etc/motd
emount /proc /sys
# Disable kernel messages from popping onto the screen
echo 0 > /proc/sys/kernel/printk
process_commandline_options
musthave root
InitializeBusybox
use rootdelay rootdelay
emount /dev
use sshd && setup_sshd
loadkeymap
use softraid InitializeSoftwareRaid
use lvm InitializeLVM
use luks InitializeLUKS && use lvm InitializeLVM
use rescueshell rescueshell
use swsusp && SwsuspResume
use uswsusp && UswsuspResume
use tuxonice TuxOnIceResume
emount /newroot
emount /newroot/usr
cleanup
moveDev
eumount /sys /proc
boot_newroot
ewarn "Something went wrong."
rescueshell
Jump to Line
Something went wrong with that request. Please try again.