You are not logged in.

#1 2014-06-29 16:18:18

alcedine
Member
Registered: 2014-06-29
Posts: 2

[Solved] How do I prevent writes to /boot when it is not mounted?

I'm booting from an USB drive, which I want to be able to take out once the system is up. This means that by default, /boot is just an empty directory. That's mostly fine, but in some cases (like if a kernel update comes in with pacman -Suy) things will get written into /boot without anything mounted there, which naturally throws things out of whack on the next boot. How do I deal with this? I don't want to plug in the drive for all updates and I don't want to have to go through the package list every time to make sure linux isn't on it. I thought about having a little script for mounting and unmounting the drive that also set permissions on /boot, but that's prone to error as I might forget to run the unmount script before shutdown or reboot and then I'm back to where I started. Is there a more robust version of this idea?

Last edited by alcedine (2014-06-29 16:34:10)

Offline

#2 2014-06-29 16:25:12

ids1024
Member
From: California
Registered: 2013-08-16
Posts: 243
Website

Re: [Solved] How do I prevent writes to /boot when it is not mounted?

You can set IgnorePkg in /etc/pacman.conf to prevent certain packages (such as linux) from being updated.


"Only wimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it."—Linus Torvalds
s/ftp/git/

https://iandouglasscott.com | https://github.org/ids1024 | https://keybase.io/ids1024

Offline

#3 2014-06-29 16:33:50

alcedine
Member
Registered: 2014-06-29
Posts: 2

Re: [Solved] How do I prevent writes to /boot when it is not mounted?

Yes, that'll work. Thanks.

Offline

#4 2014-06-29 16:37:19

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] How do I prevent writes to /boot when it is not mounted?

I'd probably do something like this (warning, psuedocode ahead).

First create a wrapper function in your .bashrc (or .bash_aliases) that calls a script after pacman finishes...

pacman-boot () {
   pacman $1
   /path/to/checkboot.sh
}

Then in the checkboot.sh script

#!/bin/sh
If /boot is empty then exit.
Else move /boot contents to temporary directory
Prompt to insert USB
Mount USB and sync from temporary directory
Unmount USB

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB