Code Monkey home page Code Monkey logo

onefilelinux's Introduction

One File Linux

Live linux distro combined in one EFI file.
Download here https://github.com/zhovner/OneFileLinux/releases/tag/v0.1-alpha

More information in russian https://habrahabr.ru/post/349758/

Install on Mac

1. Mount EFI System Partition

diskutil mount disk_NUMBER 

To find out EFI partition disk number use diskutil list

The command is as follows in my case:

diskutil mount disk0s1

2. Copy OneFileLinux.EFI to EFI Partiotion

cp ~/Downloads/OneFileLinux.efi /Volumes/EFI

3. Set NVRAM to boot linux once

sudo bless --mount /Volumes/EFI --setBoot --nextonly --file /Volumes/EFI/OneFileLinux.efi

This command will boot linux only once. Next reboot will return previous boot sequence.

!!! Note that System Integrity Protection (SIP) prohibits to change boot options.
You can run bless from Recover Mode console. Press CMD+R while power on and go to "Utilities —> Terminal"

Install on PC

If your motherboard has UEFI Shell, just choose the path to OneFileLinux.efi on ESP.
Otherwise add new boot options to NVRAM and choose it from boot menu.

Example for ThinkPad x220

1. Copy OneFileLinux.efi to EFI Partition

2. Add NVRAM entry

efibootmgr --disk /dev/sda --part 2 --create --label "One File Linux" --loader /OneFileLinux.efi

3. Choose new entry from boot menu

Press F12 while power on and choose new boot entry

Thinkpad x220 boot menu

Building

This project is based on vanilla linux kernel 4.16-rc1
and Alpine Linux Minimal root filesystem https://alpinelinux.org/downloads/

Download kernel

https://git.kernel.org/torvalds/t/linux-4.16-rc1.tar.gz and extract it to linux-4.16-rc1
This repository contatins linux-4.16-rc1/.config file with kernel config.

Edit root filesystem

Chroot into root filesystem
chroot ./alpine-minirootfs /bin/as

Edit what you need. Install packages with apk packet manager.

Create cpio file

cd ./alpine-minirootfs
find . | cpio -H newc -o > ../alpineramfs.cpio

Build kernel

Edit path to alpineramfs.cpio in kernel config

$ make menuconfig

General Setup --->
   Initramfs source file

Build kernel

make -j4

Get kernel file

cp linux-4.16-rc1/arch/x86/boot/bzImage ./OneFileLinux.efi

onefilelinux's People

Contributors

zhovner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.