FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 01-12-2012, 10:12 PM
Dave Reisner
 
Default init: mount separate /usr

Use findmnt to detect the existance of a separate /usr partition
existing in the real root. If it does exist, fetch the options for it
and mount it. This currently makes a lot of assumptions and won't be
very friendly towards something such as a dm-crypt device.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
Yes, 2.20.1-2 is techincally the requirement, but vercmp doesn't care.

PKGBUILD | 2 +-
init | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/PKGBUILD b/PKGBUILD
index fc6b398..c596a69 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -8,7 +8,7 @@ license=('GPL')
groups=('base')
conflicts=('mkinitcpio')
provides=("mkinitcpio=$pkgver")
-depends=('mkinitcpio-busybox>=1.16.1-2' 'module-init-tools' 'util-linux>=2.19' 'libarchive' 'coreutils'
+depends=('mkinitcpio-busybox>=1.16.1-2' 'module-init-tools' 'util-linux>=2.20.1' 'libarchive' 'coreutils'
'bash' 'findutils' 'sed' 'grep' 'filesystem>=2011.10-1' 'udev>=177-1' 'file' 'gzip')
makedepends=('asciidoc' 'git')
optdepends=('xz: Use lzma or xz compression for the initramfs image'
diff --git a/init b/init
index 571a11a..8cf90b1 100644
--- a/init
+++ b/init
@@ -98,6 +98,15 @@ elif [ ! -x "/new_root${init}" ]; then
launch_interactive_shell --exec
fi

+# mount /usr if it exists
+if [ -f /new_root/etc/fstab ]; then
+ if usr_source=$(findmnt -nero source -s/new_root/etc/fstab /usr); then
+ mountopts=$(findmnt -nero options -s/new_root/etc/fstab /usr)
+ fsck_device "$usr_source"
+ mount "$usr_source" /new_root/usr -o "$mountopts"
+ fi
+fi
+
if [ "${break}" = "postmount" ]; then
echo ":: Post-mount break requested, type 'exit' to resume operation"
launch_interactive_shell
--
1.7.8.3
 
Old 01-12-2012, 10:15 PM
Dan McGee
 
Default init: mount separate /usr

On Thu, Jan 12, 2012 at 5:12 PM, Dave Reisner <d@falconindy.com> wrote:
> Use findmnt to detect the existance of a separate /usr partition
existence
> existing in the real root. If it does exist, fetch the options for it
> and mount it. This currently makes a lot of assumptions and won't be
> very friendly towards something such as a dm-crypt device.
>
> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
> ---
> Yes, 2.20.1-2 is techincally the requirement, but vercmp doesn't care.
It cares...you were just not reading the rules it abides by. If one
version or the other is missing a pkgrel, it ignores it.

$ vercmp 2.20.1-2 2.20.1-1
1
$ vercmp 2.20.1-2 2.20.1-2
0
$ vercmp 2.20.1-2 2.20.1-3
-1
$ vercmp 2.20.1-2 2.20.1
0
$ vercmp 2.20.1 2.20.1-2
0


>
> *PKGBUILD | * *2 +-
> *init * * | * *9 +++++++++
> *2 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/PKGBUILD b/PKGBUILD
> index fc6b398..c596a69 100644
> --- a/PKGBUILD
> +++ b/PKGBUILD
> @@ -8,7 +8,7 @@ license=('GPL')
> *groups=('base')
> *conflicts=('mkinitcpio')
> *provides=("mkinitcpio=$pkgver")
> -depends=('mkinitcpio-busybox>=1.16.1-2' 'module-init-tools' 'util-linux>=2.19' 'libarchive' 'coreutils'
> +depends=('mkinitcpio-busybox>=1.16.1-2' 'module-init-tools' 'util-linux>=2.20.1' 'libarchive' 'coreutils'
> * * * * *'bash' 'findutils' 'sed' 'grep' 'filesystem>=2011.10-1' 'udev>=177-1' 'file' 'gzip')
> *makedepends=('asciidoc' 'git')
> *optdepends=('xz: Use lzma or xz compression for the initramfs image'
> diff --git a/init b/init
> index 571a11a..8cf90b1 100644
> --- a/init
> +++ b/init
> @@ -98,6 +98,15 @@ elif [ ! -x "/new_root${init}" ]; then
> * * launch_interactive_shell --exec
> *fi
>
> +# mount /usr if it exists
> +if [ -f /new_root/etc/fstab ]; then
> + * *if usr_source=$(findmnt -nero source -s/new_root/etc/fstab /usr); then
> + * * * *mountopts=$(findmnt -nero options -s/new_root/etc/fstab /usr)
> + * * * *fsck_device "$usr_source"
> + * * * *mount "$usr_source" /new_root/usr -o "$mountopts"
> + * *fi
> +fi
> +
> *if [ "${break}" = "postmount" ]; then
> * * echo ":: Post-mount break requested, type 'exit' to resume operation"
> * * launch_interactive_shell
> --
> 1.7.8.3
>
>
 

Thread Tools




All times are GMT. The time now is 10:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org