diff options
-rw-r--r-- | docs/archive_old.md | 12 | ||||
-rw-r--r-- | docs/bsd/freebsd.md | 21 | ||||
-rw-r--r-- | docs/bsd/netbsd.md | 21 | ||||
-rw-r--r-- | docs/bsd/openbsd.md | 21 | ||||
-rw-r--r-- | docs/depthcharge/index.md | 24 | ||||
-rw-r--r-- | docs/future/index.md | 3 | ||||
-rw-r--r-- | docs/git/index.md | 57 | ||||
-rw-r--r-- | docs/gnulinux/configuring_parabola.md | 120 | ||||
-rw-r--r-- | docs/gnulinux/encrypted_parabola.md | 174 | ||||
-rw-r--r-- | docs/gnulinux/grub_boot_installer.md | 21 | ||||
-rw-r--r-- | docs/gnulinux/grub_cbfs.md | 15 | ||||
-rw-r--r-- | docs/grub/index.md | 3 | ||||
-rw-r--r-- | docs/hcl/gm45_remove_me.md | 12 | ||||
-rw-r--r-- | docs/index.md | 15 | ||||
-rw-r--r-- | docs/install/bbb_setup.md | 9 | ||||
-rw-r--r-- | docs/install/c201.md | 15 | ||||
-rw-r--r-- | docs/install/index.md | 9 | ||||
-rw-r--r-- | docs/misc/index.md | 18 | ||||
-rw-r--r-- | docs/misc/patch.md | 33 |
19 files changed, 402 insertions, 201 deletions
diff --git a/docs/archive_old.md b/docs/archive_old.md index 54d9c620..c9d2c7fe 100644 --- a/docs/archive_old.md +++ b/docs/archive_old.md @@ -627,7 +627,8 @@ Revisions for r20140903 (6th beta) (3rd September 2014) - Added gcry\_serpent and gcry\_whirlpool to the GRUB module list in the 'build' script (for luks users) - **Libreboot is now based on a new coreboot version from August 23rd, - 2014:\ + 2014: + Merged commits (relates to boards that were already supported in libreboot):** - <http://review.coreboot.org/#/c/6697/> @@ -748,10 +749,13 @@ Revisions for r20140903 (6th beta) (3rd September 2014) ohci, uhci, usb, usbserial\_pl2303, usbserial\_ftdi, usbserial\_usbdebug - set prefix=(memdisk)/boot/grub - - For native graphics (recommended by coreboot wiki):\ - gfxpayload=keep\ + - For native graphics (recommended by coreboot wiki): + + gfxpayload=keep + terminal\_output --append gfxterm - - Play a beep on startup:\ + - Play a beep on startup: + play 480 440 1 - Documentation: updated gnulinux/grub\_cbfs.html to make it safer (and easier) to follow. diff --git a/docs/bsd/freebsd.md b/docs/bsd/freebsd.md index 31d9df17..50923d26 100644 --- a/docs/bsd/freebsd.md +++ b/docs/bsd/freebsd.md @@ -63,15 +63,18 @@ Connect the USB drive. Check dmesg: $ dmesg | tail -Check to confirm which drive it is, for example, if you think its sd3:\ +Check to confirm which drive it is, for example, if you think its sd3: + $ disklabel sd3 Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ doas umount /dev/sd3i dmesg told you what device it is. Overwrite the drive, writing the -FreeBSD installer to it with dd. For example:\ +FreeBSD installer to it with dd. For example: + $ doas dd if=freebsd.img of=/dev/rsdXc bs=1M; sync You should now be able to boot the installer from your USB drive. @@ -85,18 +88,22 @@ Prepare the USB drive (in GNU+Linux) If you downloaded your ISO on a GNU+Linux system, here is how to create the bootable FreeBSD USB drive: -Connect the USB drive. Check dmesg:\ +Connect the USB drive. Check dmesg: + $ dmesg -Check lsblk to confirm which drive it is:\ +Check lsblk to confirm which drive it is: + $ lsblk Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ sudo umount /dev/sdX\* # umount /dev/sdX\* dmesg told you what device it is. Overwrite the drive, writing your -distro ISO to it with dd. For example:\ +distro ISO to it with dd. For example: + $ sudo dd if=freebsd.img of=/dev/sdX bs=8M; sync # dd if=freebsd.img of=/dev/sdX bs=8M; sync diff --git a/docs/bsd/netbsd.md b/docs/bsd/netbsd.md index 3046ef00..f632eec5 100644 --- a/docs/bsd/netbsd.md +++ b/docs/bsd/netbsd.md @@ -59,15 +59,18 @@ Connect the USB drive. Check dmesg: $ dmesg | tail -Check to confirm which drive it is, for example, if you think its sd3:\ +Check to confirm which drive it is, for example, if you think its sd3: + $ disklabel sd3 Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ doas umount /dev/sd3i dmesg told you what device it is. Overwrite the drive, writing the -NetBSD installer to it with dd. For example:\ +NetBSD installer to it with dd. For example: + $ doas netbsd.iso of=/dev/rsdXc bs=1M; sync You should now be able to boot the installer from your USB drive. @@ -81,18 +84,22 @@ Prepare the USB drive (in GNU+Linux) If you downloaded your ISO on a GNU+Linux system, here is how to create the bootable NetBSD USB drive: -Connect the USB drive. Check dmesg:\ +Connect the USB drive. Check dmesg: + $ dmesg -Check lsblk to confirm which drive it is:\ +Check lsblk to confirm which drive it is: + $ lsblk Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ sudo umount /dev/sdX\* # umount /dev/sdX\* dmesg told you what device it is. Overwrite the drive, writing your -distro ISO to it with dd. For example:\ +distro ISO to it with dd. For example: + $ sudo dd if=install60.fs of=/dev/sdX bs=8M; sync # dd if=netbsd.iso of=/dev/sdX bs=8M; sync diff --git a/docs/bsd/openbsd.md b/docs/bsd/openbsd.md index 4440b665..461a38d6 100644 --- a/docs/bsd/openbsd.md +++ b/docs/bsd/openbsd.md @@ -41,15 +41,18 @@ Connect the USB drive. Check dmesg: $ dmesg | tail -Check to confirm which drive it is, for example, if you think its sd3:\ +Check to confirm which drive it is, for example, if you think its sd3: + $ disklabel sd3 Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ doas umount /dev/sd3i dmesg told you what device it is. Overwrite the drive, writing the -OpenBSD installer to it with dd. For example:\ +OpenBSD installer to it with dd. For example: + $ doas dd if=install60.fs of=/dev/rsdXc bs=1M; sync You should now be able to boot the installer from your USB drive. @@ -80,18 +83,22 @@ Prepare the USB drive (in GNU+Linux) If you downloaded your ISO on a GNU+Linux system, here is how to create the bootable OpenBSD USB drive: -Connect the USB drive. Check dmesg:\ +Connect the USB drive. Check dmesg: + $ dmesg -Check lsblk to confirm which drive it is:\ +Check lsblk to confirm which drive it is: + $ lsblk Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ sudo umount /dev/sdX\* # umount /dev/sdX\* dmesg told you what device it is. Overwrite the drive, writing your -distro ISO to it with dd. For example:\ +distro ISO to it with dd. For example: + $ sudo dd if=install60.fs of=/dev/sdX bs=8M; sync # dd if=install60.fs of=/dev/sdX bs=8M; sync diff --git a/docs/depthcharge/index.md b/docs/depthcharge/index.md index 4828a390..13367056 100644 --- a/docs/depthcharge/index.md +++ b/docs/depthcharge/index.md @@ -189,24 +189,32 @@ The following parameters can be configured: - Enabled with: \# **crossystem dev\_boot\_signed\_only=1** - - Disabled with:\ + - Disabled with: + \# **crossystem dev\_boot\_signed\_only=0** - External media boot: - - Enabled with:\ + - Enabled with: + \# **crossystem dev\_boot\_usb=1** - - Disabled with:\ + - Disabled with: + \# **crossystem dev\_boot\_usb=0** - Legacy payload boot: - - Enabled with:\ + - Enabled with: + \# **crossystem dev\_boot\_legacy=1** - - Disabled with:\ + - Disabled with: + \# **crossystem dev\_boot\_legacy=0** - Default boot medium: - - Internal storage:\ + - Internal storage: + \# **crossystem dev\_default\_boot=disk** - - External media:\ + - External media: + \# **crossystem dev\_default\_boot=usb** - - Legacy payload:\ + - Legacy payload: + \# **crossystem dev\_default\_boot=legacy** diff --git a/docs/future/index.md b/docs/future/index.md index f15f40a8..aa5b0da9 100644 --- a/docs/future/index.md +++ b/docs/future/index.md @@ -326,7 +326,8 @@ Get intelvbttool here: <http://review.coreboot.org/#/c/5842> Now dump a copy of the running VGA BIOS: **\$ sudo dd if=/dev/mem bs=64k of=runningvga.bin skip=12 count=1**\ -Then do (and record the output):\ +Then do (and record the output): + $ ./intelvbttool runningvga.bin > intelvbttool\_out Backup both files (runningvga.bin and intelvbttool\_out), renaming them diff --git a/docs/git/index.md b/docs/git/index.md index fe25cecf..65755138 100644 --- a/docs/git/index.md +++ b/docs/git/index.md @@ -72,14 +72,16 @@ This is what will also appear in git logs if you ever commit your own changes to a given repository. For more information, see <http://git-scm.com/doc>. -Another nice config for you (optional, but recommended):\ +Another nice config for you (optional, but recommended): + $ git config --global core.editor nano $ git config --global color.status auto $ git config --global color.branch auto $ git config --global color.interactive auto $ git config --global color.diff auto -After that, run the script:\ +After that, run the script: + $ ./download all What this did was download everything (grub, coreboot, memtest86+, @@ -138,10 +140,12 @@ If you have the binary release archive, you'll find executables under First, [install the build dependencies](#build_dependencies). -To build bucts, do this in the main directory:\ +To build bucts, do this in the main directory: + $ ./oldbuild module bucts -To statically compile it, do this:\ +To statically compile it, do this: + $ ./oldbuild module bucts static The "builddeps" script in libreboot\_src also makes use of @@ -169,10 +173,12 @@ flashrom from source, continue reading. First, [install the build dependencies](#build_dependencies). -To build it, do the following in the main directory:\ +To build it, do the following in the main directory: + $ ./oldbuild module flashrom -To statically compile it, do the following in the main directory:\ +To statically compile it, do the following in the main directory: + $ ./oldbuild module flashrom static After you've done that, under ./flashrom/ you will find the following @@ -216,24 +222,29 @@ First, [install the build dependencies](#build_dependencies). If you downloaded libreboot from git, refer to [\#build\_meta](#build_meta). -Build all of the components used in libreboot:\ +Build all of the components used in libreboot: + $ ./oldbuild module all You can also build each modules separately, using *./oldbuild module -modulename*. To see the possible values for *modulename*, use:\ +modulename*. To see the possible values for *modulename*, use: + $ ./oldbuild module list -After that, build the ROM images (for all boards):\ +After that, build the ROM images (for all boards): + $ ./oldbuild roms withgrub Alternatively, you can build for a specific board or set of boards. For -example:\ +example: + $ ./oldbuild roms withgrub x60 $ ./oldbuild roms withgrub x200\_8mb $ ./oldbuild roms withgrub x60 x200\_8mb The list of board options can be found by looking at the directory names in **resources/libreboot/config/grub/**. -To clean (reverse) everything, do the following:\ +To clean (reverse) everything, do the following: + $ ./oldbuild clean all The ROM images will be stored under **bin/*payload*/**, where *payload* @@ -261,23 +272,29 @@ Tag the current commit, and that version will appear in both the in the file names of the archives. Otherwise, whatever git uses for *git describe --tags HEAD* will be used. -Utilities (static executables):\ +Utilities (static executables): + $ ./oldbuild release util -Archive containing flashrom and bucts source code:\ +Archive containing flashrom and bucts source code: + $ ./oldbuild release tobuild Documentation archive (**does not work on \_src release archive, only -git**):\ +git**): + $ ./oldbuild release docs -ROM image archives:\ +ROM image archives: + $ ./oldbuild release roms -Source code archive:\ +Source code archive: + $ ./oldbuild release src -SHA512 sums of all other release archives that have been generated:\ +SHA512 sums of all other release archives that have been generated: + $ ./oldbuild release sha512sums If you are building on an i686 host, this will build statically linked @@ -306,7 +323,8 @@ libreboot\_util, for: - flashrom If you are building binaries on a live system or chroot (for -flashrom/bucts), you can use the following to statically link them:\ +flashrom/bucts), you can use the following to statically link them: + $ ./oldbuild module flashrom static $ ./oldbuild module bucts static @@ -317,7 +335,8 @@ an X60/T60 while lenovo bios is present, working around the security restrictions). The command that you used for generating the release archives will also -run the following command:\ +run the following command: + $ ./oldbuild release tobuild The archive **tobuild.tar.xz** will have been created under **release/oldbuildsystem/**, containing bucts, flashrom and all other diff --git a/docs/gnulinux/configuring_parabola.md b/docs/gnulinux/configuring_parabola.md index 1ba9e366..0c35eacd 100644 --- a/docs/gnulinux/configuring_parabola.md +++ b/docs/gnulinux/configuring_parabola.md @@ -133,7 +133,8 @@ updating, resync with the latest package names/versions: (according to the wiki, -Syy is better than Sy because it refreshes the package list even if it appears to be up to date, which can be useful when switching to another mirror).\ -Then, update the system:\ +Then, update the system: + # pacman -Syu **Before installing packages with 'pacman -S', always update first, @@ -198,7 +199,8 @@ once in a while, to prevent it from growing too big (it's a cache of old package information, updated automatically when you do anything in pacman).** -To clean out all old packages that are cached:\ +To clean out all old packages that are cached: + # pacman -Sc The wiki cautions that this should be used with care. For example, since @@ -207,7 +209,8 @@ want to revert back to an older package then it's useful to have the caches available. Only do this if you are sure that you won't need it. The wiki also mentions this method for removing everything from the -cache, including currently installed packages that are cached:\ +cache, including currently installed packages that are cached: + # pacman -Scc This is inadvisable, since it means re-downloading the package again if you wanted to quickly re-install it. This should only be used when disk @@ -253,9 +256,11 @@ access to the entire operating system. Read the entire document linked to above, and then continue. -Add your user:\ +Add your user: + # useradd -m -G wheel -s /bin/bash *yourusername* -Set a password:\ +Set a password: + # passwd *yourusername* Use of the *diceware method* is recommended, for generating secure @@ -282,7 +287,8 @@ sshd (openssh), dhcp, etc. There are countless others. the background behind the decision by Arch (Parabola's upstream supplier) to use systemd. -The manpage should also help:\ +The manpage should also help: + # man systemd The section on 'unit types' is especially useful. @@ -302,7 +308,8 @@ The wiki also recommended a method for forwarding journal output to TTY 12 (accessible by pressing ctrl+alt+f12, and you use ctrl+alt+\[F1-F12\] to switch between terminals). I decided not to enable it. -Restart journald:\ +Restart journald: + # systemctl restart systemd-journald The wiki recommends that if the journal gets too large, you can also @@ -313,9 +320,11 @@ delete older records when the journal size reaches it's limit (according to systemd developers). Finally, the wiki mentions 'temporary' files and the utility for -managing them.\ +managing them. + # man systemd-tmpfiles -The command for 'clean' is:\ +The command for 'clean' is: + # systemd-tmpfiles --clean According to the manpage, this *"cleans all files and directories with an age parameter"*. According to the Arch wiki, this reads information @@ -325,7 +334,8 @@ locations to get a better understanding. I looked in /etc/tmpfiles.d/ and found that it was empty on my system. However, /usr/lib/tmpfiles.d/ contained some files. The first one was -etc.conf, containing information and a reference to this manpage:\ +etc.conf, containing information and a reference to this manpage: + # man tmpfiles.d Read that manpage, and then continue studying all the files. @@ -350,10 +360,12 @@ and below the 'extra' section add:\ *\[kernels\]\ Include = /etc/pacman.d/mirrorlist* -Now sync with the repository:\ +Now sync with the repository: + # pacman -Syy -List all available packages in this repository:\ +List all available packages in this repository: + # pacman -Sl kernels In the end, I decided not to install anything from it but I kept the @@ -374,10 +386,12 @@ Read <https://wiki.archlinux.org/index.php/Configuring_Network>. This should be the same as the hostname that you set in /etc/hostname when installing Parabola. You can also do it with systemd (do so now, if -you like):\ +you like): + # hostnamectl set-hostname *yourhostname* This writes the specified hostname to /etc/hostname. More information -can be found in these manpages:\ +can be found in these manpages: + # man hostname # info hostname # man hostnamectl @@ -401,7 +415,8 @@ According to the Arch wiki, [udev](https://wiki.archlinux.org/index.php/Udev) should already detect the ethernet chipset and load the driver for it automatically at boot time. You can check this in the *"Ethernet controller"* section when -running this command:\ +running this command: + # lspci -v Look at the remaining sections *'Kernel driver in use'* and *'Kernel @@ -410,7 +425,8 @@ modules'*. In my case it was as follows:\ Kernel modules: e1000e* Check that the driver was loaded by issuing *dmesg | grep module\_name*. -In my case, I did:\ +In my case, I did: + # dmesg | grep e1000e ### Network device names {#network_devicenames} @@ -432,7 +448,8 @@ instructions in [grub\_cbfs.html](grub_cbfs.html)). For background information, read [Predictable Network Interface Names](http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/) -Show device names:\ +Show device names: + # ls /sys/class/net Changing the device names is possible (I chose not to do it):\ @@ -464,7 +481,8 @@ is important, so make sure to read them!** Install smartmontools (it can be used to check smart data. HDDs use non-free firmware inside, but it's transparent to you but the smart -data comes from it. Therefore, don't rely on it too much):\ +data comes from it. Therefore, don't rely on it too much): + # pacman -S smartmontools Read <https://wiki.archlinux.org/index.php/S.M.A.R.T.> to learn how to use it. @@ -489,27 +507,33 @@ provide LXDE by default. Based on <https://wiki.archlinux.org/index.php/Xorg>. -Firstly, install it!\ +Firstly, install it! + # pacman -S xorg-server I also recommend installing this (contains lots of useful tools, -including *xrandr*):\ +including *xrandr*): + # pacman -S xorg-server-utils Install the driver. For me this was *xf86-video-intel* on the ThinkPad -X60. T60 and macbook11/21 should be the same.\ +X60. T60 and macbook11/21 should be the same. + # pacman -S xf86-video-intel -For other systems you can try:\ +For other systems you can try: + # pacman -Ss xf86-video- | less Combined with looking at your *lspci* output, you can determine which driver is needed. By default, Xorg will revert to xf86-video-vesa which is a generic driver and doesn't provide true hardware acceleration. Other drivers (not just video) can be found by looking at the -*xorg-drivers* group:\ +*xorg-drivers* group: + # pacman -Sg xorg-drivers Mostly you will rely on a display manager, but in case you ever want to -start X without one:\ +start X without one: + # pacman -S xorg-xinit <optional>\ @@ -537,7 +561,8 @@ will notice that the layout you set in /etc/vconsole.conf earlier might not actually be the same in X. To see what layout you currently use, try this on a terminal emulator in -X:\ +X: + # setxkbmap -print -verbose 10 In my case, I wanted to use the Dvorak (UK) keyboard which is quite @@ -584,27 +609,34 @@ would like to try something different, refer to Refer to <https://wiki.archlinux.org/index.php/LXDE>. -Install it, choosing 'all' when asked for the default package list:\ +Install it, choosing 'all' when asked for the default package list: + # pacman -S lxde obconf -I didn't want the following, so I removed them:\ +I didn't want the following, so I removed them: + # pacman -R lxmusic lxtask -I also lazily installed all fonts:\ +I also lazily installed all fonts: + # pacman -S \$(pacman -Ssq ttf-) -And a mail client:\ +And a mail client: + # pacman -S icedove In IceCat, go to *Preferences :: Advanced* and disable *GNU IceCat Health Report*. -I also like to install these:\ +I also like to install these: + # pacman -S xsensors stress htop -Enable LXDM (the default display manager, providing a graphical login):\ +Enable LXDM (the default display manager, providing a graphical login): + # systemctl enable lxdm.service -It will start when you boot up the system. To start it now, do:\ +It will start when you boot up the system. To start it now, do: + # systemctl start lxdm.service Log in with your standard (non-root) user that you created earlier. It @@ -649,7 +681,8 @@ NOTE TO SELF: come back to this later. ### LXDE - screenlock {#lxde_screenlock} -Arch wiki recommends to use *xscreensaver*:\ +Arch wiki recommends to use *xscreensaver*: + # pacman -S xscreensaver Under *Preferences :: Screensaver* in the LXDE menu, I chose *Mode: @@ -700,30 +733,37 @@ cursor over it, it'll show information about the battery. Refer to <https://wiki.archlinux.org/index.php/LXDE#Network_Management>. Then I read: <https://wiki.archlinux.org/index.php/NetworkManager>. -Install Network Manager:\ +Install Network Manager: + # pacman -S networkmanager -You will also want the graphical applet:\ +You will also want the graphical applet: + # pacman -S network-manager-applet Arch wiki says that an autostart rule will be written at */etc/xdg/autostart/nm-applet.desktop* I want to be able to use a VPN at some point, so the wiki tells me to -do:\ +do: + # pacman -S networkmanager-openvpn LXDE uses openbox, so I refer to:\ <https://wiki.archlinux.org/index.php/NetworkManager#Openbox>. -It tells me for the applet I need:\ +It tells me for the applet I need: + # pacman -S xfce4-notifyd gnome-icon-theme -Also, for storing authentication details (wifi) I need:\ +Also, for storing authentication details (wifi) I need: + # pacman -S gnome-keyring -I wanted to quickly enable networkmanager:\ +I wanted to quickly enable networkmanager: + # systemctl stop dhcpcd # systemctl start NetworkManager -Enable NetworkManager at boot time:\ +Enable NetworkManager at boot time: + # systemctl enable NetworkManager Restart LXDE (log out, and then log back in). diff --git a/docs/gnulinux/encrypted_parabola.md b/docs/gnulinux/encrypted_parabola.md index c4e92c16..bf944a14 100644 --- a/docs/gnulinux/encrypted_parabola.md +++ b/docs/gnulinux/encrypted_parabola.md @@ -95,7 +95,8 @@ Change keyboard layout ---------------------- Parabola live shell assumes US Qwerty. If you have something different, -list the available keymaps and use yours:\ +list the available keymaps and use yours: + # localectl list-keymaps # loadkeys LAYOUT For me, LAYOUT would have been dvorak-uk. @@ -124,7 +125,8 @@ dm-mod ------ device-mapper will be used - a lot. Make sure that the kernel module is -loaded:\ +loaded: + # modprobe dm-mod Create LUKS partition @@ -138,7 +140,8 @@ prepared cryptsetup command below. Note that the iteration time is for security purposes (mitigates brute force attacks), so anything lower than 5 seconds is probably not ok. -I am using MBR partitioning, so I use cfdisk:\ +I am using MBR partitioning, so I use cfdisk: + # cfdisk /dev/sda I create a single large sda1 filling the whole drive, leaving it as the @@ -151,15 +154,18 @@ I am then directed to Parabola forces you to RTFM. Do that. -It tells me to run:\ +It tells me to run: + # cryptsetup benchmark (for making sure the list below is populated)\ -Then:\ +Then: + # cat /proc/crypto This gives me crypto options that I can use. It also provides a representation of the best way to set up LUKS (in this case, security is a priority; speed, a distant second). To gain a better understanding, I -am also reading:\ +am also reading: + # man cryptsetup Following that page, based on my requirements, I do the following based @@ -186,29 +192,36 @@ Create LVM Now I refer to <https://wiki.archlinux.org/index.php/LVM>. -Open the LUKS partition:\ +Open the LUKS partition: + # cryptsetup luksOpen /dev/sda1 lvm (it will be available at /dev/mapper/lvm) -Create LVM partition:\ +Create LVM partition: + # pvcreate /dev/mapper/lvm -Show that you just created it:\ +Show that you just created it: + # pvdisplay Now I create the volume group, inside of which the logical volumes will -be created:\ +be created: + # vgcreate matrix /dev/mapper/lvm (volume group name is 'matrix' - choose your own name, if you like) -Show that you created it:\ +Show that you created it: + # vgdisplay -Now create the logical volumes:\ +Now create the logical volumes: + # lvcreate -L 2G matrix -n swapvol (2G swap partition, named swapvol)\ Again, choose your own name if you like. Also, make sure to choose a swap size of your own needs. It basically depends on how much RAM you have installed. I refer to -<http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space>.\ +<http://www.linux.com/news/software/applications/8208-all-about-linux-swap-space>. + # lvcreate -l +100%FREE matrix -n root (single large partition in the rest of the space, named root)\ You can also be flexible here, for example you can specify a /boot, a /, @@ -218,7 +231,8 @@ fills up with logs, it won't crash your system). For a home/laptop system (typical use case), a root and a swap will do (really). Verify that the logical volumes were created, using the following -command:\ +command: + # lvdisplay @@ -226,15 +240,19 @@ command:\ Create / and swap partitions, and mount --------------------------------------- -For the swapvol LV I use:\ +For the swapvol LV I use: + # mkswap /dev/mapper/matrix-swapvol -Activate swap:\ +Activate swap: + # swapon /dev/matrix/swapvol -For the root LV I use:\ +For the root LV I use: + # mkfs.btrfs /dev/mapper/matrix-root -Mount the root (/) partition:\ +Mount the root (/) partition: + # mount /dev/matrix/root /mnt @@ -249,7 +267,8 @@ Now I am following the rest of <https://wiki.parabolagnulinux.org/Installation_Guide>. I also cross referenced <https://wiki.archlinux.org/index.php/Installation_guide>. -Create /home and /boot on root mountpoint:\ +Create /home and /boot on root mountpoint: + # mkdir -p /mnt/home # mkdir -p /mnt/boot @@ -258,7 +277,8 @@ devices are ready to install Parabola. In **/etc/pacman.d/mirrorlist**, comment out all lines except the Server line closest to where you are (I chose the UK Parabola server (main -server)) and then did:\ +server)) and then did: + # pacman -Syy # pacman -Syu # pacman -Sy pacman (and then I did the other 2 steps above, @@ -312,21 +332,26 @@ Configure the system Generate an fstab - UUIDs are used because they have certain advantages (see <https://wiki.parabola.nu/Fstab#Identifying_filesystems>. If you -prefer labels instead, replace the -U option with -L):\ +prefer labels instead, replace the -U option with -L): + # genfstab -U -p /mnt >> /mnt/etc/fstab -Check the created file:\ +Check the created file: + # cat /mnt/etc/fstab (If there are any errors, edit the file. Do **NOT** run the genfstab command again!) -Chroot into new system:\ +Chroot into new system: + # arch-chroot /mnt /bin/bash -It's a good idea to have this installed:\ +It's a good idea to have this installed: + # pacman -S linux-libre-lts It was also suggested that you should install this kernel (read up on -what GRSEC is):\ +what GRSEC is): + # pacman -S linux-libre-grsec This is another kernel that sits inside /boot, which you can use. LTS @@ -334,35 +359,43 @@ means 'long-term support'. These are so-called 'stable' kernels that can be used as a fallback during updates, if a bad kernel causes issues for you. -Parabola does not have wget. This is sinister. Install it:\ +Parabola does not have wget. This is sinister. Install it: + # pacman -S wget -Locale:\ +Locale: + # vi /etc/locale.gen Uncomment your needed localisations. For example en\_GB.UTF-8 (UTF-8 is -highly recommended over other options).\ +highly recommended over other options). + # locale-gen # echo LANG=en\_GB.UTF-8 > /etc/locale.conf # export LANG=en\_GB.UTF-8 -Console font and keymap:\ +Console font and keymap: + # vi /etc/vconsole.conf In my case: KEYMAP=dvorak-uk FONT=lat9w-16 -Time zone:\ +Time zone: + # ln -s /usr/share/zoneinfo/Europe/London /etc/localtime (Replace Zone and Subzone to your liking. See /usr/share/zoneinfo) -Hardware clock:\ +Hardware clock: + # hwclock --systohc --utc Hostname: Write your hostname to /etc/hostname. For example, if your -hostname is parabola:\ +hostname is parabola: + # echo parabola > /etc/hostname -Add the same hostname to /etc/hosts:\ +Add the same hostname to /etc/hosts: + # vi /etc/hosts #<ip-address> <hostname.domain.org> <hostname> @@ -376,7 +409,8 @@ Mkinitcpio: Configure /etc/mkinitcpio.conf as needed (see <https://wiki.parabola.nu/Mkinitcpio>). Runtime modules can be found in /usr/lib/initcpio/hooks, and build hooks can be found in /usr/lib/initcpio/install. (\# **mkinitcpio -H hookname** gives -information about each hook.) Specifically, for this use case:\ +information about each hook.) Specifically, for this use case: + # vi /etc/mkinitcpio.conf Then modify the file like so: @@ -401,18 +435,23 @@ Then modify the file like so: Now using mkinitcpio, you can create the kernel and ramdisk for booting with (this is different from Arch, specifying linux-libre instead of -linux):\ +linux): + # mkinitcpio -p linux-libre -Also do it for linux-libre-lts:\ +Also do it for linux-libre-lts: + # mkinitcpio -p linux-libre-lts -Also do it for linux-libre-grsec:\ +Also do it for linux-libre-grsec: + # mkinitcpio -p linux-libre-grsec Set the root password: At the time of writing, Parabola used SHA512 by default for its password hashing. I referred to -<https://wiki.archlinux.org/index.php/SHA_password_hashes>.\ +<https://wiki.archlinux.org/index.php/SHA_password_hashes>. + # vi /etc/pam.d/passwd -Add rounds=65536 at the end of the uncommented 'password' line.\ +Add rounds=65536 at the end of the uncommented 'password' line. + # passwd root Make sure to set a secure password! Also, it must never be the same as your LUKS password. @@ -427,7 +466,8 @@ Extra security tweaks Based on <https://wiki.archlinux.org/index.php/Security>. -Restrict access to important directories:\ +Restrict access to important directories: + # chmod 700 /boot /etc/{iptables,arptables} Lockout user after three failed login attempts:\ @@ -437,7 +477,8 @@ Or just delete it. Above it, put:\ *auth required pam\_tally.so deny=2 unlock\_time=600 onerr=succeed file=/var/log/faillog*\ To unlock a user manually (if a password attempt is failed 3 times), -do:\ +do: + # pam\_tally --user *theusername* --reset What the above configuration does is lock the user out for 10 minutes, if they make 3 failed login attempts. @@ -451,18 +492,22 @@ don't really need sudo. Unmount, reboot! ---------------- -Exit from chroot:\ +Exit from chroot: + # exit -unmount:\ +unmount: + # umount -R /mnt # swapoff -a -deactivate the lvm lv's:\ +deactivate the lvm lv's: + # lvchange -an /dev/matrix/root # lvchange -an /dev/matrix/swapvol -Lock the encrypted partition (close it):\ +Lock the encrypted partition (close it): + # cryptsetup luksClose lvm # shutdown -h now @@ -520,7 +565,8 @@ possibility of bricking your device! I will go for the re-flash option here. Firstly, cd to the libreboot\_util/cbfstool/{armv7l i686 x86\_64} directory. Dump the current firmware - where *libreboot.rom* is an example: make sure to -adapt:\ +adapt: + # flashrom -p internal -r libreboot.rom If flashrom complains about multiple flash chips detected, add a *-c* option at the end, with the name of your chosen chip is quotes.\ @@ -529,7 +575,8 @@ would be really nice): $ ./cbfstool libreboot.rom print Extract grubtest.cfg: $ ./cbfstool libreboot.rom extract -n grubtest.cfg -f grubtest.cfg\ -And modify:\ +And modify: + $ vi grubtest.cfg In grubtest.cfg, inside the 'Load Operating System' menu entry, change @@ -558,18 +605,21 @@ detected LUKS volumes. You can also specify -u UUID or -a (device). hardening your GRUB configuration, for security purposes. Save your changes in grubtest.cfg, then delete the unmodified config -from the ROM image:\ +from the ROM image: + $ ./cbfstool libreboot.rom remove -n grubtest.cfg and insert the modified grubtest.cfg:\ \$ **./cbfstool libreboot.rom add -n grubtest.cfg -f grubtest.cfg -t raw**\ Now refer to <http://libreboot.org/docs/install/#flashrom>. Cd (up) to -the libreboot\_util directory and update the flash chip contents:\ +the libreboot\_util directory and update the flash chip contents: + # ./flash update libreboot.rom Ocassionally, coreboot changes the name of a given board. If flashrom complains about a board mismatch, but you are sure that you chose the -correct ROM image, then run this alternative command:\ +correct ROM image, then run this alternative command: + # ./flash forceupdate libreboot.rom You should see "Verifying flash\... VERIFIED." written at the end of the flashrom output. @@ -600,21 +650,25 @@ with the following command:\ \$ **sed -e 's:(cbfsdisk)/grub.cfg:(cbfsdisk)/grubtest.cfg:g' -e 's:Switch to grub.cfg:Switch to grubtest.cfg:g' < grubtest.cfg > grub.cfg**\ -Delete the grub.cfg that remained inside the ROM:\ +Delete the grub.cfg that remained inside the ROM: + $ ./cbfstool libreboot.rom remove -n grub.cfg -Add the modified version that you just made:\ +Add the modified version that you just made: + $ ./cbfstool libreboot.rom add -n grub.cfg -f grub.cfg -t raw Now you have a modified ROM. Once more, refer to <http://libreboot.org/docs/install/#flashrom>. Cd to the libreboot\_util -directory and update the flash chip contents:\ +directory and update the flash chip contents: + # ./flash update libreboot.rom And wait for the "Verifying flash\... VERIFIED." Once you have done that, shut down and then boot up with your new configuration. When done, delete GRUB (remember, we only needed it for the *grub-mkpasswd-pbkdf2* utility; GRUB is already part of libreboot, -flashed alongside it as a *payload*):\ +flashed alongside it as a *payload*): + # pacman -R grub @@ -639,17 +693,21 @@ putting a keyfile inside initramfs would be a bad idea).\ Boot up and login as root or your user. Then generate the key file:\ \# **dd bs=512 count=4 if=/dev/urandom of=/etc/mykeyfile iflag=fullblock**\ -Insert it into the luks volume:\ +Insert it into the luks volume: + # cryptsetup luksAddKey /dev/sdX /etc/mykeyfile and enter your LUKS passphrase when prompted. Add the keyfile to the -initramfs by adding it to FILES in /etc/mkinitcpio.conf. For example:\ +initramfs by adding it to FILES in /etc/mkinitcpio.conf. For example: + # FILES="/etc/mykeyfile" -Create the initramfs image from scratch:\ +Create the initramfs image from scratch: + # mkinitcpio -p linux-libre # mkinitcpio -p linux-libre-lts # mkinitcpio -p linux-libre-grsec Add the following to your grub.cfg - you are now able to do that, see -above! -, or add it in the kernel command line for GRUB:\ +above! -, or add it in the kernel command line for GRUB: + # cryptkey=rootfs:/etc/mykeyfile \ You can also place this inside the grub.cfg that exists in CBFS: diff --git a/docs/gnulinux/grub_boot_installer.md b/docs/gnulinux/grub_boot_installer.md index 4609db97..3dafb51b 100644 --- a/docs/gnulinux/grub_boot_installer.md +++ b/docs/gnulinux/grub_boot_installer.md @@ -32,16 +32,19 @@ Connect the USB drive. Check dmesg: $ dmesg -Check lsblk to confirm which drive it is:\ +Check lsblk to confirm which drive it is: + $ lsblk Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ sudo umount /dev/sdX\* # umount /dev/sdX\* dmesg told you what device it is. Overwrite the drive, writing your -distro ISO to it with dd. For example:\ +distro ISO to it with dd. For example: + $ sudo dd if=gnulinux.iso of=/dev/sdX bs=8M; sync # dd if=gnulinux.iso of=/dev/sdX bs=8M; sync @@ -73,17 +76,21 @@ Prepare the USB drive (in LibertyBSD or OpenBSD) If you downloaded your ISO on a LibertyBSD or OpenBSD system, here is how to create the bootable GNU+Linux USB drive: -Connect the USB drive. Check dmesg:\ +Connect the USB drive. Check dmesg: + $ dmesg | tail -Check to confirm which drive it is, for example, if you think its sd3:\ +Check to confirm which drive it is, for example, if you think its sd3: + $ disklabel sd3 Check that it wasn't automatically mounted. If it was, unmount it. For -example:\ +example: + $ doas umount /dev/sd3i dmesg told you what device it is. Overwrite the drive, writing the -OpenBSD installer to it with dd. For example:\ +OpenBSD installer to it with dd. For example: + $ doas dd if=gnulinux.iso of=/dev/rsdXc bs=1M; sync You should now be able to boot the installer from your USB drive. diff --git a/docs/gnulinux/grub_cbfs.md b/docs/gnulinux/grub_cbfs.md index dbe55206..9809785f 100644 --- a/docs/gnulinux/grub_cbfs.md +++ b/docs/gnulinux/grub_cbfs.md @@ -154,7 +154,8 @@ to the command, for example: Extract grubtest.cfg from the ROM image {#extract_testconfig} --------------------------------------- -You can check the contents of the ROM image, inside CBFS:\ +You can check the contents of the ROM image, inside CBFS: + $ cd \.../libreboot\_util/cbfstool** $ ./cbfstool libreboot.rom print** @@ -163,7 +164,8 @@ loaded by default, with a menuentry for switching to grubtest.cfg. In this tutorial, you will first modify and test *grubtest.cfg*. This is to reduce the possibility of bricking your device, so DO NOT SKIP THIS! -Extract grubtest.cfg from the ROM image:\ +Extract grubtest.cfg from the ROM image: + $ ./cbfstool libreboot.rom extract -n grubtest.cfg -f grubtest.cfg Modify the grubtest.cfg accordingly. @@ -176,7 +178,8 @@ Re-insert the modified grubtest.cfg into the ROM image {#reinsert_modified_testc ------------------------------------------------------ Once your grubtest.cfg is modified and saved, delete the unmodified -config from the ROM image:\ +config from the ROM image: + $ ./cbfstool libreboot.rom remove -n grubtest.cfg Next, insert the modified version:\ @@ -229,10 +232,12 @@ the already modified config). From /libreboot\_util/cbfstool, do:\ 's:Switch to grub.cfg:Switch to grubtest.cfg:g' < grubtest.cfg > grub.cfg**\ -Delete the grub.cfg that remained inside the ROM:\ +Delete the grub.cfg that remained inside the ROM: + $ ./cbfstool libreboot.rom remove -n grub.cfg -Add the modified version that you just made:\ +Add the modified version that you just made: + $ ./cbfstool libreboot.rom add -n grub.cfg -f grub.cfg -t raw **Now you have a modified ROM. Again, refer back to diff --git a/docs/grub/index.md b/docs/grub/index.md index 0c676da9..30800256 100644 --- a/docs/grub/index.md +++ b/docs/grub/index.md @@ -77,7 +77,8 @@ Custom keyboard layout in GRUB (for reference) {#grub_custom_keyboard} Keymaps are stored in resources/utilities/grub-assemble/keymap/. -Example (French Azerty):\ +Example (French Azerty): + $ ckbcomp fr > frazerty \ Go in grub directory:\ diff --git a/docs/hcl/gm45_remove_me.md b/docs/hcl/gm45_remove_me.md index 485bf731..5b705e44 100644 --- a/docs/hcl/gm45_remove_me.md +++ b/docs/hcl/gm45_remove_me.md @@ -165,7 +165,8 @@ regions for your libreboot ROM image. If you are working with libreboot\_src (or git), you can find the source under resources/utilities/ich9deblob/ and will already be compiled if you ran **./oldbuild module all** or **./oldbuild module ich9deblob** -from the main directory (./), otherwise you can build it like so:\ +from the main directory (./), otherwise you can build it like so: + $ ./oldbuild module ich9deblob An executable file named **ich9deblob** will now appear under resources/utilities/ich9deblob/ @@ -177,7 +178,8 @@ GNU+Linux) under ./ich9deblob/. Place the factory.rom from your system (can be obtained using the external flashing guides for GM45 targets linked [../install/](../install/)) in the directory where you have your -ich9deblob executable, then run the tool:\ +ich9deblob executable, then run the tool: + $ ./ich9deblob A 12kiB file named **deblobbed\_descriptor.bin** will now appear. **Keep @@ -233,7 +235,8 @@ The ME interferes with flash read/write in flashrom, and the default descriptor locks some regions. The idea is that doing this will remove all of those restrictions. -Simply run (with factory.rom in the same directory):\ +Simply run (with factory.rom in the same directory): + $ ./demefactory It will generate a 4KiB descriptor file (only the descriptor, no GbE). @@ -305,7 +308,8 @@ Flash chips {#flashchips} <http://pdf.datasheetarchive.com/indexerfiles/Datasheets-USER/DSAUPLD00006075.pdf> **~~- Page 20 and page 9 refer to SDA\_HDO or SDA\_HDOUT~~** only on series 6 or higher chipsets. ICH9-M (X200) does it with a strap - connected to GPIO33 pin (see IRC notes below)\ + connected to GPIO33 pin (see IRC notes below) + - According to page 29, the X200 can have any of the following flash chips: - ATMEL AT26DF321-SU 72.26321.A01 - this is a 32Mb (4MiB) chip diff --git a/docs/index.md b/docs/index.md index 7b0280d7..fc058419 100644 --- a/docs/index.md +++ b/docs/index.md @@ -104,19 +104,24 @@ The libreboot project has three main goals: and support. Most people will simply give up before attempting to install coreboot. - \ + + Libreboot attempts to bridge this divide, making sure that everything from building to installing coreboot is automated, as much as is feasibly possible. Secondly, the project produces documentation aimed at non-technical users. Thirdly, the project attempts to provide excellent user support via mailing lists and - IRC.\ - \ + IRC. + + + Libreboot already comes with a payload (GRUB), flashrom and other needed parts. Everything is fully integrated, in a way where most of the complicated steps that are otherwise required, are instead done - for the user in advance.\ - \ + for the user in advance. + + + You can download ROM images for your libreboot system and install them, without having to build anything from source. The build system is also fully automated, so building from source is easy if you diff --git a/docs/install/bbb_setup.md b/docs/install/bbb_setup.md index a52ea103..89f7ec67 100644 --- a/docs/install/bbb_setup.md +++ b/docs/install/bbb_setup.md @@ -216,7 +216,8 @@ Output: /lib/firmware/BB-SPI0-01-00A0.dtbo -Then:\ +Then: + # echo BB-SPI0-01 > /sys/devices/bone\_capemgr.\*/slots # cat /sys/devices/bone\_capemgr.\*/slots Output: @@ -229,7 +230,8 @@ Output: 5: ff:P-O-L Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI 7: ff:P-O-L Override Board Name,00A0,Override Manuf,BB-SPI0-01 -Verify that the spidev device now exists:\ +Verify that the spidev device now exists: + # ls -al /dev/spid\* Output: @@ -252,7 +254,8 @@ libreboot\_src, and put the ARM binary for it on your BBB. Finally, get the ROM image that you would like to flash and put that on your BBB. -Now test flashrom:\ +Now test flashrom: + # ./flashrom -p linux\_spi:dev=/dev/spidev1.0,spispeed=512 Output: diff --git a/docs/install/c201.md b/docs/install/c201.md index 1b15c284..a811404d 100644 --- a/docs/install/c201.md +++ b/docs/install/c201.md @@ -160,7 +160,8 @@ Then, the **cros-flash-replace** script has to be executed as such: If any error is shown, it is definitely a bad idea to go further than this point. -The resulting flash image can then be flashed back:\ +The resulting flash image can then be flashed back: + # flashrom -p host -w flash.img You should also see within the output the following:\ @@ -194,21 +195,25 @@ transferred to the host. The following operations have to be executed with root privileges on the host (e.g. using the *root* account). In addition, the -**cros-flash-replace** script has to be made executable:\ +**cros-flash-replace** script has to be made executable: + # chmod a+x cros-flash-replace -The SPI flash has to be read first (using the right spi programmer):\ +The SPI flash has to be read first (using the right spi programmer): + # flashrom -p *programmer* -r flash.img **Note: it might be a good idea to copy the produced flash.img file at this point and store it outside of the device for backup purposes.** -Then, the **cros-flash-replace** script has to be executed as such:\ +Then, the **cros-flash-replace** script has to be executed as such: + # ./cros-flash-replace flash.img coreboot ro-frid If any error is shown, it is definitely a bad idea to go further than this point. The resulting flash image can then be flashed back (using the right spi -programmer):\ +programmer): + # flashrom -p *programmer* -w flash.img You should also see within the output the following:\ diff --git a/docs/install/index.md b/docs/install/index.md index 55fbbe50..f8ee0e6a 100644 --- a/docs/install/index.md +++ b/docs/install/index.md @@ -320,7 +320,8 @@ the flashing script. do this: *rm -f patch && wget -O flash https://notabug.org/vimuser/libreboot/raw/9d850543ad90b72e0e333c98075530b31e5d23f1/flash && chmod +x flash*** -The first half of the procedure is as follows:\ +The first half of the procedure is as follows: + $ sudo ./flash i945lenovo\_firstflash [yourrom.rom](#rom). @@ -344,7 +345,8 @@ and then boot; libreboot is running, but there is a 2nd procedure -When you have booted up again, you must also do this:\ +When you have booted up again, you must also do this: + $ sudo ./flash i945lenovo\_secondflash [yourrom.rom](#rom) If flashing fails at this stage, try the following:\ @@ -393,7 +395,8 @@ Look at the [list of ROM images](#rom) to see which image is compatible with your device. -Use this flashing script, to install libreboot:\ +Use this flashing script, to install libreboot: + $ sudo ./flash i945apple\_firstflash [yourrom.rom](#rom) diff --git a/docs/misc/index.md b/docs/misc/index.md index afffbbeb..dabe1e54 100644 --- a/docs/misc/index.md +++ b/docs/misc/index.md @@ -62,7 +62,8 @@ Be root $ su - -Installed powertop:\ +Installed powertop: + # pacman -S powertop and added the following to /etc/systemd/system/powertop.service : @@ -80,7 +81,8 @@ and added the following to /etc/systemd/system/powertop.service : [Install] WantedBy=multi-user.target -Finally, as root do that:\ +Finally, as root do that: + # systemctl enable powertop # systemctl start powertop @@ -109,7 +111,8 @@ included inside the ROM. Connect your null modem cable to the serial port on the dock and connect the other end to a 2nd system using your USB Serial adapter. -On the 2nd system, you can try this (using GNU Screen):\ +On the 2nd system, you can try this (using GNU Screen): + $ sudo screen /dev/ttyUSB0 115200 How to quit GNU Screen: Ctrl+A then release and press K, and then press @@ -234,7 +237,8 @@ Disable or enable beeps when removing/adding the charger: $ sudo ./nvramtool -w power\_management\_beeps=Disable Disable or enable beeps when battery is low: - $ sudo ./nvramtool -w low\_battery\_beep=Enable\ + $ sudo ./nvramtool -w low\_battery\_beep=Enable + $ sudo ./nvramtool -w low\_battery\_beep=Disable A reboot is required, for these changes to take effect. @@ -248,10 +252,12 @@ Get the panel name with **sudo get-edid | strings**\ Or look in **/sys/class/drm/card0-LVDS-1/edid** Alternatively you can use i2cdump. In Debian and Devuan, this is in the -package i2c-tools.\ +package i2c-tools. + $ sudo modprobe i2c-dev $ sudo i2cdump -y 5 0x50 (you might have to change the value for --y)\ +-y) + $ sudo rmmod i2c-dev You'll see the panel name in the output (from the EDID dump). diff --git a/docs/misc/patch.md b/docs/misc/patch.md index a8dffc92..73d4979a 100644 --- a/docs/misc/patch.md +++ b/docs/misc/patch.md @@ -15,7 +15,8 @@ To apply a patch to a single file, do that in it's directory: Assuming that the patch is distributed in unified format identifying the -file the patch should be applied to, the above will work. Otherwise:\ +file the patch should be applied to, the above will work. Otherwise: + $ patch foo.txt < bar.patch You can apply a patch to an entire directory, but note the "p level". @@ -24,7 +25,8 @@ intend to patch, identified by path names that might be different when the files ane located on your own computer instead of on the computer where the patch was created. 'p' level instructs the 'patch' utility to ignore parts of the path name to identify the files correctly. -Usually a p level of 1 will work, so you would use:\ +Usually a p level of 1 will work, so you would use: + $ patch -p1 < baz.patch Change to the top level directory before running this. If a patch level @@ -32,14 +34,16 @@ of 1 cannot identify the files to patch, then inspect the patch file for file names. For example:\ **/home/user/do/not/panic/yet.c** -and you are working in a directory that contains panic/yet.c, use:\ +and you are working in a directory that contains panic/yet.c, use: + $ patch -p5 < baz.patch You usually count one up for each path separator (forward slash) removed from the beginning of the path, until you are left with a path that exists in the current working directory. The count is the p level. -Removing a patch using the -R flag\ +Removing a patch using the -R flag + $ patch -p5 -R < baz.patch [Back to top of page.](#pagetop) @@ -49,13 +53,16 @@ Removing a patch using the -R flag\ Create a patch with diff ======================== -Diff can create a patch for a single file:\ +Diff can create a patch for a single file: + $ diff -u original.c new.c > original.patch -For diff'ing a source tree:\ +For diff'ing a source tree: + $ cp -R original new -Do whatever you want in new/ and then diff it:\ +Do whatever you want in new/ and then diff it: + $ diff -rupN original/ new/ > original.patch [Back to top of page.](#pagetop) @@ -69,10 +76,12 @@ git is something special. Note: this won't show new files created. -Just make whatever changes you want to a git clone and then:\ +Just make whatever changes you want to a git clone and then: + $ git diff > patch.git -Note the git revision that you did this with:\ +Note the git revision that you did this with: + $ git log Alternatively (better yet), commit your changes and then use: @@ -89,10 +98,12 @@ git apply it really is. Now to apply that patch in the future, just git clone it again and do -with the git revision you found from above:\ +with the git revision you found from above: + $ git reset --hard REVISIONNUMBER -Now put patch.git in the git clone directory and do:\ +Now put patch.git in the git clone directory and do: + $ git apply patch.git If you use a patch from git format-patch, then use **git am patch.git** |