Re: [arch-projects] [mkinitcpio] Booting from ISO on NTFS

2019-03-06 Thread Dave Reisner
On Wed, Mar 06, 2019 at 07:27:09PM +, Hietanen Jussi wrote:
> Thanks for the reply!
> 
> 
> One more quoestion: is there a RIGHT way to replace (to use my own) the init
> script and the included init_functions when generating a new initramfs using
> mkinitcpio (the default init is /usr/lib/initcpio/init)? The init script
> defines the mount_handler (mount_handler=default_mount_handler) but it cannot
> be changed, ie. it is hard coded, so I cannot "cleanly" (modularly) change it.
> 

Well, yes, you can override it. Here's an example:

https://github.com/anthonyrisinger/mkinitcpio-btrfs/blob/master/btrfs_hook#L376

> 
> BR,
> 
> Jussi
> 
> ━━━━━━━
> Lähettäjä: Dave Reisner 
> Lähetetty: 6. maaliskuuta 2019 20:57:38
> Vastaanottaja: Hietanen Jussi
> Kopio: arch-projects@archlinux.org
> Aihe: [mkinitcpio] Booting from ISO on NTFS
>  
> On Wed, Mar 06, 2019 at 06:28:36PM +, Hietanen Jussi wrote:
> > Hello!
> >
> >
> > I've been trying to find for an answer for my problem from the arch wiki, 
> > IRC
> > channel and from the google for the last a couple of days.
> >
> >
> > My problem: I'm creating a live Arch build which could boot from a .iso 
> > image
> > located on a Windows NTFS partition. I've successfully created a initramfs
> that
> > has ntfs-3g and is able to mount the NTFS partition, BUT the mkinitcpio 
> > lacks
> > tools to create an init script which could boot from a file from a
> filesystem.
> >
> >
> > My boot procedure would be following;
> >
> >
> > Boot the customized initramfs
> >
> > initramfs mounts the NTFS partition
> >
> > initramfs mounts the .ISO image as a loop device,
> >
> > initramfs changes the new root to the loop mounted .ISO
> >
> > the late userspace starts
> >
> >
> > Can this be achieved by simply adding initcpio hooks or do I need to rewrite
> > the whole early init script?
> >
> 
> cc'ing the arch-projects list where this belongs.
> 
> Let's just get this out of the way up front: this sounds shaky at best.
> You'd be better off booting the ISO directly from your bootloader if
> that's an option.
> 
> I'm not really sure if this is possible in the current implementation of
> mkinitcpio. You'd need to, at a minimum, override the mount_handler to
> mount your NTFS partition containing the ISO, and then setup the
> loopback mounted ISO on /new_root. After that, you'll have to `mount
> --move` the NTFS filesystem somewhere into the new system root, or do
> the incredibly hacky thing of lazily umounting it (because you have an
> open file handle to the ISO).
> 
> Good luck,
> dR


[arch-projects] [mkinitcpio] Booting from ISO on NTFS

2019-03-06 Thread Dave Reisner
On Wed, Mar 06, 2019 at 06:28:36PM +, Hietanen Jussi wrote:
> Hello!
> 
> 
> I've been trying to find for an answer for my problem from the arch wiki, IRC
> channel and from the google for the last a couple of days.
> 
> 
> My problem: I'm creating a live Arch build which could boot from a .iso image
> located on a Windows NTFS partition. I've successfully created a initramfs 
> that
> has ntfs-3g and is able to mount the NTFS partition, BUT the mkinitcpio lacks
> tools to create an init script which could boot from a file from a filesystem.
> 
> 
> My boot procedure would be following; 
> 
> 
> Boot the customized initramfs
> 
> initramfs mounts the NTFS partition
> 
> initramfs mounts the .ISO image as a loop device,
> 
> initramfs changes the new root to the loop mounted .ISO
> 
> the late userspace starts
> 
> 
> Can this be achieved by simply adding initcpio hooks or do I need to rewrite
> the whole early init script?
> 

cc'ing the arch-projects list where this belongs.

Let's just get this out of the way up front: this sounds shaky at best.
You'd be better off booting the ISO directly from your bootloader if
that's an option.

I'm not really sure if this is possible in the current implementation of
mkinitcpio. You'd need to, at a minimum, override the mount_handler to
mount your NTFS partition containing the ISO, and then setup the
loopback mounted ISO on /new_root. After that, you'll have to `mount
--move` the NTFS filesystem somewhere into the new system root, or do
the incredibly hacky thing of lazily umounting it (because you have an
open file handle to the ISO).

Good luck,
dR


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository annotated tag 25 created. 25

2018-10-16 Thread Dave Reisner via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The annotated tag, 25 has been created
at  c381320560a8ebc2b9b80d3686cb93e3dd067d62 (tag)
   tagging  a3cb799a8f63186b843db6a57da12d74a9320686 (commit)
  replaces  v24
 tagged by  Dave Reisner
on  Tue Oct 16 12:57:50 2018 -0400

- Log -
tag as v25
-BEGIN PGP SIGNATURE-

iQFLBAABCAA1FiEESH6swIVXrQggiNq6HrJjj/VsDFMFAlvGGI4XHGRyZWlzbmVy
QGFyY2hsaW51eC5vcmcACgkQHrJjj/VsDFOJKwgAti10wWG0Fk7fC8VFAcEKPo8k
IZ+7EfRbZFtTxPUT6PKVZeZxDM1Ibj1HZ2CgDT57ZTNDRn4RH9+W5mjiNJGSvX11
0u+NKJViPAD+IPuAjJQBr5ZnRByctbNUNgfDOtoQ1eHN0SJrnfxzinOBEn0sUARC
am7SKTiLcvyPDV/bD5ljAwNXDMSoIbhQHAr4VCMmJADULWusHIqcF5e+pXmi4z6S
WXAxXsKSM3qU9H2Clo9y/qZcQhA+/xqVyTd7gsSm8ZZIBLRJzaI0bkvA+Ss5TNS+
i++qfD8ZFOMGus56Olg5fkbp2ULqAAp5LLchadTY1sI6+7WywoHLfds+LiqjUQ==
=FDmL
-END PGP SIGNATURE-----

Dave Reisner (7):
  Restore addition of modules from config file
  lsinitcpio: Attempt to estimate only decompression time
  PKGBUILD: fix upstream URL
  cleanup some shellcheck lint warnings
  Remove install hook aliases for block and keyboard
  ship /var/run as symlink to /run
  install/block: avoid conditional addition of drivers

---


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v24-7-ga3cb799

2018-10-09 Thread Dave Reisner via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  a3cb799a8f63186b843db6a57da12d74a9320686 (commit)
   via  cfcc53c94d0bd67fc69e06c6c5f52bd801ccbe22 (commit)
   via  c511e624d4f0264d1ee4f32b08b59352d76708e5 (commit)
   via  e2a1189dbd0f3d8c051e2d21b8c8aec9b3b091c7 (commit)
  from  f8cc481e7a4cb33a351308b3f440870fef57fe72 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit a3cb799a8f63186b843db6a57da12d74a9320686
Author: Dave Reisner 
Date:   Mon Oct 8 19:45:11 2018 -0400

install/block: avoid conditional addition of drivers

Avoid over-optimizing autodetect and always add these. This allows
storage drivers to be builtins and still trigger addition of the block
node driver.

commit cfcc53c94d0bd67fc69e06c6c5f52bd801ccbe22
Author: Dave Reisner 
Date:   Thu Mar 29 05:46:08 2018 -0400

ship /var/run as symlink to /run

This might not strictly be strictly needed, but systemd documents it as
being a requirement, else it adds a var-run-bad taint flag.

commit c511e624d4f0264d1ee4f32b08b59352d76708e5
Author: Dave Reisner 
Date:   Sat Dec 30 12:18:40 2017 -0500

Remove install hook aliases for block and keyboard

These have been deprecated since 2012. I think that's enough time for
people to migrate.

commit e2a1189dbd0f3d8c051e2d21b8c8aec9b3b091c7
Author: Dave Reisner 
Date:   Sat Dec 30 12:16:12 2017 -0500

cleanup some shellcheck lint warnings

---

Summary of changes:
 functions|  3 ++-
 install/block| 25 -
 install/fw   |  1 -
 install/mmc  |  1 -
 install/pata |  1 -
 install/sata |  1 -
 install/scsi |  1 -
 install/usb  |  1 -
 install/usbinput |  1 -
 install/virtio   |  1 -
 mkinitcpio   | 24 +++-
 11 files changed, 21 insertions(+), 39 deletions(-)
 delete mode 12 install/fw
 delete mode 12 install/mmc
 delete mode 12 install/pata
 delete mode 12 install/sata
 delete mode 12 install/scsi
 delete mode 12 install/usb
 delete mode 12 install/usbinput
 delete mode 12 install/virtio


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [dbscripts] [PATCH v2 1/5] Use even more bashisms.

2018-02-20 Thread Dave Reisner
On Tue, Feb 20, 2018 at 11:59:49AM +, Emil Velikov via arch-projects wrote:
> Hi Eli,
> 
> Disclaimer: the following is a bit subtle topic, so I hope it doesn't
> spur a lot of off-topic.
> 
> On 19 February 2018 at 20:11, Eli Schwartz via arch-projects
>  wrote:
> > Catch some cases that were missed in the previous run.
> >
> > Signed-off-by: Eli Schwartz 
> > ---
> >
> > This patch is new + refactor some changes from:
> > ftpdir-cleanup,sourceballs: replace external find command with bash globbing
> >
> >  cron-jobs/devlist-mailer  |  6 +++---
> >  cron-jobs/ftpdir-cleanup  | 14 +++---
> >  cron-jobs/integrity-check |  2 +-
> >  cron-jobs/sourceballs | 12 ++--
> >  cron-jobs/update-web-db   |  6 +++---
> >  5 files changed, 20 insertions(+), 20 deletions(-)
> >
> Is there any performance or other technical benefit to using more bashisms?

The scripts run under bash, so why not take advantage of bash features?
For example, bash's [[ and (( are less error prone and more featureful
than the POSIX [, and builtins like mapfile and read (POSIX read has an
extremely limited featureset) make I/O far simpler tasks. There's plenty
more to like...

Please don't try to talk about performance and shell in the same
sentence. These are not performance-sensitive scripts, and shell is not
a language to use when performance (of almost any kind) is relevant.

> Reason being, that I am slowly going through different parts of Arch
> making it zsh friendly.
> While keeping the code brief and legible, of course.

Feel free to exemplify how conversion from bash to zsh has aided your
goals while retaining portability to a supermajority of Arch systems.

$ pacman -Q zsh
error: package 'zsh' was not found

> Guessing that I've picked the wrong hobby?

Almost certainly.

> Thanks
> Emil


Re: [arch-projects] [dbscripts] [PATCH v2 2/8] test: db-update: @test "update same any package to same repository fails": change PKGEXT

2018-02-19 Thread Dave Reisner
On Sun, Feb 18, 2018 at 12:17:30PM -0500, Luke Shumaker wrote:
> From: Luke Shumaker 
> 
> This has the test change PKGEXT the second time it tries to release the
> package.  Currently, this causes the tests to fail.  That's a good thing;
> it's checking for the regression where db-functions:check_pkgrepos isn't
> treating PKGEXT as a glob.
> 
> Without this, that regression didn't cause test failure because the checks
> right after it were tripping anyway.
> 
> https://lists.archlinux.org/pipermail/arch-projects/2018-February/004742.html
> ---
>  test/cases/db-update.bats | 3 ++-
>  test/lib/common.bash  | 7 ++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/test/cases/db-update.bats b/test/cases/db-update.bats
> index 1da7eef..36511c9 100644
> --- a/test/cases/db-update.bats
> +++ b/test/cases/db-update.bats
> @@ -92,8 +92,9 @@ load ../lib/common
>   db-update
>   checkPackage extra pkg-any-a
>  
> - releasePackage extra pkg-any-a
> + PKGEXT=.pkg.tar.gz releasePackage extra pkg-any-a
>   run db-update
> + [[ -z $BUILDDIR ]] || rm -f "${BUILDDIR}/$(__getCheckSum 
> "${TMP}/svn-packages-copy/pkg-any-a/trunk/PKGBUILD")"/*.pkg.tar.gz{,.sig}
>   [ "$status" -ne 0 ]
>  }
>  
> diff --git a/test/lib/common.bash b/test/lib/common.bash
> index cad4e13..d34af8a 100644
> --- a/test/lib/common.bash
> +++ b/test/lib/common.bash
> @@ -14,6 +14,11 @@ __getCheckSum() {
>   echo "${result%% *}"
>  }
>  
> +# Check if a file exists, even if the file uses wildcards
> +__isGlobfile() {

Frankly, this function name and comment sucks, because it says nothing
about quoting. As I read the comment, I'm lead to believe that given a
file "foobar" existing, I can call: __isGlobfile "foo*", and this will
succeed. To the naive reader, you might even believe this claim based on
the unquotedness of $1 within the -f test.

> + [[ -f $1 ]]
> +}


> +
>  __buildPackage() {
>   local pkgdest=${1:-.}
>   local p
> @@ -24,7 +29,7 @@ __buildPackage() {
>  
>   if [[ -n ${BUILDDIR} ]]; then
>   cache=${BUILDDIR}/$(__getCheckSum PKGBUILD)
> - if [[ -d ${cache} ]]; then
> + if __isGlobfile "${cache}"/*${PKGEXT}; then
>   cp -Lv ${cache}/*${PKGEXT}{,.sig} ${pkgdest}
>   return 0
>   else
> -- 
> 2.16.1


Re: [arch-projects] [dbscripts] [PATCH 1/2] Don't quote $PKGEXT

2018-02-15 Thread Dave Reisner
On Thu, Feb 15, 2018 at 03:14:19PM -0500, Eli Schwartz via arch-projects wrote:
> On 02/15/2018 03:11 PM, Dave Reisner wrote:
> > Rather than making this stand out like a sore thumb for the next person
> > to trip over, why don't we just define a "file_exists" function?
> > 
> >   file_exists() {
> > [[ -f $1 ]]
> >   }
> > 
> > Now you're free to do this:
> > 
> >   file_exists 
> > "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} && return 
> > 1
> > 
> > Expansion is taken care of by the shell before you pass to exists, and
> > the check does what you'd expect.
> 
> That was my first inclination, my second was to stop allowing people to
> upload *.kz compressed packages for giggles.
> 
> If we absolutely need to glob anything there, we should use bash
> extended globs to match @(g|z) and whatever else we actually want. This
> would work in [[ ]]
> 

Nope, changing the kind of glob doesn't work here. There's simply no
glob expansion of any kind inside [[ -f  ]] (or any other stat-like
check).


Re: [arch-projects] [dbscripts] [PATCH 1/2] Don't quote $PKGEXT

2018-02-15 Thread Dave Reisner
On Thu, Feb 15, 2018 at 02:49:45PM -0500, Luke Shumaker wrote:
> From: Luke Shumaker 
> 
> This partially reverts commit b61a7148eaf546a31597b74d9dd8948e4a39dea1.
> 
> In dbscripts, PKGEXT is a glob pattern--it needs to be "unquoted"; and
> The magic-quoting done by `[[ ... ]]` breaks that.  The closing-quote
> coming before ${PKGEXT} was quite intentional.
> ---
>  db-functions | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/db-functions b/db-functions
> index e8949d7..93a5af3 100644
> --- a/db-functions
> +++ b/db-functions
> @@ -374,8 +374,8 @@ check_pkgrepos() {
>   local pkgver="$(getpkgver ${pkgfile})" || return 1
>   local pkgarch="$(getpkgarch ${pkgfile})" || return 1
>  
> - [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT} 
> ]] && return 1
> - [[ -f 
> ${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}${PKGEXT}.sig ]] && 
> return 1
> + [ -f "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} 
> ] && return 1
> + [ -f 
> "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT}.sig ] && 
> return 1

Rather than making this stand out like a sore thumb for the next person
to trip over, why don't we just define a "file_exists" function?

  file_exists() {
[[ -f $1 ]]
  }

Now you're free to do this:

  file_exists "${FTP_BASE}/${PKGPOOL}/${pkgname}-${pkgver}-${pkgarch}"${PKGEXT} 
&& return 1

Expansion is taken care of by the shell before you pass to exists, and
the check does what you'd expect.

>   [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/} ]] && return 1
>   [[ -f ${FTP_BASE}/${PKGPOOL}/${pkgfile##*/}.sig ]] && return 1
>  
> -- 
> 2.16.1


Re: [arch-projects] [mkinitcpio] fsck install hook improvements

2018-02-13 Thread Dave Reisner
On Tue, Feb 13, 2018 at 04:19:33PM -0200, Marcos Mello via arch-projects wrote:
> - EXT, JFS and ReiserFS cleanup (install main tools and create
> required symlinks).
> - Only install /etc/e2fsck.conf for EXT filesystems.
> - Btrfs and XFS are special: their fscks do nothing (well, at least
> they show what tool to run). Users need xfs_repair and btrfs installed
> to try to fix the filesystem from initramfs. These tools do not have a
> "preen" mode.
> - Adapt the non-autodetect case accordingly.

Why do you want to aid in running fsck tools which are explicitly NOT
meant to be run on a regular basis?


Re: [arch-projects] [PATCH] [namcap] Treat all non-tar files as PKGBUILD files, regardless of filename

2018-01-25 Thread Dave Reisner
On Thu, Jan 25, 2018 at 01:31:45PM -0500, Luke Shumaker wrote:
> From: Luke Shumaker 
> 
> https://bugs.archlinux.org/task/57193
> 
> If the user mistakenly passes in some other (non-package, non-PKGBUILD)
> file, instead of refusing to process it (saying
> "Error: Cannot process ${filename}"), it will now try to parse it as a
> PKGBUILD, probably encounter and print at least one error, but finally say
> "Error: ${filename} is not a valid PKGBUILD".  This is actually probably
> *more* helpful to a confused user who passed in the wrong file.
> ---
>  namcap.py | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/namcap.py b/namcap.py
> index b62a2fa..fd62d3c 100755
> --- a/namcap.py
> +++ b/namcap.py
> @@ -248,9 +248,7 @@ for package in packages:
>  
>   if os.path.isfile(package) and tarfile.is_tarfile(package):
>   process_realpackage(package, active_modules)
> - elif package.endswith('PKGBUILD'):
> + else:

Install files? Other assets? Doesn't this mean we assume they're
PKGBUILDs?

>   process_pkgbuild(package, active_modules)
> - else:
> - print("Error: Cannot process %s" % package)
>  
>  # vim: set ts=4 sw=4 noet:
> -- 
> 2.15.1


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v24-3-gf8cc481

2017-11-25 Thread Dave Reisner via arch-projects
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  f8cc481e7a4cb33a351308b3f440870fef57fe72 (commit)
   via  8118efa675e75400e9272ac88a00b6faa00ce83e (commit)
  from  5bba09cb1c661627fde76b977cfe9f937b1264a3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit f8cc481e7a4cb33a351308b3f440870fef57fe72
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Nov 24 16:25:50 2017 -0500

PKGBUILD: fix upstream URL

commit 8118efa675e75400e9272ac88a00b6faa00ce83e
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Nov 24 16:23:28 2017 -0500

lsinitcpio: Attempt to estimate only decompression time

Read time is constant between compression methods and we can't possibly
estimate this accurately since reading the image from disk doesn't
happen with kernel userland functions, but instead UEFI or 16-bit
realmode capabilities.

ref: https://bugs.archlinux.org/task/56417

---

Summary of changes:
 PKGBUILD   |  2 +-
 lsinitcpio | 20 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v24-1-g5bba09c

2017-10-06 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  5bba09cb1c661627fde76b977cfe9f937b1264a3 (commit)
  from  c99e8f6cc1e6f2aa08c667045c86608f86374a54 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 5bba09cb1c661627fde76b977cfe9f937b1264a3
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Oct 6 08:15:43 2017 -0400

Restore addition of modules from config file

Broken by c5ad00c2.

ref: https://bugs.archlinux.org/task/55870

---

Summary of changes:
 functions | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v23-10-gc99e8f6

2017-10-01 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  c99e8f6cc1e6f2aa08c667045c86608f86374a54 (commit)
  from  73262320852264c3bc33cace11503a3ea5820121 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit c99e8f6cc1e6f2aa08c667045c86608f86374a54
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Oct 1 14:21:09 2017 -0400

man: include package name in version

---

Summary of changes:
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v23-9-g7326232

2017-10-01 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  73262320852264c3bc33cace11503a3ea5820121 (commit)
   via  8d59e6a1d7ef3e68b6ed3f17a7a0c20873055592 (commit)
   via  b255bdc78754c4cde9835b6cb2865da1f9b122bf (commit)
  from  32dbf895d07f07e32d2b3bb4afb132eea1919749 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 73262320852264c3bc33cace11503a3ea5820121
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Oct 1 14:09:53 2017 -0400

add crc32c for ext4

Might be needed for ext4 filesystems formatted with the metadata_csum
option.

ref: https://bugs.archlinux.org/task/54091

commit 8d59e6a1d7ef3e68b6ed3f17a7a0c20873055592
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Oct 1 13:57:54 2017 -0400

Avoid erroneous deprecation warnings

Consistently handle hooks as symlinks by relying on the exit status of
readlink instead of an lstat and always, additionally, examine the hooks
basenames to ensure that we aren't warning about foo deprecating foo
(because the hook is a symlink to somewhere else that the hook is
actually stored on disk.

ref: https://bugs.archlinux.org/task/55323

commit b255bdc78754c4cde9835b6cb2865da1f9b122bf
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Oct 1 13:38:06 2017 -0400

install/keyboard: fix wording in hook help

ref: https://bugs.archlinux.org/task/54460

---

Summary of changes:
 functions| 12 +++-
 install/keyboard |  4 ++--
 mkinitcpio   | 12 ++--
 3 files changed, 11 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [mkinitcpio][PATCH] check if module is builtin kernel in add_module

2017-09-10 Thread Dave Reisner
On Sun, Sep 10, 2017 at 12:21:11PM +0200, BlackEagle via arch-projects wrote:
> When we want to make sure a module is added to initcpio, but the module
> is built in the kernel, we now get an error the module is not found.
> Therefore we should check if the module is builtin and don't fail when
> its found there.
> 
> example: when sd_mod is built in your kernel you got an error before
> 
> ==> ERROR: module not found: `sd_mod'
> 
> but the module can be found in /lib/modules/$KERNELNAME/modules.builtin
> 'kernel/drivers/scsi/sd_mod.ko'
> 
> Signed-off-by: BlackEagle 
> ---
>  functions | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/functions b/functions
> index 941312f..3051e81 100644
> --- a/functions
> +++ b/functions
> @@ -400,6 +400,9 @@ add_module() {
>  done < <(modinfo -b "$_optmoduleroot" -k "$KERNELVERSION" -0 "$target" 
> 2>/dev/null)
> 
>  if (( !found )); then
> +if grep "$target" 
> "$_optmoduleroot/lib/modules/$KERNELVERSION/modules.builtin" > /dev/null 
> 2>&1; then
> +return 0
> +fi

But we already use this file to preseed the _addedmodules array and
treat builtins as already satisfied:

https://git.archlinux.org/mkinitcpio.git/tree/mkinitcpio#n497

Please figure out why this doesn't work for you, or at least provide a
simplified case to reproduce the error you're seeing.

>  (( ign_errors || _addedmodules["$target"] )) && return 0
>  error "module not found: \`%s'" "$target"
>  return 1
> --
> 2.14.1


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v23-6-g32dbf89

2017-08-25 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  32dbf895d07f07e32d2b3bb4afb132eea1919749 (commit)
   via  172ca644527cfaf3bba1dbeab9e7139cca2b249a (commit)
   via  cee0499489e97384b72d47473606272d12ac96c0 (commit)
   via  c5ad00c2e565eaae8e8b02b92d7f193852008c80 (commit)
  from  91b212551a5066bda4eb76c83bdd9c0d0ac8e6cc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 32dbf895d07f07e32d2b3bb4afb132eea1919749
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Mon Aug 21 21:33:22 2017 -0400

make ldd parsing compatible with upstream glibc changes


https://sourceware.org/git/?p=glibc.git;a=commit;h=eedca9772e99c72ab4c3c34e43cc764250aa3e3c

commit 172ca644527cfaf3bba1dbeab9e7139cca2b249a
Author: Erik Stromdahl <erik.stromd...@gmail.com>
Date:   Thu Jun 1 19:29:18 2017 +0200

functions: add_full_dir: path prefix strip-off

Add third argument to add_full_dir: strip_prefix.
The strip_prefix will be stripped off from the destination
path (path in the initramfs image) when adding files.

Rationale: Make it easier to add rootfs overlay hooks when
generating images.

add_full_dir can be invoked in this way:

add_full_dir /path/on/parent/rootfs-overlay * /path/on/parent/rootfs-overlay

The above invocation will add all content of 
*/path/on/parent/rootfs-overlay*
into */* in the initramfs image.

Signed-off-by: Erik Stromdahl <erik.stromd...@gmail.com>

commit cee0499489e97384b72d47473606272d12ac96c0
Author: Erik Stromdahl <erik.stromd...@gmail.com>
Date:   Thu Jun 1 19:29:17 2017 +0200

functions: add_full_dir: recursive filter

By passing the filter glob in all recursive invocations of
add_full_dir, the filtering is performed on all subdirs and
not just the top dir.

This makes the implementation correspond to the documented
behavior in the man page.

Signed-off-by: Erik Stromdahl <erik.stromd...@gmail.com>

commit c5ad00c2e565eaae8e8b02b92d7f193852008c80
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sat Mar 18 14:14:36 2017 -0400

arrayize config vars in mkinitcpio.conf

allows for backwards compat by detecting and converting old-style
string-based configs.

---

Summary of changes:
 functions | 38 +++---
 man/mkinitcpio.8.txt  |  7 ++-
 man/mkinitcpio.conf.5.txt | 20 ++--
 mkinitcpio| 10 ++
 mkinitcpio.conf   | 22 +++---
 5 files changed, 56 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [devtools] [PATCH] makechrootpkg: Avoid having code floating around outside of a function.

2017-04-05 Thread Dave Reisner
On Wed, Apr 05, 2017 at 06:39:35PM -0400, luke...@lukeshu.com wrote:
> From: Luke Shumaker 
> 
> This means wrapping variable initialization in init_variables(), and the
> main program routine in main().
> 
> I did NOT put `shopt -s nullglob` in to a function.
> ---
>  makechrootpkg.in | 252 
> ---
>  1 file changed, 130 insertions(+), 122 deletions(-)
> 
> diff --git a/makechrootpkg.in b/makechrootpkg.in
> index f6764cb..93cdc10 100644
> --- a/makechrootpkg.in
> +++ b/makechrootpkg.in
> @@ -15,26 +15,28 @@ m4_include(lib/archroot.sh)
>  
>  shopt -s nullglob
>  
> -default_makepkg_args=(-s --noconfirm -L --holdver)
> -makepkg_args=("${default_makepkg_args[@]}")
> -repack=false
> -update_first=false
> -clean_first=false
> -run_namcap=false
> -temp_chroot=false
> -chrootdir=
> -passeddir=
> -makepkg_user=
> -declare -a install_pkgs
> -declare -i ret=0
> -
> -bindmounts_ro=()
> -bindmounts_rw=()
> -
> -copy=$USER
> -[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
> -[[ -z "$copy" || $copy = root ]] && copy=copy
> -src_owner=${SUDO_USER:-$USER}
> +init_variables() {
> + default_makepkg_args=(-s --noconfirm -L --holdver)
> + makepkg_args=("${default_makepkg_args[@]}")
> + repack=false
> + update_first=false
> + clean_first=false
> + run_namcap=false
> + temp_chroot=false
> + chrootdir=
> + passeddir=
> + makepkg_user=
> + declare -a install_pkgs
> + declare -i ret=0

By using declare here, you're scoping the variables to the function.

> +
> + bindmounts_ro=()
> + bindmounts_rw=()
> +
> + copy=$USER
> + [[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
> + [[ -z "$copy" || $copy = root ]] && copy=copy
> + src_owner=${SUDO_USER:-$USER}
> +}
>  
>  usage() {
>   echo "Usage: ${0##*/} [options] -r  [--] [makepkg args]"
> @@ -308,109 +310,115 @@ move_products() {
>  }
>  # }}}
>  
> -while getopts 'hcur:I:l:nTD:d:U:' arg; do
> - case "$arg" in
> - c) clean_first=true ;;
> - D) bindmounts_ro+=(--bind-ro="$OPTARG") ;;
> - d) bindmounts_rw+=(--bind="$OPTARG") ;;
> - u) update_first=true ;;
> - r) passeddir="$OPTARG" ;;
> - I) install_pkgs+=("$OPTARG") ;;
> - l) copy="$OPTARG" ;;
> - n) run_namcap=true; makepkg_args+=(-i) ;;
> - T) temp_chroot=true; copy+="-$$" ;;
> - U) makepkg_user="$OPTARG" ;;
> - h|*) usage ;;
> - esac
> -done
> -
> -[[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]] && die 'This must be run in a 
> directory containing a PKGBUILD.'
> -[[ -n $makepkg_user && -z $(id -u "$makepkg_user") ]] && die 'Invalid 
> makepkg user.'
> -
> -check_root
> -
> -# Canonicalize chrootdir, getting rid of trailing /
> -chrootdir=$(readlink -e "$passeddir")
> -[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" 
> "$passeddir"
> -[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try 
> using: mkarchroot %s/root base-devel" "$chrootdir"
> -
> -if [[ ${copy:0:1} = / ]]; then
> - copydir=$copy
> -else
> - copydir="$chrootdir/$copy"
> -fi
> -
> -# Pass all arguments after -- right to makepkg
> -makepkg_args+=("${@:$OPTIND}")
> -
> -# See if -R was passed to makepkg
> -for arg in "${@:OPTIND}"; do
> - case ${arg%%=*} in
> - -*R*|--repackage)
> - repack=true
> - break 2
> - ;;
> - esac
> -done
> -
> -if [[ -n $SUDO_USER ]]; then
> - eval "USER_HOME=~$SUDO_USER"
> -else
> - USER_HOME=$HOME
> -fi
> -
> -umask 0022
> -
> -load_vars "${XDG_CONFIG_HOME:-$USER_HOME/.config}/pacman/makepkg.conf" || 
> load_vars "$USER_HOME/.makepkg.conf"
> -load_vars /etc/makepkg.conf
> -
> -# Use PKGBUILD directory if these don't exist
> -[[ -d $PKGDEST ]]|| PKGDEST=$PWD
> -[[ -d $SRCDEST ]]|| SRCDEST=$PWD
> -[[ -d $SRCPKGDEST ]] || SRCPKGDEST=$PWD
> -[[ -d $LOGDEST ]]|| LOGDEST=$PWD
> -
> -# Lock the chroot we want to use. We'll keep this lock until we exit.
> -lock 9 "$copydir.lock" "Locking chroot copy [%s]" "$copy"
> -
> -if [[ ! -d $copydir ]] || $clean_first; then
> - sync_chroot "$chrootdir" "$copy"
> -fi
> -
> -$update_first && arch-nspawn "$copydir" \
> +main() {
> + init_variables
> +
> + while getopts 'hcur:I:l:nTD:d:U:' arg; do
> + case "$arg" in
> + c) clean_first=true ;;
> + D) bindmounts_ro+=(--bind-ro="$OPTARG") ;;
> + d) bindmounts_rw+=(--bind="$OPTARG") ;;
> + u) update_first=true ;;
> + r) passeddir="$OPTARG" ;;
> + I) install_pkgs+=("$OPTARG") ;;
> + l) copy="$OPTARG" ;;
> + n) run_namcap=true; makepkg_args+=(-i) ;;
> + T) temp_chroot=true; copy+="-$$" ;;
> + U) makepkg_user="$OPTARG" ;;
> 

Re: [arch-projects] [devtools] [PATCH 3/8] arch-nspawn: usage(): Style improvement: two spaces after a period.

2017-04-02 Thread Dave Reisner
On Sun, Apr 02, 2017 at 04:09:57AM -0400, luke...@lukeshu.com wrote:
> From: Luke Shumaker 
> 
> ---

If you want to change this, I have no strong feelings one way or the
other, but this is only a small part of what would need to be done. See
the usage messages makechrootpkg, mkarchroot, the template pacman.conf
and makepkg.conf files, some other log lines in makechrootpkg

>  arch-nspawn.in | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch-nspawn.in b/arch-nspawn.in
> index 7481d82..ca1fbc3 100644
> --- a/arch-nspawn.in
> +++ b/arch-nspawn.in
> @@ -17,7 +17,7 @@ working_dir=''
>  
>  usage() {
>   echo "Usage: ${0##*/} [options] working-dir [systemd-nspawn arguments]"
> - echo "A wrapper around systemd-nspawn. Provides support for pacman."
> + echo "A wrapper around systemd-nspawn.  Provides support for pacman."
>   echo
>   echo ' options:'
>   echo '-C  Location of a pacman config file'
> @@ -87,7 +87,7 @@ umask 0022
>  if [[ ! -f "$working_dir/.arch-chroot" ]]; then
>   die "'%s' does not appear to be an Arch chroot." "$working_dir"
>  elif [[ $(cat "$working_dir/.arch-chroot") != $CHROOT_VERSION ]]; then
> - die "chroot '%s' is not at version %s. Please rebuild." "$working_dir" 
> "$CHROOT_VERSION"
> + die "chroot '%s' is not at version %s.  Please rebuild." "$working_dir" 
> "$CHROOT_VERSION"
>  fi
>  
>  build_mount_args
> -- 
> 2.12.1


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v23-2-g91b2125

2017-03-17 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  91b212551a5066bda4eb76c83bdd9c0d0ac8e6cc (commit)
  from  c90eb88f04c6acf621e9682172636fae3d0328ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 91b212551a5066bda4eb76c83bdd9c0d0ac8e6cc
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Mar 17 12:45:33 2017 -0400

mkinitcpio: allow -s to be passed through to presets

ref: https://bugs.archlinux.org/task/53343

---

Summary of changes:
 mkinitcpio | 2 ++
 1 file changed, 2 insertions(+)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v23-1-gc90eb88

2017-03-14 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  c90eb88f04c6acf621e9682172636fae3d0328ad (commit)
  from  15cab4d017c7cc46b8234bfa641fcef2b28207b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit c90eb88f04c6acf621e9682172636fae3d0328ad
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Tue Mar 14 10:50:26 2017 -0400

avoid erroring when a builtin-module can't be found

This is harmless fallout from 5249350, which tries harder to re-add
aliases of builtins.

---

Summary of changes:
 functions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository annotated tag v23 created. v23

2017-03-11 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The annotated tag, v23 has been created
at  12e44319725517b869796bd71dbfd8db6521343a (tag)
   tagging  15cab4d017c7cc46b8234bfa641fcef2b28207b6 (commit)
  replaces  v22
 tagged by  Dave Reisner
on  Sat Mar 11 13:19:47 2017 -0500

- Log -
tag as v23
-BEGIN PGP SIGNATURE-

iQFLBAABCAA1FiEESH6swIVXrQggiNq6HrJjj/VsDFMFAljEP8MXHGRyZWlzbmVy
QGFyY2hsaW51eC5vcmcACgkQHrJjj/VsDFM91wf9GyE7mkY1TIz2W9tW46E0KPnB
+1EXlY/dlPMRQzTsZOEr2HfYtPYCQ6Ik0N3Su8RnMC4RmyqZdU18lNpP+LvpQ9q8
BPXWtpzH3EzNVXn/1dd7YvMrhai+YXVSLP4op+I34eKHVF3xxQ+tDvmNV5i36JB3
XshaJMI3IHoVnfb9NU2ZNDwLhRfCfbvlLfO7ivZ86TNwmid8VeCy25olceDITSHh
BL9kgpGcVjsV2YTUyKsYjh/DUhveXxHUE3h1XnuL2suBmr+VrBq5jIPuFU3LRuLi
pf8Ka5t3Rxflj9NW1buRhLDvG54cemJI48kkyptJWGzX63kI+V2svCLOYcr22Q==
=lD7T
-END PGP SIGNATURE-----

Dave Reisner (4):
  functions: attempt to (re)add builtin modules
  init: move early mounting to function, add efivars
  lsinitcpio: avoid null byte warnings with bash 4.3
  init: drop pre-mount check for block device

---


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v22-4-g15cab4d

2017-03-11 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  15cab4d017c7cc46b8234bfa641fcef2b28207b6 (commit)
   via  f6275f0d91c8ad06bf0847eb7542755b8ea9e3c7 (commit)
  from  70511e5ccb7e2500213e04173a70c067a7c9aa35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 15cab4d017c7cc46b8234bfa641fcef2b28207b6
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sat Mar 11 12:25:32 2017 -0500

init: drop pre-mount check for block device

Not all root devices are block devices, after all. Rely on mount doing
the right thing (or not).

ref: https://bugs.archlinux.org/task/45118
ref: https://bugs.archlinux.org/task/35529

commit f6275f0d91c8ad06bf0847eb7542755b8ea9e3c7
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Mar 10 16:39:52 2017 -0500

lsinitcpio: avoid null byte warnings with bash 4.3

On compressed images, bash 4.3 gets salty:

$ lsinitcpio initrd.gz >/dev/null
/usr/bin/lsinitcpio: line 78: warning: command substitution: ignored null 
byte in input
/usr/bin/lsinitcpio: line 90: warning: command substitution: ignored null 
byte in input

Tidy up all of our hexdump comparisons via command substitution to use
process substitution instead.

---

Summary of changes:
 init_functions |  8 
 lsinitcpio | 20 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v22-2-g70511e5

2017-03-10 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  70511e5ccb7e2500213e04173a70c067a7c9aa35 (commit)
   via  5249350c80a6158ebcf278e780f42c6abc3643f1 (commit)
   via  30888208bf7b1b2bce3f0b132393b6a3bb303657 (commit)
  from  bf389393ffa56881688fbff1219c562ec2997d98 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 70511e5ccb7e2500213e04173a70c067a7c9aa35
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Mar 10 07:12:42 2017 -0500

init: move early mounting to function, add efivars

ref: https://bugs.archlinux.org/task/52768

commit 5249350c80a6158ebcf278e780f42c6abc3643f1
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Mon Nov 28 17:47:14 2016 -0500

functions: attempt to (re)add builtin modules

crc32 is a builtin module in the Arch kernel but also a crypto module.
Resolve by this only noting that a module is added if the value in the
has is 1, and not 2 (indicating a builtin).

While we're here, change the f2fs softdep of crc32 to crypto-crc32.

ref: https://bugs.archlinux.org/task/49380

commit 30888208bf7b1b2bce3f0b132393b6a3bb303657
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Nov 27 14:06:51 2016 -0500

Makefile: assorted cleanups and additions

---

Summary of changes:
 Makefile   | 31 +--
 functions  |  4 ++--
 init   |  6 +-
 init_functions | 12 
 4 files changed, 36 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [devtools] [PATCH] makechrootpkg: Be recursive when deleting btrfs subvolumes.

2017-02-10 Thread Dave Reisner
On Fri, Feb 10, 2017 at 03:46:08AM -0500, luke...@lukeshu.com wrote:
> From: Luke Shumaker 
> 
> Motivation:
> 
>   When installing the necessaryssary dependencies in the chroot, the
>   ALPM hooks run; and if 'systemd' is a dependency, then one of the
>   hooks is to run systemd-tmpfiles.  There are several tmpfiles.d(5)
>   commands that instruct it to create btrfs subvolumes if on btrfs
>   (the `v`, `q`, and `Q` commands).
> 
>   This causes a problem when we go to delete the chroot.  The command
>   `btrfs subvolume delete` won't recursively delete subvolumes; if a
>   child subvolume was created, it will fail with the fairly unhelpful
>   error message "directory not empty".
> 
> Solution:
> 
>   Because the subvolume that gets mounted isn't necessarily the
>   toplevel subvolume, and `btrfs subvolume list` gives us paths
>   relative to the toplevel; we need to figure out how our path relates
>   to the toplevel.  Figure out the mountpoint (which turns out to be
>   slightly tricky; see below), and call `btrfs subvolume list -a` on
>   it to get the list of subvolumes that are visible to us (and quite
>   possibly some that aren't; the logic for determining which ones it
>   shows is... absurd).  This gives us a list of subvolumes with
>   numeric IDs, and paths relative to the toplevel (actually it gives
>   us more than that, and we use a hopefully-correct `sed` expression
>   to trim it down; the format certainly isn't human-friendly, but it's
>   not machine-friendly either.)  So then we look at that list of pairs
>   and find the one that matches the ID of the subvolume we're trying
>   to delete (which is easy to get with `btrfs subvolume show`); once
>   we've found the path of our subvolume, we can use that to filter and
>   trim the complete list of paths.  From there the remainder of the
>   solution is obvious.
> 
>   Now, back to "figure out the mountpoint"; the normal `stat -c %m`
>   doesn't work.  It gives the mounted path of the subvolume closest to
>   the path we give it, not the actual mountpoint.  Now, it turns out
>   that `df` can figure out the correct mountpoint (though I haven't
>   investigated how it knows when stat doesn't; but I suspect it parses
>   `/proc/mounts`).  So we are reduced to parsing `df`'s output.
> ---

If you need to write a commit message this long just to remove what's
currently a single nested subvolume, then I agree with Jan that we need
to rethink our chroot management, or btrfs needs to improve its tooling
(I tend to think the latter is true independent of this patch).

That said, this patch does seem to work as of this writing. I have
concerns that it's a little fragile and might break in the future.

>  makechrootpkg.in | 59 
> ++--
>  1 file changed, 57 insertions(+), 2 deletions(-)
> 
> diff --git a/makechrootpkg.in b/makechrootpkg.in
> index 5c4b530..01e9e96 100644
> --- a/makechrootpkg.in
> +++ b/makechrootpkg.in
> @@ -80,6 +80,61 @@ load_vars() {
>   return 0
>  }
>  
> +# Usage: btrfs_subvolume_id $SUBVOLUME
> +btrfs_subvolume_id() (
> + set -o pipefail
> + LC_ALL=C btrfs subvolume show "$1" | sed -n 's/^\tSubvolume ID:\s*//p'

This looks like you're parsing human readable output to get the subvol
ID. Is this really the only way to get this information?

> +)
> +
> +# Usage: btrfs_subvolume_list_all $FILEPATH
> +#
> +# Given $FILEPATH somewhere on a mounted btrfs filesystem, print the
> +# ID and full path of every subvolume on the filesystem, one per line
> +# in the format "$ID $PATH".
> +btrfs_subvolume_list_all() (
> + set -o pipefail
> + local mountpoint
> + mountpoint="$(df --output=target "$1" | sed 1d)" || return $?

"return $?" is a long winded way of just "return". The status is
implied.

> + LC_ALL=C btrfs subvolume list -a "$mountpoint" | sed -r 's|^ID ([0-9]+) 
> .* path (/)?(\S*).*|\1 \3|'

You might want to validate that you actually get an integer back here,
rather than just assuming the calls succeed. You cannot rely on sed to
provide a useful exit status.

> +)
> +
> +# Usage: btrfs_subvolume_list $SUBVOLUME
> +#
> +# Assuming that $SUBVOLUME is a btrfs subvolume, list all child
> +# subvolumes; from most deeply nested to most shallowly nested.
> +#
> +# This is intended to be a sane version of `btrfs subvolume list`.
> +btrfs_subvolume_list() {
> + local subvolume=$1
> +
> + local id all path subpath
> + id="$(btrfs_subvolume_id "$subvolume")" || return $?
> + all="$(btrfs_subvolume_list_all "$subvolume")" || return $?
> + path="$(sed -n "s/^$id //p" <<<"$all")"

Rather than injecting unvalidated data into a sed program, I'd suggest
using awk:

path=$(awk -v id="$1" '$1 == id { sub($1 FS, ""); print }' <<<"$all")

> + while read -r id subpath; do
> + if [[ "$subpath" = "$path"/* ]]; then
> + printf '%s\n' "${subpath#"${path}/"}"
> + fi
> + done 

[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository annotated tag v22 created. v22

2016-12-11 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The annotated tag, v22 has been created
at  b5d66416c9b4960faa494689f6181757d586829f (tag)
   tagging  30888208bf7b1b2bce3f0b132393b6a3bb303657 (commit)
  replaces  v21
 tagged by  Dave Reisner
on  Sun Nov 27 15:06:52 2016 -0500

- Log -
tag as v22
-BEGIN PGP SIGNATURE-

iQFLBAABCAA1FiEESH6swIVXrQggiNq6HrJjj/VsDFMFAlg7PNwXHGRyZWlzbmVy
QGFyY2hsaW51eC5vcmcACgkQHrJjj/VsDFPBbAgAvWpIVR6FMDDdWtatDzhFXjkA
qDMgi9NG63E8cLsWddkK7kFOLoksmwQiM/1tjDe2vaRv6hEgUnPPHgPzRXsC4ZLH
uC4MrAWon0cic/zIDrhx2ErQ4O9HDqd3xNN1FbHJd2hu2FSsb1FUyAONNXPOgD3+
CsxQimiMsvNnd+GTgrOQkkAT+AtyCmDGsO3ohdJjfzsil1D6RZRdJUrDFjYSU5nq
aSlyZPgHZb5SxFfS3UVbMrcKdgZr55O2CzUS40VDbxTOETL3UEtzm2/QURLBzOmg
QWXY4vh9tbpbzMV4b4MYppQijhv5eJ0jKPe/VNIkW+M4zXGczHHjbzFxxu9aJg==
=FU45
-END PGP SIGNATURE-----

Dave Reisner (7):
  mkinitcpio: fixing quoting in call to initialize_buildroot
  fsck: avoid extra search paths
  functions: fix typo in variable name
  functions: f2fs softdeps on crc32, not libcrc32c
  add missing -P, --allpresets option to usage output
  base: drop addition of ehci softdep file
  Makefile: assorted cleanups and additions

Jan Alexander Steffens (heftig) via arch-projects (1):
  sd-vconsole: Use udev activation

---


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v21-7-gbf38939

2016-11-26 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  bf389393ffa56881688fbff1219c562ec2997d98 (commit)
  from  a71507a9e679b665ec785e25e0dba1b2b6008c05 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit bf389393ffa56881688fbff1219c562ec2997d98
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sat Nov 26 12:49:41 2016 -0500

base: drop addition of ehci softdep file

this is no longer needed -- we get softdeps from the kernel.

---

Summary of changes:
 install/base | 1 -
 1 file changed, 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v21-6-ga71507a

2016-11-25 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  a71507a9e679b665ec785e25e0dba1b2b6008c05 (commit)
   via  8d1d5cce87cec6038dfc42c93e1c65b486bff16f (commit)
  from  46cdc8b9e9246b08cc60988d27097e247e7d9eb8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit a71507a9e679b665ec785e25e0dba1b2b6008c05
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Thu Nov 24 21:46:02 2016 -0500

add missing -P, --allpresets option to usage output

commit 8d1d5cce87cec6038dfc42c93e1c65b486bff16f
Author: Jan Alexander Steffens (heftig) via arch-projects 
<arch-projects@archlinux.org>
Date:   Tue Nov 22 20:34:39 2016 +0100

sd-vconsole: Use udev activation

systemd v232 only activates systemd-vconsole-setup via udev. Follow this
to make sure things work properly. This also obsoletes the modules-load
hack.

https://github.com/systemd/systemd/issues/4699

---

Summary of changes:
 install/sd-vconsole | 9 ++---
 mkinitcpio  | 1 +
 2 files changed, 3 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [mkinitcpio] [PATCH] sd-vconsole: Use udev activation

2016-11-22 Thread Dave Reisner
On Tue, Nov 22, 2016 at 08:34:39PM +0100, Jan Alexander Steffens (heftig) via 
arch-projects wrote:
> systemd v232 only activates systemd-vconsole-setup via udev. Follow this
> to make sure things work properly. This also obsoletes the modules-load
> hack.
> 
> https://github.com/systemd/systemd/issues/4699
> ---

Thanks!

>  install/sd-vconsole | 9 ++---
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/install/sd-vconsole b/install/sd-vconsole
> index 93cbbcd0c1a9f74f..8c01ffb21940f4c8 100644
> --- a/install/sd-vconsole
> +++ b/install/sd-vconsole
> @@ -34,10 +34,11 @@ add_keymap_file() {
>  }
>  
>  build() {
> -add_systemd_unit systemd-vconsole-setup.service
> +add_binary /usr/lib/systemd/systemd-vconsole-setup
>  add_binary loadkeys
>  add_binary setfont
>  add_file /etc/vconsole.conf
> +add_udev_rule 90-vconsole.rules
>  
>  # subshell to avoid namespace pollution
>  (
> @@ -56,12 +57,6 @@ build() {
>  done
>  fi
>  )
> -
> -# Set up the console only after any manually loaded GPU drivers (e.g. 
> i915)
> -add_systemd_drop_in systemd-vconsole-setup.service after-modules < -[Unit]
> -After=systemd-modules-load.service
> -EOF
>  }
>  
>  help() {
> -- 
> 2.10.2


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v21-4-g46cdc8b

2016-11-20 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  46cdc8b9e9246b08cc60988d27097e247e7d9eb8 (commit)
   via  dd0dc1b6c6d6b02e4e1613b62e373efa79d1562e (commit)
   via  89d9186264f56fcbceecd69681a79e70d43c6f14 (commit)
   via  06fb38e846fd22a4daac5d129687d1c1e6c187fc (commit)
  from  757b511d71901a445f300f14ce8e54804d54724d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 46cdc8b9e9246b08cc60988d27097e247e7d9eb8
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Nov 20 11:32:18 2016 -0500

functions: f2fs softdeps on crc32, not libcrc32c

This really ought to be fixed in the module, but here we are again
guessing at module requirements.

ref: https://bugs.archlinux.org/task/49380

commit dd0dc1b6c6d6b02e4e1613b62e373efa79d1562e
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Nov 20 08:37:57 2016 -0500

functions: fix typo in variable name

builderrors -> _builderrors -- this makes binary dep resolution
properly a builderror. As seen in:

https://bugs.archlinux.org/task/51818

commit 89d9186264f56fcbceecd69681a79e70d43c6f14
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Nov 20 08:36:18 2016 -0500

fsck: avoid extra search paths

Arch's binaries are all in /usr/bin, so let's not bother searching in
duplicates of this directory.

commit 06fb38e846fd22a4daac5d129687d1c1e6c187fc
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Nov 20 08:26:56 2016 -0500

mkinitcpio: fixing quoting in call to initialize_buildroot

---

Summary of changes:
 functions| 7 +--
 install/fsck | 2 +-
 mkinitcpio   | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [mkinitcpio] [PATCH 1/1] fix variable name and correctly report broken dynamic linking

2016-11-20 Thread Dave Reisner
On Sun, Nov 20, 2016 at 01:07:11AM +0100, Christian Hesse wrote:
> From: Christian Hesse 
> 
> With broken dynamic linking an error was reported, but mkinitcpio still
> exited with:
> 
> ==> Image generation successful
> 
> and return code 0. This fixes the variable name, which makes mkinitcpio
> exit with the correct warning:
> 
> ==> WARNING: errors were encountered during the build. The image may not
> be complete.
> 
> and return code 1, indicating an error.
> 
> Signed-off-by: Christian Hesse 
> ---

Thanks! I already have this pending in my local checkout, though.

>  functions | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/functions b/functions
> index 7785347..14235b2 100644
> --- a/functions
> +++ b/functions
> @@ -590,7 +590,7 @@ add_binary() {
>  sodep=${BASH_REMATCH[1]}
>  elif [[ $line = *'not found' ]]; then
>  error "binary dependency \`%s' not found for \`%s'" "${line%% 
> *}" "$1"
> -(( ++builderrors ))
> +(( ++_builderrors ))
>  continue
>  fi
>  
> -- 
> 2.10.2


Re: [arch-projects] [mkinitcpio] [PATCH] sd-vconsole: Reenable systemd-vconsole-setup.service

2016-11-19 Thread Dave Reisner
On Sat, Nov 19, 2016 at 11:13:10PM +0100, Jan Alexander Steffens (heftig) via 
arch-projects wrote:
> systemd v232 dropped the Wants and nothing activates the service
> anymore. The binary is still activated via udev, but that doesn't seem
> to get triggered properly, possibly because the i915 module is loaded
> via modules-load or it replaces the uefi fb.
> 
> BTW, without any means of activation, the service unit as shipped by
> upstream is useless. We'll see whether they remove it completely.

8125e8d38e3a claims that this should all "just work", but you're
suggesting it isn't. Maybe we need to inquire upstream about the
behavior?

> ---
>  install/sd-vconsole | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/install/sd-vconsole b/install/sd-vconsole
> index 93cbbcd0c1a9f74f..e5423df742c80ad8 100644
> --- a/install/sd-vconsole
> +++ b/install/sd-vconsole
> @@ -57,6 +57,10 @@ build() {
>  fi
>  )
>  
> +# Needed since v232
> +add_symlink 
> "/usr/lib/systemd/system/sysinit.target.wants/systemd-vconsole-setup.service" 
> \
> +"../systemd-vconsole-setup.service"
> +
>  # Set up the console only after any manually loaded GPU drivers (e.g. 
> i915)
>  add_systemd_drop_in systemd-vconsole-setup.service after-modules <  [Unit]
> -- 
> 2.10.2


Re: [arch-projects] [netctl][PATCH 3/3] Additional granularity in `netctl list`

2016-09-28 Thread Dave Reisner
On Sep 28, 2016 6:07 AM, "Jouke Witteveen via arch-projects" <
arch-projects@archlinux.org> wrote:

Distinguish between started profiles and online profiles in the output
of the list subcommand of netctl.
To be consistent in symbol usage, the wifi-menu flags have changed too.
---
 docs/netctl.1.txt |  4 ++--
 src/netctl.in | 10 ++
 src/wifi-menu |  4 ++--
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/docs/netctl.1.txt b/docs/netctl.1.txt
index 0f63de4..d6d9360 100644
--- a/docs/netctl.1.txt
+++ b/docs/netctl.1.txt
@@ -24,8 +24,8 @@ OPTIONS
 The following commands are understood:

 *list*::
-List all available profiles. Active profiles will be marked with a
-`*'.
+List all available profiles. Online profiles will be marked with a
+`', otherwise active profiles will be marked with a `'.

 *store*::
 Saves which profiles are currently active.
diff --git a/src/netctl.in b/src/netctl.in
index fcb40f4..305c700 100644
--- a/src/netctl.in
+++ b/src/netctl.in
@@ -29,11 +29,13 @@ END
 }

 list() {
-local indicators=( '*' ' ' )
+local indicators=( ' ' '+' '*' ) i=0
 list_profiles | while read -r Profile; do
-sd_call "is-active --quiet" "$Profile" &> /dev/null
-# Make the return value boolean
-printf '%s %s\n' "${indicators[!! $?]}" "$Profile"
+if sd_call "is-active --quiet" "$Profile" &> /dev/null; then
+[[ $(sd_status_text "$Profile") == "online" ]]
+(( i = 2 - $? ))


i needs to be reset for each loop iteration or else you'll get a
stale/wrong value for an inactive profile following an active one.

+fi
+printf '%s %s\n' "${indicators[i]}" "$Profile"
 done
 }

diff --git a/src/wifi-menu b/src/wifi-menu
index 0b18574..de2110b 100755
--- a/src/wifi-menu
+++ b/src/wifi-menu
@@ -73,7 +73,7 @@ init_entries()
 if in_array "$(ssid_to_profile "$ssid")" "${GENERATED[@]}";
then
 ENTRIES[i]="."  # Automatically generated
 else
-ENTRIES[i]="+"  # Handmade
+ENTRIES[i]=":"  # Handmade
 fi
 else
 ENTRIES[i]=" "  # Not present
@@ -272,7 +272,7 @@ if (( RETURN == 0 )); then
 MSG="Select the network you wish to use
 Flags description:
  * - active connection present
- + - handmade profile present
+ : - handmade profile present
  . - automatically generated profile present"
 CHOICE=$(dialog --column-separator : --menu "$MSG" 24 50 12 \
  "${ENTRIES[@]}" --stdout)
--
2.10.0


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository annotated tag v21 created. v21

2016-09-09 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The annotated tag, v21 has been created
at  c0d4b294cdd0c712253042798bd5a18d0d8c6d71 (tag)
   tagging  757b511d71901a445f300f14ce8e54804d54724d (commit)
  replaces  v20
 tagged by  Dave Reisner
on  Fri Sep 9 08:42:43 2016 -0400

- Log -
tag as v21
-BEGIN PGP SIGNATURE-

iQE0BAABCAAeBQJX0q5DFxxkcmVpc25lckBhcmNobGludXgub3JnAAoJEB6yY4/1
bAxTrpoH/jLI/BZqp0st0pL6mtSjp3WswR3XJDyBxVQnlTGhgPj+1n1mUFZKk7SS
zmtu2Rj56kA+w7Jhear5LCb4N592+f7kVHw6/6U7GlDIBfRvT+z3u1uZAi3PmjeP
IkzrlTpmpyj1Ks95qMDb2fXwFgfflAX/6Mpcpr2ph30USEArkzDuvOaZdGKTx2yo
un08+aopz816GA57RIs6QWPT6jBo32QtK+Oh9VZj9E3AJePlsjTGTXBqKlVq2Y5O
Our4wAx9JNEhM4Oza15YjcZxZun366bQ6cSXsDZtLzTX7QEuCvz3fTf5lZjwfT8I
cYCuPvQspxM66jivn3dV0iFTbhLq7rY=
=Jz8K
-END PGP SIGNATURE-----

Dave Reisner (9):
  add test harness for parse_cmdline
  refactor parse_cmdline into something more readable
  use an associative array to build bsdcpio options
  Support version extraction from i[3456]86 kernels
  keyboard: add input/serio as part of checked modules
  mkinitcpio(8): document rootflags= and rootfstype=
  keyboard: fix add_checked_modules call with multiple params
  keyboard: placate foutrelis' OCD
  keyboard: get rid of an extra 'grep' call

Jan Alexander Steffens (heftig) (1):
  sd-vconsole: Wait for modules to be loaded

---


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v20-10-g757b511

2016-09-09 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  757b511d71901a445f300f14ce8e54804d54724d (commit)
  from  1288935e3a77321fabee153346730ed4f8e46f16 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 757b511d71901a445f300f14ce8e54804d54724d
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Sep 9 08:41:18 2016 -0400

keyboard: get rid of an extra 'grep' call

It's been too long and I've forgotten how to hack on mkinitcpio...

---

Summary of changes:
 install/keyboard | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v20-8-g8d548d7

2016-09-09 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  8d548d775031a4825832291d2b15a9c8948e58d1 (commit)
  from  2e79b928b9a87823dcaa4e0b073478b0bb03a223 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 8d548d775031a4825832291d2b15a9c8948e58d1
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Sep 9 08:37:39 2016 -0400

keyboard: fix add_checked_modules call with multiple params

---

Summary of changes:
 install/keyboard | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v20-9-g1288935

2016-09-09 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  1288935e3a77321fabee153346730ed4f8e46f16 (commit)
  from  8d548d775031a4825832291d2b15a9c8948e58d1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 1288935e3a77321fabee153346730ed4f8e46f16
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Sep 9 08:38:27 2016 -0400

keyboard: placate foutrelis' OCD

...and mine too, now that he points it out.

---

Summary of changes:
 install/keyboard | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v20-7-g2e79b92

2016-09-09 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  2e79b928b9a87823dcaa4e0b073478b0bb03a223 (commit)
   via  dfb71b073746999553c1f3bd21534ccf9018f4c9 (commit)
   via  c7f2725e01a93c81025fa9fcee4fbbb8c5b01fd6 (commit)
  from  8423083e79dc78cccfbf6b461d51e72faf7a586f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 2e79b928b9a87823dcaa4e0b073478b0bb03a223
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Sep 9 08:23:01 2016 -0400

mkinitcpio(8): document rootflags= and rootfstype=

These were curiously omitted from the documentation.

ref: https://bugs.archlinux.org/task/50470

commit dfb71b073746999553c1f3bd21534ccf9018f4c9
Author: Jan Alexander Steffens (heftig) <jan.steff...@gmail.com>
Date:   Fri Sep 9 00:51:06 2016 +0200

sd-vconsole: Wait for modules to be loaded

If the MODULES contain a GPU driver like i915, wait for it
to be loaded. This avoids the font configuration being lost.

commit c7f2725e01a93c81025fa9fcee4fbbb8c5b01fd6
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Fri Sep 9 08:11:54 2016 -0400

keyboard: add input/serio as part of checked modules

ref: https://bugs.archlinux.org/task/50700

---

Summary of changes:
 install/keyboard |  2 +-
 install/sd-vconsole  |  6 ++
 man/mkinitcpio.8.txt | 11 ++-
 3 files changed, 17 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v20-4-g8423083

2016-07-29 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  8423083e79dc78cccfbf6b461d51e72faf7a586f (commit)
   via  f5129add0eb16c9511c9cb80433fb4568f1e2703 (commit)
  from  b9308a5296fc0dc8da78cd6f02a5af9c38f0a044 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 8423083e79dc78cccfbf6b461d51e72faf7a586f
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Thu Jul 14 15:57:47 2016 -0400

Support version extraction from i[3456]86 kernels

Arch might not really support some of these, but mkinitcpio can.

commit f5129add0eb16c9511c9cb80433fb4568f1e2703
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Mon Jul 11 22:05:45 2016 -0400

use an associative array to build bsdcpio options

This prevents having unquoted expansion in the bsdcpio commandline

---

Summary of changes:
 lsinitcpio | 37 ++---
 mkinitcpio |  4 ++--
 2 files changed, 28 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v20-2-gb9308a5

2016-07-11 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  b9308a5296fc0dc8da78cd6f02a5af9c38f0a044 (commit)
   via  a089c8622708d5249aa7830590464fb29dc799a4 (commit)
  from  d73d34e017ecb0e89c2de8e39da6b14afd6c5f1c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit b9308a5296fc0dc8da78cd6f02a5af9c38f0a044
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Wed Jul 6 07:22:16 2016 -0400

refactor parse_cmdline into something more readable

This refactors parse_cmdline into a few chunks of code, mainly to
separate the work of parsing from the handling of the actual parsed
parameters. By default, parse_cmdline_item is used as the callback for
handling the parameters, but this could be overriden by other code
sourcing init_functions if desirable.

Our test harness passes more tests, but we leave behind some expected
failures to describe the cases where it still fails. Fortunately I've
not yet been able to find any cases which warrant --expect-parse-fail.

commit a089c8622708d5249aa7830590464fb29dc799a4
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Wed Jul 6 07:05:51 2016 -0400

add test harness for parse_cmdline

Some of these tests currently fail including hard failures where the
shell quits entirely (this would lead to a kernel panic). A followup
commit will rewrite the parse_cmdline function to improve it and fix
these deficiencies.

---

Summary of changes:
 Makefile|   3 +
 init_functions  | 175 
 test/test_parse_cmdline | 233 
 3 files changed, 353 insertions(+), 58 deletions(-)
 create mode 100755 test/test_parse_cmdline


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio][PATCH 2/2] refactor parse_cmdline into something more readable

2016-07-07 Thread Dave Reisner
This refactors parse_cmdline into a few chunks of code, mainly to
separate the work of parsing from the handling of the actual parsed
parameters. By default, parse_cmdline_item is used as the callback for
handling the parameters, but this could be overriden by other code
sourcing init_functions if desirable.

Our test harness passes more tests, but we leave behind some expected
failures to describe the cases where it still fails. Fortunately I've
not yet been able to find any cases which warrant --expect-parse-fail.
---
 init_functions  | 175 
 test/test_parse_cmdline |  16 ++---
 2 files changed, 125 insertions(+), 66 deletions(-)

diff --git a/init_functions b/init_functions
index 05f4ab0..d5a584e 100644
--- a/init_functions
+++ b/init_functions
@@ -114,74 +114,133 @@ set_log_option() {
 done
 }
 
-parse_cmdline() {
-local _w _quoted _lhs _rhs _cmdline
-read -r _cmdline
-for _w in $_cmdline; do
-if [ -z "$_quoted" ]; then
-case $_w in
-# ignore everything after a # in the commandline
-\#*) break ;;
-# special cases
-rw|ro) rwopt=$_w ;;
-fstype) rootfstype=$_w ;;
-fsck.mode=*)
-case ${_w#*=} in
-force)
-forcefsck=y
-;;
-skip)
-fastboot=y
-;;
-*)
-err "unknown fsck.mode parameter: '${_w#*=}'"
-;;
-esac
+startswith() {
+local word=$1 prefix=$2
+
+case $word in
+$prefix*)
+return 0
+;;
+esac
+
+return 1
+}
+
+endswith() {
+local word=$1 suffix=$2
+
+case $word in
+*$suffix)
+return 0
+;;
+esac
+
+return 1
+}
+
+parse_cmdline_item() {
+local key=$1 value=$2
+
+case $key in
+rw|ro)
+rwopt=$key
+;;
+fstype)
+# The kernel understands 'rootfstype', but mkinitcpio has (without
+# documentation) supported 'fstype' instead. Ensure we support both
+# for backwards compat, but make fstype legacy.
+rootfstype=$value
+;;
+fsck.mode)
+case $value in
+force)
+forcefsck=y
 ;;
-rd.*)
-case ${_w#rd.} in
-debug)
-rd_debug=y
-;;
-log)
-rd_logmask=$(( _rdlog_kmsg | _rdlog_cons ))
-;;
-log=*)
-set_log_option "${_w#rd.log=}"
-;;
-esac
+skip)
+fastboot=y
 ;;
-# abide by shell variable naming rules
-[[:alpha:]_]*=*)
-_rhs=${_w#*=}
-_lhs=${_w%%=*}
-_lhs=${_lhs//[-.]/_}
-if [ '"' = "${_rhs:0:1}" ]; then
-if [ '"' = "${_rhs:$((${#_rhs}-1))}" ]; then
-_rhs="${_rhs:1:$((${#_rhs}-2))}"
-else
-_rhs=${_rhs:1}
-_quoted=1
-continue
-fi
+*)
+err "unknown fsck.mode parameter: '$value'"
+;;
+esac
+;;
+rd.debug)
+rd_debug=y
+;;
+rd.log)
+if [ -n "$value" ]; then
+set_log_option "$value"
+else
+rd_logmask=$(( _rdlog_kmsg | _rdlog_cons ))
+fi
+;;
+[![:alpha:]_]*|[[:alpha:]_]*[![:alnum:]_]*)
+# invalid shell variable, ignore it
+;;
+*)
+# valid shell variable
+eval "$key"='${value:-y}'
+;;
+esac
+}
+
+process_cmdline_param() {
+local item_callback=$1 key=$2 value=$3
+
+# maybe unquote the value
+if startswith "$value" "[\"']" && endswith "$value" "${value:0:1}"; then
+value=${value#?} value=${value%?}
+fi
+
+"$item_callback" "$key" "$value"
+}
+
+parse_cmdline() {
+local item_callback=${1:-parse_cmdline_item}
+local cmdline word quoted key value
+
+set -f
+read -r cmdline
+set -- $cmdline
+set +f
+
+for word; do
+if [ -n "$quoted" ]; then
+value="$value $word"
+else
+case $word in
+*=*)
+key=${word%%=*}
+value=${word#*=}
+
+if 

[arch-projects] [mkinitcpio][PATCH 1/2] add test harness for parse_cmdline

2016-07-07 Thread Dave Reisner
Some of these tests currently fail including hard failures where the
shell quits entirely (this would lead to a kernel panic). A followup
commit will rewrite the parse_cmdline function to improve it and fix
these deficiencies.
---
 Makefile|   3 +
 test/test_parse_cmdline | 233 
 2 files changed, 236 insertions(+)
 create mode 100755 test/test_parse_cmdline

diff --git a/Makefile b/Makefile
index 5af0eb2..6c70718 100644
--- a/Makefile
+++ b/Makefile
@@ -74,6 +74,9 @@ man/%: man/%.txt Makefile
-a manversion=$(VERSION) \
-a manmanual="mkinitcpio manual" $<
 
+check:
+   @r=0; for t in test/test_*; do $$t || { echo $$t fail; r=1; }; done; 
exit $$r
+
 clean:
$(RM) mkinitcpio-${VERSION}.tar.gz $(MANPAGES)
 
diff --git a/test/test_parse_cmdline b/test/test_parse_cmdline
new file mode 100755
index 000..9afd9cb
--- /dev/null
+++ b/test/test_parse_cmdline
@@ -0,0 +1,233 @@
+#!/lib/initcpio/busybox ash
+
+. ./init_functions
+
+failed=0
+tests=0
+
+e_ok=0
+e_parser_failure=2
+e_assertion_failure=130
+
+assert() {
+  local expect_fail= key= expected_value= actual_value
+
+  if [ "$1" = '--expect-fail' ]; then
+expect_fail=y
+shift
+  fi
+
+  key=$1 expected_value=$2
+  eval actual_value=\$"$1"
+
+  case $actual_value in
+$expected_value)
+  if [ -n "$expect_fail" ]; then
+echo "EXPECTED FAIL: $key: expected='$expected_value', 
got='$actual_value'"
+return 1
+  fi
+  ;;
+*)
+  if [ -z "$expect_fail" ]; then
+echo "FAIL: $key: expected='$expected_value', got='$actual_value'"
+return 1
+  fi
+  ;;
+  esac
+
+  return 0
+}
+
+test_parse() {
+  local flag= cmdline= expect_fail= expect_parse_fail=
+
+  tests=$(( tests + 1 ))
+
+  for flag; do
+case $flag in
+  --expect-fail)
+expect_fail='--expect-fail'
+shift
+;;
+  --expect-parse-fail)
+expect_parse_fail=y
+shift
+;;
+  *)
+break
+;;
+esac
+  done
+
+  cmdline=$1; shift
+  [ -n "$V" ] && echo "testing cmdline: $cmdline"
+
+  echo "$cmdline" | {
+parse_cmdline
+
+result=0
+while [ "$#" -gt 0 ]; do
+  key=$1 expected_value=$2
+  shift 2
+
+  assert $expect_fail "$key" "$expected_value" || 
result=$e_assertion_failure
+done
+
+exit "$result"
+  } 2>/dev/null
+
+  case $? in
+$e_parser_failure)
+  # parser failure
+  if [ -z "$expect_parse_fail" ]; then
+echo "FAIL: parse_cmdline failed"
+failed=$(( failed + 1 ))
+  fi
+  ;;
+$e_assertion_failure)
+  # test assertion failure
+  failed=$(( failed + 1 ))
+  ;;
+$e_ok)
+  if [ -n "$expect_parse_fail" ]; then
+echo "EXPECTED_FAIL: parse_cmdline succeeded"
+failed=$(( failed + 1 ))
+  fi
+  ;;
+  esac
+}
+
+# bare words
+test_parse 'foo' \
+  'foo' 'y'
+test_parse 'foo bar' \
+  'foo' 'y' \
+  'bar' 'y'
+
+# overwriting
+test_parse 'foo=bar bar=baz foo bar="no pe"' \
+  'bar' 'no pe' \
+  'foo' 'y'
+
+# simple key=value assignment
+test_parse 'foo=bar' \
+  'foo' 'bar'
+test_parse 'foo=bar bar=baz' \
+  'foo' 'bar' \
+  'bar' 'baz'
+test_parse '_derpy=hooves' \
+  '_derpy' 'hooves'
+test_parse 'f5=abc f_5_=abc' \
+  'f5' 'abc' \
+  'f_5_' 'abc'
+test_parse 'v="foo bar=baz"' \
+  'v' 'foo bar=baz'
+
+# double quoting
+test_parse 'foo="bar"' \
+  'foo' 'bar'
+test_parse 'foo="bar baz"' \
+  'foo' 'bar baz'
+
+# single quoting
+test_parse --expect-fail "foo='bar'" \
+  'foo' 'bar'
+test_parse --expect-parse-fail "foo='bar baz'" \
+  'foo' 'bar baz'
+
+# dangling quotes
+test_parse --expect-fail 'foo="bar' \
+  'foo' '"bar'
+test_parse 'foo=bar"' \
+  'foo' 'bar"'
+
+# nested quotes
+test_parse --expect-parse-fail "foo='\"bar baz\"' herp='\"de\"rp'" \
+  'foo' '"bar baz"' \
+  'herp' '"de"rp'
+
+# escaped quotes
+test_parse 'foo=bar"baz' \
+  'foo' 'bar"baz'
+
+# neighboring quoted regions
+test_parse --expect-fail 'foo="bar""baz"' \
+  'foo' 'barbaz'
+test_parse --expect-fail "foo=\"bar\"'baz'" \
+  'foo' "barbaz"
+test_parse --expect-fail "foo='bar'\"baz\"" \
+  'foo' "barbaz"
+
+# comments
+test_parse 'foo=bar # ignored content' \
+  'foo' 'bar' \
+  'ignored' '' \
+  'content' ''
+test_parse 'foo=bar #ignored content' \
+  'foo' 'bar' \
+  'ignored' '' \
+  'content' ''
+test_parse 'foo="bar #baz" parse=this' \
+  'foo' 'bar #baz' \
+  'parse' 'this'
+
+# shell metachars
+test_parse 'foo=*' \
+  'foo' '\*'
+test_parse --expect-fail 'Make*' \
+  'Makefile' ''
+test_parse --expect-fail '[Makefile]*' \
+  'Makefile' '' \
+  'init' '' \
+  'functions' ''
+
+# invalid names
+test_parse 'in-valid=name'
+test_parse '6foo=bar'
+test_parse --expect-parse-fail '"gar bage"' \
+  'gar' '' \
+  'bage' ''
+
+# special handling
+test_parse 'rw' \
+  'ro' '' \
+  'rw' '' \
+  'rwopt' 'rw'
+test_parse 'ro' \
+  'ro' '' \
+  'rw' '' \
+  'rwopt' 'ro'
+test_parse 

[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository annotated tag v20 created. v20

2016-07-03 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The annotated tag, v20 has been created
at  19d255722ca6e3eb3ad440d5b59baed613ab4f9e (tag)
   tagging  d73d34e017ecb0e89c2de8e39da6b14afd6c5f1c (commit)
  replaces  v19
 tagged by  Dave Reisner
on  Sun Jul 3 14:15:25 2016 -0400

- Log -
tag as v20
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQE0BAABCAAeBQJXeVY9FxxkcmVpc25lckBhcmNobGludXgub3JnAAoJEB6yY4/1
bAxTroQIAJfsmegBTgwfrxyGqYuv1Gl+p7lfSjSjAr/vjgbAyuOpO1JJbUnHboCJ
S92mO4w7p1FVbk6+nWR/Rp1CkwiYS4tup6JBYErwexdlT1qg6RIV+1FtO9WZd2JW
0Hctag4AgejErrfS7uTuHlVLE7/tCwbNFO13ZLQY4R62YFXVlXZapTF2b0VvHLrD
//DW4anaXLTfRkus3ORNSryDnMAK2T1sQ6HmpKkdUKlgBIJ3jh8lYtgRColD/HQ6
wKghqetYOQOQuy0CyFjWoJ72gsFt/oxZUIV3Vel3bvrTyDefUXBPm7C/WfrymBnD
GuMbEdV2+hOfF06sX2wfhSKkepiL7uw=
=UKJN
-END PGP SIGNATURE-----

Dave Reisner (6):
  Handle softdeps in modules
  handle the case of modinfo returning multiple modules
  add f2fs quirk for libcrc32c
  keymap: fall back to us if KEYMAP is not defined
  init: handle rootfstype as a synonym for fstype
  error out if asked to extract a kver from image on non-x86

---


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v19-6-gd73d34e

2016-07-03 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  d73d34e017ecb0e89c2de8e39da6b14afd6c5f1c (commit)
   via  14487ea9a6104c17b00c6fa7bcb65c617c7490c8 (commit)
   via  89bf8b56137196907b25e9d131e82dec90edaff0 (commit)
  from  08762d8401ff8e01a3c7a1558e69d5c30c983d20 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit d73d34e017ecb0e89c2de8e39da6b14afd6c5f1c
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sat Jul 2 15:18:11 2016 -0400

error out if asked to extract a kver from image on non-x86

Version extraction only works on x86 (i686 and x86_64) kernels.

ref: https://bugs.archlinux.org/task/43256

commit 14487ea9a6104c17b00c6fa7bcb65c617c7490c8
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sat Jul 2 11:06:50 2016 -0400

init: handle rootfstype as a synonym for fstype

rootfstype is handled by the kernel, so we should handle it, too.

ref: https://bugs.archlinux.org/task/45117

commit 89bf8b56137196907b25e9d131e82dec90edaff0
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sat Jul 2 11:02:24 2016 -0400

keymap: fall back to us if KEYMAP is not defined

ref: https://bugs.archlinux.org/task/44805

---

Summary of changes:
 init_functions   |  3 ++-
 install/keymap   | 13 -
 man/mkinitcpio.8.txt |  5 +++--
 mkinitcpio   |  8 +++-
 4 files changed, 16 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio][PATCH 2/2] init: handle rootfstype as a synonym for fstype

2016-07-02 Thread Dave Reisner
rootfstype is handled by the kernel, so we should handle it, too.

ref: https://bugs.archlinux.org/task/45117
---
 init_functions | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/init_functions b/init_functions
index 11ce3ca..05f4ab0 100644
--- a/init_functions
+++ b/init_functions
@@ -124,6 +124,7 @@ parse_cmdline() {
 \#*) break ;;
 # special cases
 rw|ro) rwopt=$_w ;;
+fstype) rootfstype=$_w ;;
 fsck.mode=*)
 case ${_w#*=} in
 force)
@@ -323,7 +324,7 @@ default_mount_handler() {
 fi
 
 msg ":: mounting '$root' on real root"
-if ! mount ${fstype:+-t $fstype} -o ${rwopt:-ro}${rootflags:+,$rootflags} 
"$root" "$1"; then
+if ! mount ${rootfstype:+-t $rootfstype} -o 
${rwopt:-ro}${rootflags:+,$rootflags} "$root" "$1"; then
 echo "You are now being dropped into an emergency shell."
 launch_interactive_shell
 msg "Trying to continue (this will most likely fail) ..."
-- 
2.8.3


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v19-3-g08762d8

2016-06-30 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official mkinitcpio repository".

The branch, master has been updated
   via  08762d8401ff8e01a3c7a1558e69d5c30c983d20 (commit)
   via  73189f9515cc40015381a24731205c493107f04f (commit)
   via  97ac4d37aae084a050be512f6d8f4489054668ad (commit)
  from  730bf42e4ce461c654598effcc04b7bde4367de7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 08762d8401ff8e01a3c7a1558e69d5c30c983d20
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Jun 26 12:41:09 2016 -0400

add f2fs quirk for libcrc32c

ref: https://bugs.archlinux.org/task/49380

commit 73189f9515cc40015381a24731205c493107f04f
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Jun 26 12:28:39 2016 -0400

handle the case of modinfo returning multiple modules

This is true of more and more modules with the advent of aliases, e.g.

  $ modinfo -F filename crc32c
  /lib/modules/4.6.2-rampage/kernel/arch/x86/crypto/crc32c-intel.ko.gz
  /lib/modules/4.6.2-rampage/kernel/crypto/crc32c_generic.ko.gz

commit 97ac4d37aae084a050be512f6d8f4489054668ad
Author: Dave Reisner <dreis...@archlinux.org>
Date:   Sun Jun 26 09:26:03 2016 -0400

Handle softdeps in modules

modinfo outputs softdeps which we can add if they exist (failing
quietly on not-found). this obviates the need for some of our own
module quirks.

The output of modinfo can take many forms, as it's nearly freeform text
in the  .modinfo section of the kernel module. The basic form is:

  softdep:pre: foo

But it might also be:

  softdep:pre: foo bar post: baz

Or:

  softdep:pre: foo
  softdep:post: bar

So just parse the entire line, discarding anything that ends with a ':'.

---

Summary of changes:
 functions | 43 ---
 1 file changed, 24 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio][PATCH 1/3] Handle softdeps in modules

2016-06-27 Thread Dave Reisner
modinfo outputs softdeps which we can add if they exist (failing
quietly on not-found). this obviates the need for some of our own
module quirks.

The output of modinfo can take many forms, as it's nearly freeform text
in the  .modinfo section of the kernel module. The basic form is:

  softdep:pre: foo

But it might also be:

  softdep:pre: foo bar post: baz

Or:

  softdep:pre: foo
  softdep:post: bar

So just parse the entire line, discarding anything that ends with a ':'.
---
 functions | 17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/functions b/functions
index 362d07b..500dcc0 100644
--- a/functions
+++ b/functions
@@ -348,7 +348,7 @@ add_module() {
 # discovered and added.
 #   $1: module name
 
-local module= path= deps= field= value= firmware=()
+local module= path= softdeps= deps= field= value= firmware=()
 local ign_errors=0
 
 [[ $KERNELVERSION == none ]] && return 0
@@ -375,6 +375,14 @@ add_module() {
 firmware)
 firmware+=("$value")
 ;;
+softdep)
+read -ra softdeps <<<"$value"
+for module in "${softdeps[@]}"; do
+[[ $module == *: ]] && continue
+add_module "$module"
+done
+add_module "$softdep?"
+;;
 esac
 done < <(modinfo -b "$_optmoduleroot" -k "$KERNELVERSION" -0 "$module" 
2>/dev/null)
 
@@ -403,9 +411,8 @@ add_module() {
 ocfs2)
 add_module "configfs?"
 ;;
-btrfs|libcrc32c)
-add_module "crc32c_intel?"
-add_module "crc32c?"
+btrfs)
+add_module "libcrc32c?"
 ;;
 esac
 }
@@ -780,7 +787,7 @@ install_modules() {
 depmod -b "$BUILDROOT" "$KERNELVERSION"
 
 # remove all non-binary module.* files (except devname for on-demand 
module loading)
-rm "$moduledest"/modules.!(*.bin|devname)
+rm "$moduledest"/modules.!(*.bin|devname|softdep)
 }
 
 # vim: set ft=sh ts=4 sw=4 et:
-- 
2.8.3


[arch-projects] [mkinitcpio][PATCH 3/3] add f2fs quirk for libcrc32c

2016-06-27 Thread Dave Reisner
ref: https://bugs.archlinux.org/task/49380
---
 functions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functions b/functions
index bdba988..9260920 100644
--- a/functions
+++ b/functions
@@ -410,7 +410,7 @@ add_module() {
 ocfs2)
 add_module "configfs?"
 ;;
-btrfs)
+btrfs|f2fs)
 add_module "libcrc32c?"
 ;;
 esac
-- 
2.8.3


Re: [arch-projects] [DEVTOOLS][PATCH 2/3] archbuild: install packages in one call to pacman

2015-08-14 Thread Dave Reisner
On Thu, Aug 13, 2015 at 10:56:41PM +0200, se...@archlinux.org wrote:
 From: Sébastien Luttringer se...@seblu.net
 
 In order to install/downgrade packages with dependencies (e.g gcc-multilib),
 pass all packages to install in a row to pacman.
 
 As a side improvement, when a package installation fails, build fails.
 ---
  makechrootpkg.in | 30 ++
  1 file changed, 18 insertions(+), 12 deletions(-)
 
 diff --git a/makechrootpkg.in b/makechrootpkg.in
 index 3c8a20f..447157d 100644
 --- a/makechrootpkg.in
 +++ b/makechrootpkg.in
 @@ -126,23 +126,26 @@ clean_temporary() {
   stat_done
  }
  
 +# install packages in one call to pacman to let it manage correctly
 +# dependencies between packages
  install_packages() {
 - local pkgname
 + (( ${#install_pkgs[*]} == 0 ))  return 0
  
 - for install_pkg in ${install_pkgs[@]}; do
 - pkgname=${install_pkg##*/}
 - cp $install_pkg $copydir/$pkgname
 + local src dst
 + local -a dsts

These aren't destinations, they're packages. Please call the variable
as such.

  
 - arch-nspawn $copydir \
 - ${bindmounts_ro[@]} ${bindmounts_rw[@]} \
 - pacman -U /$pkgname --noconfirm
 - (( ret += !! $? ))
 -
 - rm $copydir/$pkgname
 + for src in ${install_pkgs[@]}; do
 + dst=/${src##*/}
 + dsts+=($dst)
 + cp $src $copydir$dst
   done
  
 - # If there is no PKGBUILD we are done
 - [[ -f PKGBUILD ]] || exit $ret
 + arch-nspawn $copydir ${bindmounts_ro[@]} ${bindmounts_rw[@]} \
 + pacman -U ${dsts[@]} --noconfirm || exit $?

exit $? is redundant, you only need 'exit'. Better still, use 'die' with
an appropriate error message?

 +
 + for dst in ${dsts[@]}; do
 + rm $copydir$dst
 + done

rm ${dsts[@]}

  }
  
  prepare_chroot() {
 @@ -384,6 +387,9 @@ $update_first  arch-nspawn $copydir \
  
  [[ -n ${install_pkgs[*]} ]]  install_packages
  
 +# If there is no PKGBUILD we are done
 +[[ -f PKGBUILD ]] || exit 0
 +

Seems like an unrelated change... And, shouldn't lack of a PKGBUILD be a
failure?

  download_sources
  
  prepare_chroot
 -- 
 Sébastien Seblu Luttringer


Re: [arch-projects] [DEVTOOLS][PATCH 1/3] archbuild: build without updating the chroot

2015-08-14 Thread Dave Reisner
On Thu, Aug 13, 2015 at 10:56:40PM +0200, se...@archlinux.org wrote:
 From: Sébastien Luttringer se...@seblu.net
 
 Useful when you need to build with an outdated package version

Why wouldn't you just call makechrootpkg directly?

 ---
  archbuild.in  | 5 -
  zsh_completion.in | 1 +
  2 files changed, 5 insertions(+), 1 deletion(-)
 
 diff --git a/archbuild.in b/archbuild.in
 index 9c5d706..7d8d2a9 100644
 --- a/archbuild.in
 +++ b/archbuild.in
 @@ -17,11 +17,13 @@ else
  fi
  chroots='/var/lib/archbuild'
  clean_first=false
 +update=true
  
  usage() {
   echo Usage: $cmd [options] -- [makechrootpkg args]
   echo '-h This help'
   echo '-c Recreate the chroot before building'
 + echo '-u Do not update the chroot before before building'
   echo '-r dir   Create chroots in this directory'
   echo ''
   echo Default makechrootpkg args: ${makechrootpkg_args[*]}
 @@ -34,6 +36,7 @@ orig_argv=($@)
  while getopts 'hcr:' arg; do
   case ${arg} in
   c) clean_first=true ;;
 + u) update=false ;;
   r) chroots=$OPTARG ;;
   *) usage ;;
   esac
 @@ -67,7 +70,7 @@ if ${clean_first} || [[ ! -d ${chroots}/${repo}-${arch} 
 ]]; then
   -M @pkgdatadir@/makepkg-${arch}.conf \
   ${chroots}/${repo}-${arch}/root \
   ${base_packages[@]} || abort
 -else
 +elif $update; then
   lock 9 ${chroots}/${repo}-${arch}/root.lock Locking clean chroot
   arch-nspawn \
   -C @pkgdatadir@/pacman-${repo}.conf \
 diff --git a/zsh_completion.in b/zsh_completion.in
 index 4c6dd99..8c418ea 100644
 --- a/zsh_completion.in
 +++ b/zsh_completion.in
 @@ -4,6 +4,7 @@ m4_include(lib/valid-tags.sh)
  
  _archbuild_args=(
   '-c[Recreate the chroot before building]'
 + '-u[Do not update the chroot before before building]'
   '-r[Create chroots in this directory]:base_dir:_files -/'
  )
  
 -- 
 Sébastien Seblu Luttringer


Re: [arch-projects] [DEVTOOLS][PATCH 3/3] Add sudo config

2015-08-14 Thread Dave Reisner
On Thu, Aug 13, 2015 at 10:56:42PM +0200, se...@archlinux.org wrote:
 From: Sébastien Luttringer se...@seblu.net
 
 This add sudo config to allow member of devtools group to run build commands 
 as
 root without password
 ---
  Makefile |  3 +++
  sudoers  | 12 
  2 files changed, 15 insertions(+)
  create mode 100644 sudoers
 
 diff --git a/Makefile b/Makefile
 index dcdb522..d071602 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -95,6 +95,8 @@ install:
   for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools 
 $(DESTDIR)/usr/share/bash-completion/completions/$$l; done
   install -Dm0644 zsh_completion 
 $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
   ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
 + install -dm750 $(DESTDIR)/etc/sudoers.d

This is redundant with the line below...

 + install -Dm0644 sudoers $(DESTDIR)/etc/sudoers.d/50-devtools
  
  uninstall:
   for f in ${BINPROGS}; do rm -f $(DESTDIR)$(PREFIX)/bin/$$f; done
 @@ -106,6 +108,7 @@ uninstall:
   rm $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
   rm -f $(DESTDIR)$(PREFIX)/bin/communityco
   rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
 + rm -f $(DESTDIR)$/etc/sudoers.d/50-devtools
  
  dist:
   git archive --format=tar --prefix=devtools-$(V)/ $(V) | gzip -9  
 devtools-$(V).tar.gz
 diff --git a/sudoers b/sudoers
 new file mode 100644
 index 000..42508e4
 --- /dev/null
 +++ b/sudoers
 @@ -0,0 +1,12 @@
 +Cmnd_Alias DEVTOOLS = \
 + /usr/bin/makechrootpkg, \
 + /usr/bin/extra-i686-build, /usr/bin/extra-x86_64-build, 
 /usr/bin/extra-build, \
 + /usr/bin/testing-i686-build, /usr/bin/testing-x86_64-build, 
 /usr/bin/testing-build, \
 + /usr/bin/staging-i686-build, /usr/bin/staging-x86_64-build, 
 /usr/bin/staging-build, \
 + /usr/bin/multilib-build, /usr/bin/multilib-testing-build, 
 /usr/bin/multilib-staging-build, \
 + /usr/bin/kde-unstable-i686-build, /usr/bin/kde-unstable-x86_64-build, \
 + /usr/bin/gnome-unstable-i686-build, /usr/bin/gnome-unstable-x86_64-build

Where do binary names like 'extra-build' and 'testing-build' come from?
These aren't provided by devtools... We probably want this list
generated from the Makefile to keep it in sync with reality.

 +
 +Defaults!DEVTOOLS umask_override
 +
 +%devtools ALL=(root) NOPASSWD: DEVTOOLS
 -- 
 Sébastien Seblu Luttringer


Re: [arch-projects] [dbscripts] [PATCH 07/11] test/lib/common.inc: use `grep /dev/null` instead of `grep -q`.

2015-05-17 Thread Dave Reisner
On Sun, May 17, 2015 at 07:44:15PM -0400, Luke Shumaker wrote:
 `grep -q` may exit as soon as it finds a match; the program piped in to it
 might not be finished writing, and consequently print a message about a
 write error to stderr.
 
 I'll add that this is not purely hypothetical--it happened to me while
 testing.

The rationale doesn't make sense to me. If the program writing to the
input side of the pipe is the one throwing the error, why should piping
grep's output to /dev/null change this?

 ---
  test/lib/common.inc | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/test/lib/common.inc b/test/lib/common.inc
 index 5b06616..83c54bd 100644
 --- a/test/lib/common.inc
 +++ b/test/lib/common.inc
 @@ -177,7 +177,7 @@ checkAnyPackageDB() {
  
   for db in ${DBEXT} ${FILESEXT}; do
   ( [ -r 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} ] \
 -  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep -q ${pkg}) \
 +  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep ${pkg} 
 /dev/null) \
   || fail ${pkg} not in 
 ${repo}/os/${arch}/${repo}${db%.tar.*}
   done
   done
 @@ -221,7 +221,7 @@ checkPackageDB() {
  
   for db in ${DBEXT} ${FILESEXT}; do
   ( [ -r ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} ] \
 -  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep -q ${pkg}) \
 +  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep ${pkg} 
 /dev/null) \
   || fail ${pkg} not in 
 ${repo}/os/${arch}/${repo}${db%.tar.*}
   done
  }
 @@ -247,7 +247,7 @@ checkRemovedPackageDB() {
  
   for db in ${DBEXT} ${FILESEXT}; do
   ( [ -r ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} ] \
 -  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep -q 
 ${pkgbase}) \
 +  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep ${pkgbase} 
 /dev/null) \
fail ${pkgbase} should not be in 
 ${repo}/os/${arch}/${repo}${db%.tar.*}
   done
  }
 @@ -273,7 +273,7 @@ checkRemovedAnyPackageDB() {
   for db in ${DBEXT} ${FILESEXT}; do
   for arch in ${ARCH_BUILD[@]}; do
   ( [ -r 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} ] \
 -  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep -q 
 ${pkgbase}) \
 +  bsdtar -xf 
 ${FTP_BASE}/${repo}/os/${arch}/${repo}${db%.tar.*} -O | grep ${pkgbase} 
 /dev/null) \
fail ${pkgbase} should not be in 
 ${repo}/os/${arch}/${repo}${db%.tar.*}
   done
   done
 -- 
 2.4.1


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20141224-3-g8570536

2015-02-28 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The branch, master has been updated
   via  85705363cd05b79fc1a328260b199c9321a0f105 (commit)
  from  4a9ecdfe156f9887d88eb7ae026387f0e051a6a5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 85705363cd05b79fc1a328260b199c9321a0f105
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Feb 28 10:53:37 2015 -0500

prepare 20150228 release

---

Summary of changes:
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20141224-2-g4a9ecdf

2015-02-28 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The branch, master has been updated
   via  4a9ecdfe156f9887d88eb7ae026387f0e051a6a5 (commit)
   via  33fda4e8ffab293d2cbc6a8e8e9dd38f15817e5b (commit)
  from  db135e90137c5ebb9248ae7bd5ced4e8ee6b27da (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 4a9ecdfe156f9887d88eb7ae026387f0e051a6a5
Author: Christian Hesse m...@eworm.de
Date:   Sat Jan 17 00:06:24 2015 +0100

handle gnupg 2.1.x public keyring

commit 33fda4e8ffab293d2cbc6a8e8e9dd38f15817e5b
Author: Dave Reisner dreis...@archlinux.org
Date:   Sun Feb 15 15:20:26 2015 -0500

makechrootpkg: keep all function defs together

---

Summary of changes:
 makechrootpkg.in | 117 ---
 1 file changed, 59 insertions(+), 58 deletions(-)


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v18-5-g715a37b

2014-12-28 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  715a37b0d6cbee360c00ee2e23e94a772a50a1f0 (commit)
   via  9398ae7fcbc2af9c788089ba72ddcd610b8df3a9 (commit)
   via  514d5f1fa641b0bfc66d43f4c0c7e7830f747899 (commit)
  from  b209e8c5e965965c50878fb57a628bca83a06f8d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 715a37b0d6cbee360c00ee2e23e94a772a50a1f0
Author: Alexei Colin a...@alexeicolin.com
Date:   Sun Dec 28 16:51:30 2014 -0500

mkinitcpio: expose syntax errors in preset files

commit 9398ae7fcbc2af9c788089ba72ddcd610b8df3a9
Author: Dave Reisner dreis...@archlinux.org
Date:   Sun Dec 7 10:19:54 2014 -0500

lsinitcpio: avoid setting TIMEFORMAT globally

Not that it really matters, but let's scope this to where we actually
care for the modified time output.

commit 514d5f1fa641b0bfc66d43f4c0c7e7830f747899
Author: Dave Reisner dreis...@archlinux.org
Date:   Sun Dec 7 10:18:58 2014 -0500

mkinitcpio avoiding adding a CPIO entry for '.'

The archive goes from looking like this:

  .
  ./buildconfig
  ./config
  ./init
  ./init_functions
  ./VERSION
  ./lib64
  ./sbin

To:

  buildconfig
  config
  init
  init_functions
  VERSION
  lib64
  sbin

Note the lack of the root entry and leading ./. This fixes an issue
with packing ucode into the initramfs since the kernel really wants an
exact match, and not path equivalency.

---

Summary of changes:
 lsinitcpio | 2 +-
 mkinitcpio | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [devtools] [GIT] The official devtools repository annotated tag 20141224 created. 20141224

2014-12-24 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The annotated tag, 20141224 has been created
at  12e12d9ff6efa6e338c8e89f0135c79be1a2c53d (tag)
   tagging  db135e90137c5ebb9248ae7bd5ced4e8ee6b27da (commit)
  replaces  20141024
 tagged by  Dave Reisner
on  Wed Dec 24 11:04:23 2014 -0500

- Log -
tag as 20141224
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAABCAAGBQJUmuQHAAoJEB6yY4/1bAxTaZwIALVRnYbGAQPcC/MYzK0k8yL8
T7u2enqGT3K7FQkbhYZ/8UbpUa3DUWx1Xb0SAOJERc3JzVZbZUMkfe5luLlJsPUC
BYBxlkGge6puCJaHknoxKtUsFyvmhOQ8geT6YeW2OjPP7IgABFEIw5TPKDiciflL
iBsQ2elm7DqvtXtXYrrZNZqF3XArPj36u19wUVTUfPZA1p5docvR74xL5pN2JO0v
LYw6rOxQDw23r5kFb/ZknqG6bwZNYy61bpB3Rh/2yn14R48Nke2BsC2XpeLOiPXh
HbJPdr/mUSyaPtluzLAdEJzK2xnUPu5EWozoJIFws8CZByeSRloYlhmDVN4XLm4=
=FE3m
-END PGP SIGNATURE-

Dave Reisner (4):
  find-libdeps: cleanup some quoting/array concerns
  checkpkg: mask errors from lib-provides
  makepkg-*.conf: add VCSCLIENTS definition
  prepare 20141224 release

---


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20141024-3-g443aedc

2014-12-23 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The branch, master has been updated
   via  443aedca9a1acb928c2d2f0ef75bc5c2a68c209b (commit)
  from  b58fb33482bdce19163eb23ea79bb1a2f74b1719 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 443aedca9a1acb928c2d2f0ef75bc5c2a68c209b
Author: Dave Reisner dreis...@archlinux.org
Date:   Tue Dec 23 17:52:45 2014 -0500

makepkg-*.conf: add VCSCLIENTS definition

Needed for makepkg 4.2

---

Summary of changes:
 makepkg-i686.conf   | 7 +++
 makepkg-x86_64.conf | 7 +++
 2 files changed, 14 insertions(+)


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20141024-2-gb58fb33

2014-11-10 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The branch, master has been updated
   via  b58fb33482bdce19163eb23ea79bb1a2f74b1719 (commit)
   via  f743f58682d47fba5366c910d6179851e1f9483e (commit)
  from  98166e3454139918304b3e0a314e41628dd0c61c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit b58fb33482bdce19163eb23ea79bb1a2f74b1719
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Oct 25 11:20:48 2014 -0400

checkpkg: mask errors from lib-provides

bsdtar doesn't consider it an error when your --include doesn't match
anything in the archive, so we're forced to dump stderr to /dev/null
here.

Fixes: https://bugs.archlinux.org/task/42551

commit f743f58682d47fba5366c910d6179851e1f9483e
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Oct 25 11:03:43 2014 -0400

find-libdeps: cleanup some quoting/array concerns

---

Summary of changes:
 checkpkg.in |  4 ++--
 find-libdeps.in | 14 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
The official devtools repository


Re: [arch-projects] [mkinitcpio] [PATCH] Add 'microcode' hooks

2014-11-03 Thread Dave Reisner
On Sun, Nov 02, 2014 at 02:18:00AM -0500, Weng Xuetian wrote:
 Add early microcode support with early cpio. All files added under
 /early_root will be created as a separate cpio prepend to original one.
 Add a early_cpio file to early cpio to detect whether cpio contains
 early cpio, thus we can have lsinitcpio work normally like old one.
 ---

Hi, I'm not opposed to this idea, but this patch has a long way to go
before it's in mergeable shape.

  .gitignore|   1 +
  Makefile  |   9 +++-
  install/microcode |  24 +++
  lsinitcpio|  35 +---
  mkinitcpio|  13 +-
  skipcpio.c| 123 
 ++
  6 files changed, 198 insertions(+), 7 deletions(-)
  create mode 100644 install/microcode
  create mode 100644 skipcpio.c
 
 diff --git a/.gitignore b/.gitignore
 index a814a0f..1e501f0 100644
 --- a/.gitignore
 +++ b/.gitignore
 @@ -4,3 +4,4 @@ lsinitcpio.1
  *~
  *.bak
  mkinitcpio-*.tar.gz
 +skipcpio
 diff --git a/Makefile b/Makefile
 index 5af0eb2..a3a3591 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -20,7 +20,10 @@ DIRS = \
   /usr/lib/systemd/system/shutdown.target.wants \
   /usr/lib/tmpfiles.d
  
 -all: doc
 +all: doc skipcpio
 +
 +skipcpio: skipcpio.c
 + $(CC) skipcpio.c -o skipcpio

Get rid of this compile command. You just want the dependency without
the build rule. Make's default rules for generating binaries from .c are
better than yours, as they'll add in CFLAGS and LDFLAGS from the
environment.

  
  MANPAGES = \
   man/mkinitcpio.8 \
 @@ -40,6 +43,7 @@ install: all
mkinitcpio  $(DESTDIR)/usr/bin/mkinitcpio
  
   sed -e 's|\(^_f_functions\)=.*|\1=/usr/lib/initcpio/functions|' \
 + -e 's|\(^_f_skipcpio\)=.*|\1=/usr/lib/initcpio/skipcpio|' \
   -e 's|%VERSION%|$(VERSION)|g' \
lsinitcpio  $(DESTDIR)/usr/bin/lsinitcpio
  
 @@ -67,6 +71,8 @@ install: all
   ln -s mkinitcpio 
 $(DESTDIR)/usr/share/bash-completion/completions/lsinitcpio
   install -m644 shell/zsh-completion 
 $(DESTDIR)/usr/share/zsh/site-functions/_mkinitcpio
  
 + install -m755 skipcpio $(DESTDIR)/usr/lib/initcpio/skipcpio
 +
  doc: $(MANPAGES)
  man/%: man/%.txt Makefile
   a2x -d manpage \
 @@ -76,6 +82,7 @@ man/%: man/%.txt Makefile
  
  clean:
   $(RM) mkinitcpio-${VERSION}.tar.gz $(MANPAGES)
 + $(RM) skipcpio
  
  dist: doc
   echo $(VERSION)  VERSION
 diff --git a/install/microcode b/install/microcode
 new file mode 100644
 index 000..4dfd69e
 --- /dev/null
 +++ b/install/microcode
 @@ -0,0 +1,24 @@
 +#!/bin/bash
 +
 +build() {
 +ucode_dir=(amd-ucode intel-ucode)
 +ucode_dest=(AuthenticAMD.bin GenuineIntel.bin)
 +
 +for idx in 0 1; do
 +fw=${ucode_dir[$idx]}
 +for fwpath in ${_d_firmware[@]}; do
 +if [[ -d $fwpath/$fw ]]; then
 +add_dir '/early_root/kernel/x86/microcode'
 +cat $fwpath/$fw/*  
 $BUILDROOT/early_root/kernel/x86/microcode/${ucode_dest[$idx]}

I don't understand this loop. It adds both AMD and Intel firmware to the
image? Concatenates multiple files? Where do these files even come from?
I've found:

$ pkgfile -vr amd-ucode/
core/linux-firmware 20141009.0e5f637-1 
/usr/lib/firmware/amd-ucode/microcode_amd.bin
core/linux-firmware 20141009.0e5f637-1 
/usr/lib/firmware/amd-ucode/microcode_amd.bin.asc
core/linux-firmware 20141009.0e5f637-1 
/usr/lib/firmware/amd-ucode/microcode_amd_fam15h.bin
core/linux-firmware 20141009.0e5f637-1 
/usr/lib/firmware/amd-ucode/microcode_amd_fam15h.bin.asc

We really need all of this? Even the GPG signatures? What about Intel?

$ pkgfile -vr intel-ucode/
extra/intel-ucode 20140913-1/usr/share/licenses/intel-ucode/LICENSE

Doesn't look too promising... I think you've missed a step somewhere.

 +fi
 +done
 +done
 +}
 +
 +help() {
 +cat HELPEOF
 +This hook generate early ucode update
 +HELPEOF
 +}
 +
 +# vim: set ft=sh ts=4 sw=4 et:
 diff --git a/lsinitcpio b/lsinitcpio
 index 9567b79..902bfe2 100755
 --- a/lsinitcpio
 +++ b/lsinitcpio
 @@ -6,8 +6,10 @@
  shopt -s extglob
  
  _list='--list'
 -_optcolor=1 _optverbose=
 +_optcolor=1 _optverbose= _optnoearly=1
  _f_functions=functions
 +_f_skipcpio=./skipcpio
 +_tmp_files=()
  
  usage() {
  catUSAGE
 @@ -21,6 +23,7 @@ usage: ${0##*/} [action] [options] initramfs
 -x, --extractextract image to disk
  
Options:
 +   -e, --early  display early cpio if possible
 -h, --help   display this help
 -n, --nocolordisable colorized output
 -V, --versiondisplay version information
 @@ -131,7 +134,8 @@ analyze_image() {
  local kernver ratio columns=$(tput cols) image=$1
  
  workdir=$(mktemp -d --tmpdir lsinitcpio.XX)
 -trap 'rm -rf $workdir' EXIT
 +_tmp_files+=($workdir)
 +trap 'rm -rf ${_tmp_files[@]}' EXIT
  
  # fallback in case tput failed us
  columns=${columns:-80}

Re: [arch-projects] [mkinitcpio] [PATCH] Add sd-resume hook.

2014-10-30 Thread Dave Reisner
On Fri, Oct 31, 2014 at 05:08:55AM +0300, Ivan Shapovalov wrote:
 Hello again,
 
 systemd 217 seems to be in testing now, so what's the status of this?
 We should either merge this hook to core/mkinitcpio or add the equivalent
 code to 'systemd' hook.
 
 (I'm for the second approach, actually...)
 
 -- 
 Ivan Shapovalov / intelfx /

Thanks for the reminder! I'm planning on a systemd 217-2 with some bug
fixes in the next few days. I'll include your changes to systemd's
install hook.

dR


[arch-projects] [devtools] [PATCH 2/2] checkpkg: mask errors from lib-provides

2014-10-25 Thread Dave Reisner
bsdtar doesn't consider it an error when your --include doesn't match
anything in the archive, so we're forced to dump stderr to /dev/null
here.

Fixes: https://bugs.archlinux.org/task/42551
---
 checkpkg.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/checkpkg.in b/checkpkg.in
index 6ba04ed..467ac74 100644
--- a/checkpkg.in
+++ b/checkpkg.in
@@ -63,8 +63,8 @@ for _pkgname in ${pkgname[@]}; do
 
sdiff -s $TEMPDIR/filelist-$_pkgname-old $TEMPDIR/filelist-$_pkgname
 
-   find-libprovides $TEMPDIR/$oldpkg | sort  
$TEMPDIR/libraries-$_pkgname-old
-   find-libprovides $pkgfile | sort  $TEMPDIR/libraries-$_pkgname
+   find-libprovides $TEMPDIR/$oldpkg 2/dev/null | sort  
$TEMPDIR/libraries-$_pkgname-old
+   find-libprovides $pkgfile 2/dev/null | sort  
$TEMPDIR/libraries-$_pkgname
if ! diff_output=$(sdiff -s $TEMPDIR/libraries-$_pkgname-old 
$TEMPDIR/libraries-$_pkgname); then
msg Sonames differ in $_pkgname!
echo $diff_output
-- 
2.1.2


[arch-projects] [devtools] [GIT] The official devtools repository annotated tag 20141024 created. 20141024

2014-10-24 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The annotated tag, 20141024 has been created
at  df8235ae703215cc324eb8fdfb366083433cd288 (tag)
   tagging  98166e3454139918304b3e0a314e41628dd0c61c (commit)
  replaces  20140510
 tagged by  Dave Reisner
on  Fri Oct 24 09:19:36 2014 -0400

- Log -
tag as 20141024
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iQEcBAABAgAGBQJUSlHrAAoJEB6yY4/1bAxT7bwIAIZT5TrivNAIjYHj8lwYBRcp
6fYD6X1FHYj+EOPfuUHybfVhn9KFtK9KBuYPAHdrptzYAexW0oFehiAKNPW2is9m
TPwN7UJ2JpZSHfm4QD86hPmbmFXDLmHWfb/Qin33rANEmQcJZ7Id87xo6V/LHDkK
XdSxZBKHG93c9r1uioYi6j9PpqXAE9XA9eHNDlw35TYyp6jXl5JLlrLtajvuRlda
FUnWfOxVZgOaVG1feJBVGKsBNYpT15hI9b32FZDhcEuCPitqEpFh/ILvkwpYs6Df
hu7Lc0QIT5Yb+Ro/rvLEdadhlYwBJY/i7/y+4E19Uvwk1QYjALUad5FmcXo81bI=
=/aUz
-END PGP SIGNATURE-

Dave Reisner (11):
  common.sh: propagate error through trap_exit
  nspawn: skip machine registration
  makechrootpkg: use a simpler/safer expression with eval
  common: remove unreachable statement
  makechrootpkg: build as same UID as invoker
  makechrootpkg: make running namcap a compile time choice
  save and reuse original argv when auto-elevating
  makechroot: die if we encounter an unexpected option
  makechrootpkg: don't run namcap if makepkg fails
  makechrootpkg: treat makepkg_args as array
  prepare release 20141024

Doug Newgard (1):
  checkpkg: improve soname checking

Luke Shumaker (4):
  arch-nspawn: Fix a grammar mistake (a/an) in an error message.
  archbuild: Fix a variable name mistake. ($copydir - $copy)
  mkarchroot: Correct Usage: text.
  makechrootpkg: Use the btrfs mountpoint/subvolume check consistently.

---


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20140510-16-g98166e3

2014-10-24 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The branch, master has been updated
   via  98166e3454139918304b3e0a314e41628dd0c61c (commit)
  from  273d5a7a4325b830fc0038abdc7fc8a1bb55bfd9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 98166e3454139918304b3e0a314e41628dd0c61c
Author: Dave Reisner dreis...@archlinux.org
Date:   Fri Oct 24 09:19:17 2014 -0400

prepare release 20141024

---

Summary of changes:
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official devtools repository


[arch-projects] [devtools] [PATCH 3/4] makechrootpkg: don't run namcap if makepkg fails

2014-10-23 Thread Dave Reisner
Fixes a regression introduced by 285a4e94cd, which made namcap a
compile time option.
---
 makechrootpkg.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 1fbd3b4..c8cb169 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -265,7 +265,7 @@ EOF
# This is a little gross, but this way the script is recreated every 
time in the
# working copy
{
-   printf $'#!/bin/bash\n%s\n_chrootbuild %q %q\n' $(declare -f 
_chrootbuild) \
+   printf $'#!/bin/bash\n%s\n_chrootbuild %q %q || exit\n' 
$(declare -f _chrootbuild) \
$makepkg_args $run_namcap
if $run_namcap; then
cat 'EOF'
-- 
2.1.2


[arch-projects] [devtools] [PATCH 2/4] makechroot: die if we encounter an unexpected option

2014-10-23 Thread Dave Reisner
---
 makechrootpkg.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 8957974..1fbd3b4 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -70,7 +70,6 @@ orig_argv=($@)
 
 while getopts 'hcur:I:l:nTD:d:' arg; do
case $arg in
-   h) usage ;;
c) clean_first=true ;;
D) bindmounts_ro+=(--bind-ro=$OPTARG) ;;
d) bindmounts_rw+=(--bind=$OPTARG) ;;
@@ -80,6 +79,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
l) copy=$OPTARG ;;
n) run_namcap=true; makepkg_args=$makepkg_args -i ;;
T) temp_chroot=true; copy+=-$$ ;;
+   h|*) usage ;;
esac
 done
 
-- 
2.1.2


[arch-projects] [devtools] [PATCH 4/4] makechrootpkg: treat makepkg_args as array

2014-10-23 Thread Dave Reisner
---
 makechrootpkg.in | 19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index c8cb169..26deaca 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -12,7 +12,7 @@ m4_include(lib/common.sh)
 
 shopt -s nullglob
 
-makepkg_args='-s --noconfirm -L --holdver'
+makepkg_args=(-s --noconfirm -L --holdver)
 repack=false
 update_first=false
 clean_first=false
@@ -46,7 +46,7 @@ usage() {
echo 'command:'
echo 'mkarchroot chrootdir/root base-devel'
echo ''
-   echo Default makepkg args: $makepkg_args
+   echo Default makepkg args: ${makepkg_args[*]}
echo ''
echo 'Flags:'
echo '-h This help'
@@ -77,7 +77,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
r) passeddir=$OPTARG ;;
I) install_pkgs+=($OPTARG) ;;
l) copy=$OPTARG ;;
-   n) run_namcap=true; makepkg_args=$makepkg_args -i ;;
+   n) run_namcap=true; makepkg_args+=(-i) ;;
T) temp_chroot=true; copy+=-$$ ;;
h|*) usage ;;
esac
@@ -102,7 +102,7 @@ else
 fi
 
 # Pass all arguments after -- right to makepkg
-makepkg_args=$makepkg_args ${*:$OPTIND}
+makepkg_args+=(${@:$OPTIND})
 
 # See if -R was passed to makepkg
 for arg in ${@:OPTIND}; do
@@ -265,8 +265,12 @@ EOF
# This is a little gross, but this way the script is recreated every 
time in the
# working copy
{
-   printf $'#!/bin/bash\n%s\n_chrootbuild %q %q || exit\n' 
$(declare -f _chrootbuild) \
-   $makepkg_args $run_namcap
+   printf '#!/bin/bash\n'
+   declare -f _chrootbuild
+   printf '_chrootbuild'
+   printf ' %q' ${makepkg_args[@]}
+   printf ' || exit\n'
+
if $run_namcap; then
cat 'EOF'
 pacman -S --needed --noconfirm namcap
@@ -302,7 +306,6 @@ download_sources() {
 _chrootbuild() {
# This function isn't run in makechrootpkg,
# so no global variables
-   local makepkg_args=$1
 
. /etc/profile
export HOME=/build
@@ -338,7 +341,7 @@ _chrootbuild() {
exit 1
fi
 
-   sudo -u builduser makepkg $makepkg_args
+   sudo -u builduser makepkg $@
 }
 
 move_products() {
-- 
2.1.2


[arch-projects] [devtools] [PATCH 1/2] save and reuse original argv when auto-elevating

2014-10-19 Thread Dave Reisner
Fixes: https://bugs.archlinux.org/task/42277
---
I'm rejecting the prior patch to fix this [1]. That particular fix comes with
the downside that you can no longer even get the usage for these programs
without being root.

[1] https://lists.archlinux.org/pipermail/arch-projects/2014-May/004159.html

 arch-nspawn.in   | 4 +++-
 archbuild.in | 6 --
 makechrootpkg.in | 6 --
 mkarchroot.in| 4 +++-
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch-nspawn.in b/arch-nspawn.in
index b85d360..19f1410 100644
--- a/arch-nspawn.in
+++ b/arch-nspawn.in
@@ -26,6 +26,8 @@ usage() {
exit 1
 }
 
+orig_argv=($@)
+
 while getopts 'hC:M:c:' arg; do
case $arg in
C) pac_conf=$OPTARG ;;
@@ -38,7 +40,7 @@ done
 shift $(($OPTIND - 1))
 
 (( $#  1 ))  die 'You must specify a directory.'
-check_root $0 $@
+check_root $0 ${orig_argv[@]}
 
 working_dir=$(readlink -f $1)
 shift 1
diff --git a/archbuild.in b/archbuild.in
index dc45c7f..9c5d706 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -29,6 +29,8 @@ usage() {
exit 1
 }
 
+orig_argv=($@)
+
 while getopts 'hcr:' arg; do
case ${arg} in
c) clean_first=true ;;
@@ -37,11 +39,11 @@ while getopts 'hcr:' arg; do
esac
 done
 
+check_root $0 ${orig_argv[@]}
+
 # Pass all arguments after -- right to makepkg
 makechrootpkg_args+=(${@:$OPTIND})
 
-check_root $0 $@
-
 if ${clean_first} || [[ ! -d ${chroots}/${repo}-${arch} ]]; then
msg Creating chroot for [${repo}] (${arch})...
 
diff --git a/makechrootpkg.in b/makechrootpkg.in
index a340116..8957974 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -66,6 +66,8 @@ usage() {
exit 1
 }
 
+orig_argv=($@)
+
 while getopts 'hcur:I:l:nTD:d:' arg; do
case $arg in
h) usage ;;
@@ -81,10 +83,10 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
esac
 done
 
-check_root $0 $@
-
 [[ ! -f PKGBUILD  -z ${install_pkgs[*]} ]]  die 'This must be run in a 
directory containing a PKGBUILD.'
 
+check_root $0 ${orig_argv[@]}
+
 # Canonicalize chrootdir, getting rid of trailing /
 chrootdir=$(readlink -e $passeddir)
 [[ ! -d $chrootdir ]]  die No chroot dir defined, or invalid path '%s' 
$passeddir
diff --git a/mkarchroot.in b/mkarchroot.in
index 5f3d6fe..78384da 100644
--- a/mkarchroot.in
+++ b/mkarchroot.in
@@ -24,6 +24,8 @@ usage() {
exit 1
 }
 
+orig_argv=($@)
+
 while getopts 'hC:M:c:' arg; do
case $arg in
C) pac_conf=$OPTARG ;;
@@ -37,7 +39,7 @@ shift $(($OPTIND - 1))
 
 (( $#  2 ))  die 'You must specify a directory and one or more packages.'
 
-check_root $0 $@
+check_root $0 ${orig_argv[@]}
 
 working_dir=$(readlink -f $1)
 shift 1
-- 
2.1.2


[arch-projects] [devtools] [PATCH 2/2] makechroot: die if we encounter an unexpected option

2014-10-19 Thread Dave Reisner
---
 makechrootpkg.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/makechrootpkg.in b/makechrootpkg.in
index 8957974..7b3daa6 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -70,7 +70,7 @@ orig_argv=($@)
 
 while getopts 'hcur:I:l:nTD:d:' arg; do
case $arg in
-   h) usage ;;
+   h|*) usage ;;
c) clean_first=true ;;
D) bindmounts_ro+=(--bind-ro=$OPTARG) ;;
d) bindmounts_rw+=(--bind=$OPTARG) ;;
-- 
2.1.2


Re: [arch-projects] [devtools] [PATCH 2/2] makechroot: die if we encounter an unexpected option

2014-10-19 Thread Dave Reisner
On Sun, Oct 19, 2014 at 04:54:27PM -0400, Dave Reisner wrote:
 ---
  makechrootpkg.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/makechrootpkg.in b/makechrootpkg.in
 index 8957974..7b3daa6 100644
 --- a/makechrootpkg.in
 +++ b/makechrootpkg.in
 @@ -70,7 +70,7 @@ orig_argv=($@)
  
  while getopts 'hcur:I:l:nTD:d:' arg; do
   case $arg in
 - h) usage ;;
 + h|*) usage ;;

Derp, obviously this must also move to be the last label, as is done
elsewhere...

   c) clean_first=true ;;
   D) bindmounts_ro+=(--bind-ro=$OPTARG) ;;
   d) bindmounts_rw+=(--bind=$OPTARG) ;;
 -- 
 2.1.2


[arch-projects] [devtools] [GIT] The official devtools repository branch master updated. 20140510-11-gcae954d

2014-10-01 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official devtools repository.

The branch, master has been updated
   via  cae954ddb5d35877eaaea588b84f932863714568 (commit)
   via  285a4e94cdee62cae155abcec4daeeffd709e900 (commit)
   via  a78bdb841dbe7839c8afd7184d821ed42dd334cc (commit)
  from  12a1300694272928e70408f4ce2fe85bacd19eb4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit cae954ddb5d35877eaaea588b84f932863714568
Author: Doug Newgard scim...@archlinux.info
Date:   Sun Sep 21 16:21:18 2014 -0500

checkpkg: improve soname checking

This makes soname checking much more robust and is explicit when a
soname change is found.

commit 285a4e94cdee62cae155abcec4daeeffd709e900
Author: Dave Reisner dreis...@archlinux.org
Date:   Tue Sep 23 07:57:43 2014 -0400

makechrootpkg: make running namcap a compile time choice

We don't need to pass _chrootbuild this information at runtime -- we
can just generate the build script to do exactly what we want.

commit a78bdb841dbe7839c8afd7184d821ed42dd334cc
Author: Dave Reisner dreis...@archlinux.org
Date:   Sun Sep 21 15:03:28 2014 -0400

makechrootpkg: build as same UID as invoker

Changing UID to that of 'nobody' is arbitrary at best, and an
information leak at worst. Let's just drop back to the same UID of the
invoker.

---

Summary of changes:
 checkpkg.in  | 11 +--
 makechrootpkg.in | 48 +++-
 2 files changed, 32 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
The official devtools repository


Re: [arch-projects] [devtools] [PATCH 2/2] makechrootpkg: build as same UID as invoker

2014-09-30 Thread Dave Reisner
On Tue, Sep 30, 2014 at 11:23:50PM +0200, Sébastien Luttringer wrote:
 On 22/09/2014 14:35, Dave Reisner wrote:
  Changing UID to that of 'nobody' is arbitrary at best, and an
  information leak at worst. Let's just drop back to the same UID of the
  invoker.
 
 Which information is leaking?

nobody in the build chroot is exactly the same nobody as outside the
chroot. So, someone running as nobody has full control over the build
as it occurs in the chroot. ptrace it, do whatever you want to it
(including creating a malicious binary). There's no reason not to drop
privileges back to the user who invoked the build.

 This should also fix the permission issue on file introduced by bind
 mounting $startdir instread of copying and have files owned by nobody.

Neat!

I've found one breakage in the patch (user creation is a pain in the ass
across architectures because of dlopen), but that's fixed locally.

d


[arch-projects] [devtools] [PATCH 1/2] Include end of options delimeter in makepkg_args

2014-09-22 Thread Dave Reisner
This prevents the need for:

  extra-x86_64-build -- -- -R
---
 archbuild.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/archbuild.in b/archbuild.in
index dc45c7f..795bebf 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -38,7 +38,7 @@ while getopts 'hcr:' arg; do
 done
 
 # Pass all arguments after -- right to makepkg
-makechrootpkg_args+=(${@:$OPTIND})
+makechrootpkg_args+=(-- ${@:$OPTIND})
 
 check_root $0 $@
 
-- 
2.1.0


Re: [arch-projects] [mkinitcpio] [PATCH] Add sd-resume hook.

2014-08-26 Thread Dave Reisner
On Wed, Aug 27, 2014 at 12:47:10AM +0400, Ivan Shapovalov wrote:
 This depends on the systemd hook. It adds systemd-hibernate-resume@.service
 and systemd-hibernate-resume-generator which perform userspace parsing of
 resume= kernel parameter, allowing to specify the resume device by its
 persistent path (resume=/dev/disk/by-foo/bar) or fstab-like specifier
 (resume=FOO=bar), just like the root= parameter.
 ---
 
 Given that relevant functionality has just landed in systemd git, it makes
 sense to pipeline things a bit (even if actual applying will be delayed until
 systemd-217).
 
 Also, does this need to be a separate hook or can be merged into 'systemd'
 hook itself?

This belongs in mkinitcpio proper, along with the systemd hooks
currently residing in the core/systemd package. You can blame me for the
latter not yet happening. Given that, we should probably add this to the
systemd package for now, as to not give people the idea that sd-resume
can be used without the systemd hook.

Thanks so much for pushing this work upstream!

  install/sd-resume | 22 ++
  1 file changed, 22 insertions(+)
  create mode 100644 install/sd-resume
 
 diff --git a/install/sd-resume b/install/sd-resume
 new file mode 100644
 index 000..2995a8e
 --- /dev/null
 +++ b/install/sd-resume
 @@ -0,0 +1,22 @@
 +#!/bin/bash
 +
 +build() {
 +map add_binary \
 +/usr/lib/systemd/systemd-hibernate-resume \
 +
 /usr/lib/systemd/system-generators/systemd-hibernate-resume-generator
 +
 +map add_systemd_unit \
 +systemd-hibernate-resume@.service \
 +local-fs-pre.target
 +}
 +
 +help() {
 +cat HELPEOF
 +This hook adds builtin systemd facility for resuming from disk. It allows to
 +specify the resume device by its persistent path 
 (resume=/dev/disk/by-foo/bar)
 +or in fstab-like way (resume=FOO=bar), just like it's possible with the root=
 +parameter.
 +HELPEOF
 +}
 +
 +# vim: set ft=sh ts=4 sw=4 et:
 -- 
 2.1.0


Re: [arch-projects] [mkinitcpio] [PATCH] Add sd-resume hook.

2014-08-26 Thread Dave Reisner
On Wed, Aug 27, 2014 at 02:05:41AM +0400, Ivan Shapovalov wrote:
 On Tuesday 26 August 2014 at 17:42:54, Dave Reisner wrote:
  On Wed, Aug 27, 2014 at 12:47:10AM +0400, Ivan Shapovalov wrote:
   This depends on the systemd hook. It adds 
   systemd-hibernate-resume@.service
   and systemd-hibernate-resume-generator which perform userspace parsing of
   resume= kernel parameter, allowing to specify the resume device by its
   persistent path (resume=/dev/disk/by-foo/bar) or fstab-like specifier
   (resume=FOO=bar), just like the root= parameter.
   ---
   
   Given that relevant functionality has just landed in systemd git, it makes
   sense to pipeline things a bit (even if actual applying will be delayed 
   until
   systemd-217).
   
   Also, does this need to be a separate hook or can be merged into 'systemd'
   hook itself?
  
  This belongs in mkinitcpio proper, along with the systemd hooks
  currently residing in the core/systemd package. You can blame me for the
  latter not yet happening. Given that, we should probably add this to the
  systemd package for now, as to not give people the idea that sd-resume
  can be used without the systemd hook.
  
  Thanks so much for pushing this work upstream!
 
 I'm confused a bit.

Apparently, I am too. My brain is largely fried from being sick for a
week (and then traveling/partying copiously this past weekend).

Let's try this again -- this time with a bit more context/detail.

 Do you say that the 'systemd' hook currently in core/systemd shall be
 eventually moved to core/mkinitcpio?

Actually, no. I'm incorrectly recalling my own plan. What I should have
said is that the add_systemd_unit and add_udev_rule shell functions were
to be matured in core/systemd before adding them to the functions file
of mkinitcpio. I've not seen any bug reports since Tom Gundersen and I
wrote those (maybe a year ago?) so perhaps it's time to just go ahead
and do that.

I'm actually against moving the whole systemd hook into core/mkinitcpio
because it then puts mkinitcpio in a situation where it has to be
reactionary to backwards incompatible changes to systemd. This kind of
dependency has bitten me in the past (though offhand, I don't recall
which hook this was relevant to). Maybe Thomas recalls.

 Either way, there are 'sd-vconsole' and 'sd-shutdown' already in 
 core/mkinitcpio.
 I think that if 'sd-resume' will be a separate hook, then either it should be
 placed here, or all three sd-* hooks should be moved to core/systemd.

Yes, you're right -- this contradicts my previous reply. Ultra
long-term, mkinitcpio may lose its shell-based early userspace and only
support systemd. That would mean that I ignore my paranoia about
backwards incompatible changes just deal with mkinitcpio sometimes
needing to move in lockstep with systemd.

 (The global alternative -- viability unknown -- is not to make 'sd-resume'
 a separate hook but to add all this directly from 'systemd' hook.)

Certainly viable. The extra binaries are quite small, and it'd be nice
if this just worked out of the box.

Hope this makes things a bit clearer...

d


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v18-1-gea4c415

2014-08-04 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  ea4c4154205372154457c794513ae46b61ea4e4c (commit)
  from  a35c698c16759c3c05c692fd10f140d186053177 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit ea4c4154205372154457c794513ae46b61ea4e4c
Author: Dave Reisner dreis...@archlinux.org
Date:   Mon Aug 4 08:31:37 2014 -0400

avoid compound conditional leading to spurious errors

As seen:

https://bbs.archlinux.org/viewtopic.php?id=185204
https://bbs.archlinux.org/viewtopic.php?id=185265

---

Summary of changes:
 functions | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v17-5-ga35c698

2014-07-23 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  a35c698c16759c3c05c692fd10f140d186053177 (commit)
  from  02d387b2370215d51d1aa8958fce42cd099bee29 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit a35c698c16759c3c05c692fd10f140d186053177
Author: Dave Reisner dreis...@archlinux.org
Date:   Wed Jul 23 18:45:17 2014 -0400

block: include all of drivers/storage/usb

Fixes FS#41273.

---

Summary of changes:
 install/block | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v17-4-g02d387b

2014-06-21 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  02d387b2370215d51d1aa8958fce42cd099bee29 (commit)
   via  8ac740cbb14a5971897501e81a99e25767953841 (commit)
  from  cfae62080565cc5100834906a5e9994e094335f4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 02d387b2370215d51d1aa8958fce42cd099bee29
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Jun 21 12:38:04 2014 -0400

add second param to add_full_dir to allow filtering files

Use this to only add files matching *.conf in the modconf hook.

Fixes FS#39994.

commit 8ac740cbb14a5971897501e81a99e25767953841
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Jun 21 12:32:47 2014 -0400

add quirk for vfat nls module

Fixes FS#40217.

---

Summary of changes:
 functions| 8 +---
 install/modconf  | 4 ++--
 man/mkinitcpio.8.txt | 5 -
 3 files changed, 11 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [devtools] [PATCH 1/2] common: fix arg concatenation and unreachable statement

2014-06-01 Thread Dave Reisner
We run from a non-interactive shell, so the exec which is inevitably
called will replace the current process and 'die' will never run under
any circumstances.

Also fix a bug with the su fallback which would cause multiple arguments
to be concatenated without any whitespace between them.
---
 lib/common.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/common.sh b/lib/common.sh
index b885080..e4bb91f 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -236,8 +236,9 @@ check_root() {
(( EUID == 0 ))  return
if type -P sudo /dev/null; then
exec sudo -- $@
+   elif type -P su /dev/null; then
+   exec su root -c $(printf ' %q' $@)
else
-   exec su root -c $(printf '%q' $@)
+   die 'This script must be run as root.'
fi
-   die 'This script must be run as root.'
 }
-- 
1.9.3



Re: [arch-projects] [devtools] [PATCH 5/9] arch-nspawn: Avoid errors where $working_dir is longer than HOST_NAME_MAX.

2014-05-11 Thread Dave Reisner
On Sun, May 11, 2014 at 12:04:31AM -0400, Luke Shumaker wrote:
 At Sat, 10 May 2014 22:36:44 -0400,
 Dave Reisner wrote:
  On Sat, May 10, 2014 at 10:22:07PM -0400, Luke Shumaker wrote:
   +#HOST_NAME_MAX=$(printf '%s\n' '#include limits.h' 
   'HOST_NAME_MAX'|cpp -|sed -n '$p')
  
  No need to write the include as if this were a source file, just tell
  cpp about it directly:
  
cpp -I limits.h HOST_NAME_MAX | ...
 
 That doesn't work, but this does:
 
   cpp -include limits.h HOST_NAME_MAX | ...
 
 I'd never had occasion to use that flag before, so thank you!
 

Ah, right. -I is for directories.

   +HOST_NAME_MAX=64
   +if [[ ${#machine_name} -gt $HOST_NAME_MAX ]]; then
   + machine_name=${machine_name:(-${HOST_NAME_MAX})}
   + machine_name=${machine_name#-}
  
  I think this is worth warning about, since it might result in name
  clashes.
 
 Is it any more likely to cause clashes than the existing machine name
 munging?  64 characters is a lot, and I figure that the end is the
 part that is most likely to change.

Oh, I see. You're trimming leading characters, not truncating.
Alternatively, just hash the full path? Is the machine name really
useful in any way other than to define a unique name for the build
container?

 What about passing '-q' to systemd-nspawn and not directing its stderr
 to /dev/null?  That way the user gets a reasonably friendly Failed to
 register machine: Machine '$machine_name' already exits, as well as
 a message for any other errors that may occur.  IIRC, the reason
 stderr was directed to /dev/null was that at the time it was written,
 systemd-nspawn didn't have a '-q' flag.

Sounds good to me. The --quiet flag was added to systemd in v209.

d


Re: [arch-projects] [devtools] [PATCH 0/9] Changes I've been maintaining in Parabola's fork

2014-05-11 Thread Dave Reisner
On Sat, May 10, 2014 at 10:22:02PM -0400, Luke Shumaker wrote:
 Hi, I maintain Parabola's fork of devtools.  I've always had a set
 of generic changes to contribute back upstream, but until now never
 got around to pulling them into nice changesets.
 
 I also had one to allow makechrootpkg to handle arguments with spaces,
 but I just sent that as a reply in another thread since Dave Reisner
 seems to have just written the same thing!
 
 These are arranged roughly by how controversial I expect them to
 be; I expect that no one will object to the first couple commits,
 while someone might question the utility of the changes to
 lock/slock.
 
 Happy hacking,
 ~ Luke Shumaker

Modulo the comments I've made in 2 of the patches, this whole set gets
an ACK from me. Thanks for contributing back upstream!

 
 Luke Shumaker (9):
   arch-nspawn: Fix a grammar mistake (a/an) in an error message.
   archbuild: Fix a variable name mistake. ($copydir - $copy)
   mkarchroot: Correct Usage: text.
   makechrootpkg: Use the btrfs mountpoint/subvolume check consistently.
   arch-nspawn: Avoid errors where $working_dir is longer than
 HOST_NAME_MAX.
   lib/common.sh: Add a lock_close function.
   lib/common.sh:stat_busy(): Accept printf-style arguments.
   lib/common.sh: Improve lock() and slock().
   Replace multiple uses of string interpolation with printf-type
 arguments.
 
  arch-nspawn.in   | 10 --
  archbuild.in | 10 +-
  archrelease.in   |  2 +-
  checkpkg.in  |  4 ++--
  crossrepomove.in |  8 
  lddd.in  |  4 ++--
  lib/common.sh| 48 +---
  makechrootpkg.in | 10 +-
  mkarchroot.in|  4 ++--
  rebuildpkgs.in   | 14 +++---
  10 files changed, 73 insertions(+), 41 deletions(-)
 
 -- 
 1.9.2
 


[arch-projects] [devtools] [PATCH 3/3] common: remove unreachable statement

2014-05-10 Thread Dave Reisner
We run from a non-interactive shell, so the exec which is inevitably
called will replace the current process and 'die' will never run under
any circumstances.

This also fixes a bug with the su fallback which would cause multiple
arguments to be concatenated without any whitespace between them.
---
 lib/common.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/common.sh b/lib/common.sh
index b885080..1798773 100644
--- a/lib/common.sh
+++ b/lib/common.sh
@@ -237,7 +237,6 @@ check_root() {
if type -P sudo /dev/null; then
exec sudo -- $@
else
-   exec su root -c $(printf '%q' $@)
+   exec su root -c $(printf ' %q' $@)
fi
-   die 'This script must be run as root.'
 }
-- 
1.9.2



Re: [arch-projects] [devtools] [PATCH 3/3] common: remove unreachable statement

2014-05-10 Thread Dave Reisner
On Sat, May 10, 2014 at 09:44:34AM -0400, Dave Reisner wrote:
 We run from a non-interactive shell, so the exec which is inevitably
 called will replace the current process and 'die' will never run under
 any circumstances.
 
 This also fixes a bug with the su fallback which would cause multiple
 arguments to be concatenated without any whitespace between them.
 ---
  lib/common.sh | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/lib/common.sh b/lib/common.sh
 index b885080..1798773 100644
 --- a/lib/common.sh
 +++ b/lib/common.sh
 @@ -237,7 +237,6 @@ check_root() {
   if type -P sudo /dev/null; then
   exec sudo -- $@
   else

Perhaps it would be better to not assume that su exists here, check for
it, and then fall back on the 'die'.

 - exec su root -c $(printf '%q' $@)
 + exec su root -c $(printf ' %q' $@)
   fi
 - die 'This script must be run as root.'
  }
 -- 
 1.9.2
 


Re: [arch-projects] [PATCH] [mkinitcpio] Change links to https:// protocol

2014-04-05 Thread Dave Reisner
On Apr 5, 2014 3:25 PM, Dan McGee d...@archlinux.org wrote:

 ---
  man/lsinitcpio.1.txt | 2 +-
  man/mkinitcpio.8.txt | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)

Ack.

 diff --git a/man/lsinitcpio.1.txt b/man/lsinitcpio.1.txt
 index 98bd756..436cdd8 100644
 --- a/man/lsinitcpio.1.txt
 +++ b/man/lsinitcpio.1.txt
 @@ -53,7 +53,7 @@ Options
  Bugs
  
  Upon writing this manpage, there were no noticeable bugs present. Please
visit
 -http://bugs.archlinux.org/ for an up to date list.
 +https://bugs.archlinux.org/ for an up to date list.

  See Also
  
 diff --git a/man/mkinitcpio.8.txt b/man/mkinitcpio.8.txt
 index cd06576..22c8e9e 100644
 --- a/man/mkinitcpio.8.txt
 +++ b/man/mkinitcpio.8.txt
 @@ -315,14 +315,14 @@ Examples
  See also
  
  A more thorough article on configuring mkinitcpio:
 -http://wiki.archlinux.org/index.php/Mkinitcpio
 +https://wiki.archlinux.org/index.php/Mkinitcpio

  *initrd*(4), *lsinitcpio*(1), *mkinitcpio.conf*(5), *bootparam*(7)

  Bugs
  
  Upon writing this manpage, there were no noticeable bugs present. Please
visit
 -http://bugs.archlinux.org/ for an up to date list.
 +https://bugs.archlinux.org/ for an up to date list.

  Authors
  ---
 --
 1.9.1



[arch-projects] [mkinitcpio] [PATCH] Rely on ldconfig to generate library symlinks

2014-03-23 Thread Dave Reisner
Ignore the intermediate garbage and just let ldconfig do the right
thing. Because we now depend on ldconfig, subject it to the standard
error handlers.

Fixes FS#39560
---
 functions  | 9 ++---
 mkinitcpio | 5 ++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/functions b/functions
index 2d38815..78ba4c8 100644
--- a/functions
+++ b/functions
@@ -587,9 +587,12 @@ add_binary() {
 if [[ ! -L $sodep ]]; then
 add_file $sodep $sodep $(stat -c %a $sodep)
 else
-resolved=$(readlink -e $sodep)
-add_symlink $sodep $(readlink $sodep)
-add_file $resolved $resolved 755
+if resolved=$(readlink -e $sodep); then
+add_file $resolved
+else
+error 'Failed to resolve the symlink target of %s' $sodep
+(( ++builderrors ))
+fi
 fi
 fi
 done  $lddout
diff --git a/mkinitcpio b/mkinitcpio
index 42abde7..cec9ffb 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -496,14 +496,13 @@ set -o errtrace
 
 install_modules ${!_modpaths[@]}
 
+ldconfig -r $BUILDROOT
+
 # unset errtrace and trap
 set +o functrace
 set +o errtrace
 trap -- ERR
 
-# this is simply a nice-to-have -- it doesn't matter if it fails.
-ldconfig -r $BUILDROOT /dev/null
-
 if [[ $_optgenimg ]]; then
 build_image $_optgenimg $_optcompress
 elif [[ $_opttargetdir ]]; then
-- 
1.9.1



Re: [arch-projects] [devtools][patch][makechrootpkg] Actually pass extra arguments to makepkg

2014-03-16 Thread Dave Reisner
On Sat, Mar 15, 2014 at 10:09:30PM -0700, Joel Teichroeb wrote:
 I didn't know that -- would work. The documentation didn't mention that.
 
 The line *) makepkg_args=$makepkg_args -$arg $OPTARG ;; is still wrong
 though as doing -- will end getopt and then makepkg is called with $
 {*:$OPTIND} meaning that the parameters aren't handled by the getopts loop.
 Instead, how about this patch? It fixes the usage and removes the broken line.

Sure, the code is clearly wrong here.

 
 ---
  makechrootpkg.in | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/makechrootpkg.in b/makechrootpkg.in
 index d03b703..fc17b8a 100644
 --- a/makechrootpkg.in
 +++ b/makechrootpkg.in
 @@ -35,7 +35,7 @@ src_owner=${SUDO_USER:-$USER}
  usage() {
   echo Usage: ${0##*/} [options] -r chrootdir [--] [makepkg args]
   echo ' Run this script in a PKGBUILD dir to build a package inside a'
 - echo ' clean chroot. All unrecognized arguments passed to this script'
 + echo ' clean chroot. All arguments passed to this script after --'

This might be confusing if you're not familiar with the syntax for the
end of options marker. You might want to reword this to make it more
clear what you're referring to. Perhaps something like:

Arguments passed to this script after the end-of-options marker (--),
will be passed to makepkg.


   echo ' will be passed to makepkg.'
   echo ''
   echo ' The chroot dir consists of the following directories:'
 @@ -78,7 +78,6 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
   l) copy=$OPTARG ;;
   n) run_namcap=true; makepkg_args=$makepkg_args -i ;;
   T) temp_chroot=true; copy+=-$$ ;;
 - *) makepkg_args=$makepkg_args -$arg $OPTARG ;;
   esac
  done
  
 -- 
 1.9.0
 
 
 
 
 
 On Sat, Mar 15, 2014 at 9:48 PM, Dave Reisner d...@falconindy.com wrote:
 
 
 
 On Mar 16, 2014 12:36 AM, Joel Teichroeb j...@teichroeb.net wrote:
 
  Currently, if a user has extra arguments on the end of their
 makechrootpkg command it prints an error and does not add those arguments
 to the makepkg command line as expected. As far as I can tell it would 
 have
 never worked this way because according to the specifications for getopts
 [1] if there is no : at the start of the argument list $OPTARG will not
 be set and $arg will be set to ?, but if there is a : $OPTARG will be
 set to the unknown argument. Unfortunately this means we can not easily 
 get
 the argument to an unknown option.
 
 This works just fine if you use the end-of-options delimiter to exit the
 getopts loop, e.g.:
 
 makechrootpkg /path/to/chroot -- -R
 
 
  [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/
 getopts.html
  ---
   makechrootpkg.in | 4 ++--
   1 file changed, 2 insertions(+), 2 deletions(-)
 
  diff --git a/makechrootpkg.in b/makechrootpkg.in
  index d03b703..7e5f8e8 100644
  --- a/makechrootpkg.in
  +++ b/makechrootpkg.in
  @@ -66,7 +66,7 @@ usage() {
    exit 1
   }
   
  -while getopts 'hcur:I:l:nTD:d:' arg; do
  +while getopts ':hcur:I:l:nTD:d:' arg; do
    case $arg in
    h) usage ;;
    c) clean_first=true ;;
  @@ -78,7 +78,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
    l) copy=$OPTARG ;;
    n) run_namcap=true; makepkg_args=$makepkg_args -i ;;
    T) temp_chroot=true; copy+=-$ ;;
  - *) makepkg_args=$makepkg_args -$arg $OPTARG ;;
  + *) makepkg_args=$makepkg_args -$OPTARG ;;
    esac
   done
   
  --
  1.9.0
 
 


Re: [arch-projects] [devtools][patch][makechrootpkg] Actually pass extra arguments to makepkg

2014-03-15 Thread Dave Reisner
On Mar 16, 2014 12:36 AM, Joel Teichroeb j...@teichroeb.net wrote:

 Currently, if a user has extra arguments on the end of their
makechrootpkg command it prints an error and does not add those arguments
to the makepkg command line as expected. As far as I can tell it would have
never worked this way because according to the specifications for
getopts[1] if there is no : at the start of the argument list $OPTARG
will not be set and $arg will be set to ?, but if there is a : $OPTARG
will be set to the unknown argument. Unfortunately this means we can not
easily get the argument to an unknown option.

This works just fine if you use the end-of-options delimiter to exit the
getopts loop, e.g.:

makechrootpkg /path/to/chroot -- -R


 [1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/getopts.html
 ---
  makechrootpkg.in | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/makechrootpkg.in b/makechrootpkg.in
 index d03b703..7e5f8e8 100644
 --- a/makechrootpkg.in
 +++ b/makechrootpkg.in
 @@ -66,7 +66,7 @@ usage() {
   exit 1
  }

 -while getopts 'hcur:I:l:nTD:d:' arg; do
 +while getopts ':hcur:I:l:nTD:d:' arg; do
   case $arg in
   h) usage ;;
   c) clean_first=true ;;
 @@ -78,7 +78,7 @@ while getopts 'hcur:I:l:nTD:d:' arg; do
   l) copy=$OPTARG ;;
   n) run_namcap=true; makepkg_args=$makepkg_args -i ;;
   T) temp_chroot=true; copy+=-$ ;;
 - *) makepkg_args=$makepkg_args -$arg $OPTARG ;;
 + *) makepkg_args=$makepkg_args -$OPTARG ;;
   esac
  done

 --
 1.9.0


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v16-9-gd88deaa

2014-03-08 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  d88deaadc591e1f6f62b7517772fb6b892d76251 (commit)
  from  3f90dc3e321f9c54b7b42ab0c548c591b8e4142e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit d88deaadc591e1f6f62b7517772fb6b892d76251
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Mar 8 13:24:01 2014 -0500

mkinitcpio.8: add reference to bootparam(7)

---

Summary of changes:
 man/mkinitcpio.8.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [mkinitcpio][PATCH] Fix btrfs module deps for linux 3.14 (v2)

2014-03-04 Thread Dave Reisner
On Mon, Mar 03, 2014 at 12:35:15PM +, WorMzy Tykashi wrote:
 Second version of the patch to ensure that the crc32c module is added to the 
 initrd when the btrfs module is.
 
 ---

Well, but this patch lacks all the delicious background you wrote!

I'm committing your original patch with the more succinct fix.

Thanks

  functions | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/functions b/functions
 index 33bd28d..1ff155a 100644
 --- a/functions
 +++ b/functions
 @@ -402,7 +402,7 @@ add_module() {
  ocfs2)
  add_module configfs?
  ;;
 -libcrc32c)
 +libcrc32c|btrfs)
  add_module crc32c_intel?
  add_module crc32c?
  ;;
 -- 
 1.9.0
 


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v16-6-gbbda33a

2014-03-04 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  bbda33a25dc5f0da89f92fb30aaa40d88b7f06ac (commit)
  from  869c314159497c74aa6cf477862629b05a9fd2b0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit bbda33a25dc5f0da89f92fb30aaa40d88b7f06ac
Author: WorMzy Tykashi wormzy.tyka...@gmail.com
Date:   Mon Mar 3 01:17:29 2014 +

add btrfs module quirk for linux 3.14

This patch adds in some extra hackery to make sure that users with btrfs
root filesystems don't end up with unusable initrds due to the following
change made upstream [1]. TL;DR: The btrfs module has dropped it's
libcrc32c dependency, so mkinitcpio no longer pulls in the crc32c module
necessary for the btrfs module to be inserted. The crc32c module was
only pulled in previously due to mkinitcpio hackery [2], so extra
hackery now seems like the logical path.

This problem can be experienced by using linux-mainline on an Arch
machine with a btrfs root filesystem. Besides from this extra hackery,
an alternative workaround would be for users in this situation to add
crc32c to their MODULES aray in their mkintcpio.conf. Of course, this
needs to be done ahead of the linux-3.14 upgrade for them to avoid the
problem (assuming none of their other modules depend on libcrc32c).

[1] http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg30912.html
[2] https://projects.archlinux.org/mkinitcpio.git/tree/functions?id=v16#n398

---

Summary of changes:
 functions | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [netctl][PATCH 1/2] Factor out DHCP client support

2014-02-27 Thread Dave Reisner
On Thu, Feb 27, 2014 at 12:56:02PM -0500, Leonid Isaev wrote:
 On Thu, 27 Feb 2014 14:25:15 +0100
 Jouke Witteveen j.wittev...@gmail.com wrote:
 
  Support for additional DHCP clients is now easy to add.
 
 Just a quick question: are there any plans to use networkd as a DHCP backend?
 Yes, it is config-file-driven, but one can probably generate the .network
 files in /run on the fly...

This sounds like pointless masturbation. Just use networkd directly.


Re: [arch-projects] [devtools] [PATCH 2/3] when cleanup is called without code exit with 0

2014-02-15 Thread Dave Reisner
On Sat, Feb 15, 2014 at 06:13:42PM +0100, BlackEagle wrote:
 Signed-off-by: BlackEagle ike.devol...@gmail.com
 ---
  lib/common.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/common.sh b/lib/common.sh
 index 206ea01..3ca1c7e 100644
 --- a/lib/common.sh
 +++ b/lib/common.sh
 @@ -65,7 +65,7 @@ setup_workdir() {
  
  cleanup() {
   [[ -n $WORKDIR ]]  rm -rf $WORKDIR
 - [[ $1 ]]  exit $1
 + [[ ! -z $1 ]]  exit $1 || exit 0

[[ ! -z $ 1 ]] is like using a double negative. it's exactly the same as
the code you replaced. Why not just:

  exit ${1:-0}



Re: [arch-projects] [devtools] [PATCH 3/3] get_full_version :: remove duplicated epoch check

2014-02-15 Thread Dave Reisner
On Sat, Feb 15, 2014 at 06:13:43PM +0100, BlackEagle wrote:
 Signed-off-by: BlackEagle ike.devol...@gmail.com
 ---
  lib/common.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/common.sh b/lib/common.sh
 index 3ca1c7e..b817683 100644
 --- a/lib/common.sh
 +++ b/lib/common.sh
 @@ -114,7 +114,7 @@ get_full_version() {
   pkgbase=${pkgbase:-${pkgname[0]}}
   epoch=${epoch:-0}
   if [[ -z $1 ]]; then
 - if [[ $epoch ]]  (( ! $epoch )); then
 + if (( ! $epoch )); then

This will break when epoch isn't defined -- that's why the original
string based check is necessary. It be avoided though, if you write
this as:

  if (( ! epoch )); then

   echo $pkgver-$pkgrel
   else
   echo $epoch:$pkgver-$pkgrel
 -- 
 1.8.5.5
 


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v16-4-ged65f93

2014-01-04 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  ed65f93eb4d23aee3129611c90fa2b81e0cb7f42 (commit)
  from  ede5c81df7ab9403081ba31b8941a5b31b536ba2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit ed65f93eb4d23aee3129611c90fa2b81e0cb7f42
Author: Dave Reisner dreis...@archlinux.org
Date:   Sat Jan 4 16:57:11 2014 -0500

sd-shutdown: add kexec binary if it's available

---

Summary of changes:
 install/sd-shutdown | 4 
 1 file changed, 4 insertions(+)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v16-2-g8db1385

2013-12-24 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  8db138501100cf8bdb49304e3a87a4d2ba373873 (commit)
  from  2ce3a416c8714adedc3117e5247e6da364ddebc9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 8db138501100cf8bdb49304e3a87a4d2ba373873
Author: Dave Reisner dreis...@archlinux.org
Date:   Tue Dec 24 13:24:54 2013 -0500

include missing longopt --config in arg parser

Reported in FS#38264.

---

Summary of changes:
 lsinitcpio | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v16-3-gede5c81

2013-12-24 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  ede5c81df7ab9403081ba31b8941a5b31b536ba2 (commit)
  from  8db138501100cf8bdb49304e3a87a4d2ba373873 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit ede5c81df7ab9403081ba31b8941a5b31b536ba2
Author: Dave Reisner dreis...@archlinux.org
Date:   Tue Dec 24 13:51:37 2013 -0500

lsinitcpio: remove nonexistent showconfig longopt

Should have been removed as part of previous commit, as this was
clearly just a typo.

---

Summary of changes:
 lsinitcpio | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
The official mkinitcpio repository


[arch-projects] [mkinitcpio] [GIT] The official mkinitcpio repository branch master updated. v16-1-g2ce3a41

2013-12-22 Thread Dave Reisner
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project The official mkinitcpio repository.

The branch, master has been updated
   via  2ce3a416c8714adedc3117e5247e6da364ddebc9 (commit)
  from  a22a830b4706c5e15fcf4561165fd10706ca9a54 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 2ce3a416c8714adedc3117e5247e6da364ddebc9
Author: Dave Reisner dreis...@archlinux.org
Date:   Sun Dec 22 14:11:37 2013 -0500

Add -l flag when using lz4 compression

This isn't documented, but it's needed since the kernel lz4 support is
based on the original streaming format and not the newer default. Use
-l to force the legacy codec.

Fixup lsinitcpio to support the older format, and, add a warning when
the newer format is detected. Who knows when this will be resolved ...

Upstream discussion: https://code.google.com/p/lz4/issues/detail?id=102

---

Summary of changes:
 lsinitcpio | 15 +++
 mkinitcpio |  3 +++
 2 files changed, 14 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The official mkinitcpio repository


Re: [arch-projects] [mkinitcpio] lz4 support

2013-12-20 Thread Dave Reisner
On Fri, Dec 20, 2013 at 09:38:57PM -0500, Jason St. John wrote:
 On Fri, Dec 20, 2013 at 1:20 AM, Dave Reisner d...@falconindy.com wrote:
  On Fri, Dec 20, 2013 at 02:58:36AM +, Chris Rule wrote:
  Hi, sorry in advance if I haven't reported this correctly. I was hesitant 
  to
  file a bug report until I was sure it is a bug, and what the bug was in.
 
  I just tested lz4 compression with mkinitcpio after noticing it in the
  conf.pacnew.
 
  When I rebooted I got the following error after grub and my computer froze:
  [0.cut] Initramfs unpacking failed: junk in compressed archive
 
  ...
 
  [0.cut] Kernel panic - not syncing: VFS: Unable to mount root fs on
 
  snip
 
  1) I first found the messages to the linux kernel mailing list adding 
  support
  for lz4 to the kernel, describing it for arm and x86 so I initially 
  assumed lz4
  compressed images weren't supported with x86_64.
 
  x86_64 is still x86.
 
  2) I then read the thread 
  (https://code.google.com/p/lz4/issues/detail?id=83)
  linked from the lz4 commit in the mkinitcpio git repository (https://
  projects.archlinux.org/mkinitcpio.git/commit/?id=
  b5927393d103af9b8b2da80e8636b8aa52f80755), although I'm not sure I 
  understood
  everything in that thread I wonder if it may be a bug in lsinitcpio.
 
  lsinitcpio is irrelevant for booting (it's just an analysis/debugging
  tool). Anyways, it's just calling the lz4 binary, same as mkinitcpio.
 
  3) grub has insmod gzio in grub.cfg for all arch menu entries and 
  looking at
  gzio on the grub git it states it is for gzip decompression. I also found
  lzopio.mod in /usr/lib/grub/i386-pc and /usr/lib/grub/x86_64-efi, though I
  can't find any description for it I wonder if grub needs another module for
  decompressing the lz4 ramdisk.
 
  Your bootloader is NOT responsible for decompressing the initramfs. The
  first line of your kernel output shows the *kernel* failing to unpack
  the initramfs.
 
  Has a lz4 compressed ramdisk worked for anyone else and if it has can you 
  help
  me rule out any of these options or does anyone think I missed something?
 
  Nope, but this isn't likely to be a bug in mkinitcpio (unless I'm
  missing some magical flag, such as --check=crc32 being needed for xz).
  I'd talk to lz4 upstream if you want this resolved.
 
  d
 
 I had the same problem as Chris with a VirtualBox VM running Arch. I
 was able to replicate the same kernel panic on two other,
 non-virtualized Arch machines I use.
 
 All three Arch systems are running 3.12.5-1-ARCH (the standard Arch
 kernel from [core]) with mkinitcpio-16, and the kernel panic occurs
 after switching from lzop to lz4.
 
 Dave, do you have anything in COMPRESSION_OPTIONS in your
 /etc/mkinitcpio.conf (assuming you are using lz4)?
 
 I have reported this on the lz4 issue tracker here:
 https://code.google.com/p/lz4/issues/detail?id=102
 
 Jason

I don't compress my initramfs. Also:

https://bbs.archlinux.org/viewtopic.php?pid=1362280#p1362280


Re: [arch-projects] [mkinitcpio] [PATCH 1/3] mkinitcpio: Allow building an image without modules

2013-12-11 Thread Dave Reisner
On Wed, Dec 11, 2013 at 02:05:27PM +0100, Thomas Bächler wrote:
 Hi Dave, these patches have been sitting here for 2 weeks. I'd love to
 have this stuff fixed in the repository and preferably have a release.
 
 My sd-vconsole patches have also been sitting here dormant for quite
 longer and should at some point be available in Arch.
 
 

Sorry about this, I don't mean to be an absentee maintainer. My life is
forfeit through EOY thanks to $dayjob. I've pushed what I have locally
(with some minimal amount of testing). Feel free to rebase your
sd-vconsole hook against master and push it. You still have commit
rights, yes?

d


[arch-projects] [mkinitcpio] [PATCH] Load build and run hooks from /etc/initcpio

2013-12-01 Thread Dave Reisner
This lets users shoot themselves in the foot more easily, as they can
put their own modified hooks into /etc/initcpio/{hooks,install} to
override those shipped by the distro in /usr/lib/initcpio.

To make debugging easier, include the full path of the hook being used
when mkinitcpio runs in verbose mode.

Implements FS#37796.
---
 Makefile  | 6 --
 functions | 6 +-
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 66b1960..801d4c7 100644
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,8 @@ DIRS = \
/usr/share/bash-completion/completions \
/usr/share/zsh/site-functions \
/etc/mkinitcpio.d \
+   /etc/initcpio/hooks \
+   /etc/initcpio/install \
/usr/lib/initcpio/hooks \
/usr/lib/initcpio/install \
/usr/lib/initcpio/udev \
@@ -30,8 +32,8 @@ install: all
 
sed -e 's|^_f_config=.*|_f_config=/etc/mkinitcpio.conf|' \
-e 's|^_f_functions=.*|_f_functions=/usr/lib/initcpio/functions|' \
-   -e 
's|^_d_hooks=.*|_d_hooks=/usr/lib/initcpio/hooks:/lib/initcpio/hooks|' \
-   -e 
's|^_d_install=.*|_d_install=/usr/lib/initcpio/install:/lib/initcpio/install|' \
+   -e 
's|^_d_hooks=.*|_d_hooks=/etc/initcpio/hooks:/usr/lib/initcpio/hooks:/lib/initcpio/hooks|'
 \
+   -e 
's|^_d_install=.*|_d_install=/etc/initcpio/install:/usr/lib/initcpio/install:/lib/initcpio/install|'
 \
-e 's|^_d_presets=.*|_d_presets=/etc/mkinitcpio.d|' \
-e 's|%VERSION%|$(VERSION)|g' \
 mkinitcpio  $(DESTDIR)/usr/bin/mkinitcpio
diff --git a/functions b/functions
index 2b89c88..33bd28d 100644
--- a/functions
+++ b/functions
@@ -709,7 +709,11 @@ run_build_hook() {
 fi
 
 # run
-msg2 Running build hook: [%s] ${script##*/}
+if (( _optquiet )); then
+msg2 Running build hook: [%s] ${script##*/}
+else
+msg2 Running build hook: [%s] $script
+fi
 build
 
 # if we made it this far, return successfully. Hooks can
-- 
1.8.4.2



Re: [arch-projects] [mkinitcpio] [PATCH 2/2] resume: generate a udev rule for specifying device

2013-11-26 Thread Dave Reisner
On Tue, Nov 26, 2013 at 04:35:13PM +0100, Thomas Bächler wrote:
 Am 26.11.2013 16:22, schrieb Dave Reisner:
  * Linux loads, starts /init
  * Udev is started
  * Hard drive A is detected.
  * fsck is started, repairs the dirty root file system (and changes
  on-disk structures, clears the journal, ...)
  
  Who/what triggered fsck here? Why is fsck being run before the udev
  event queue is flushed?
  
  * Hard drive B is detected - udev start the resume procedure.
  
  ...
 
 So, you're still using udevadm settle, which mitigates the situation
 most of the time - but it is no guarantee. Just because the udev queue
 is empty does not mean that all hardware is enumerated (look into
 people's inboxes for mails from Kay Sievers or Greg K-H for the full
 speech).

I'm the last person this needs to be explained to ;)

 Your patch does not keep udev from initiating the resume even when
 mkinitcpio started fsck'ing/mounting already. This is incorrect and
 dangerous behaviour.
 
  but I don't really think your earlier posted order of
  events paints a realistic picture of what happens in early userspace.
 
 Orly? Sure, only the USB examples will be easily reproducible due to the
 udevadm settle. But release these changes and wait for a day until some
 guy turns up and says he has a resume image on USB and now his data is
 corrupt.
 

In other words, never underestimate the stupidity of users.

  I'll ask Harald about this -- Dracut uses a very similar mechanism (but
  a bit more complex/convoluted).
 
 Nobody said this was easy to solve.
 

Consider the patch shelved for now. It's not something I care about --
just thought I'd take a stab at fixing it for others.


[arch-projects] [mkinitcpio] [PATCH 1/2] init_functions: escape slashes in tag values

2013-11-23 Thread Dave Reisner
This allows booting from devices which have labels like LABEL=/.

Signed-off-by: Dave Reisner dreis...@archlinux.org
---
 init_functions | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/init_functions b/init_functions
index 474d6fa..11ce3ca 100644
--- a/init_functions
+++ b/init_functions
@@ -252,6 +252,16 @@ fsck_root() {
 fi
 }
 
+# TODO: this really needs to follow the logic of systemd's encode_devnode_name
+# function more closely.
+tag_to_udev_path() {
+awk -v tag=$1 -v value=$2 '
+BEGIN {
+gsub(/\//, \\x2f, value)
+printf /dev/disk/by-%s/%s\n, tolower(tag), value
+}'
+}
+
 resolve_device() {
 local major minor dev tag device=$1
 
@@ -264,8 +274,7 @@ resolve_device() {
 UUID=*|LABEL=*|PARTUUID=*|PARTLABEL=*)
 dev=$(blkid -lt $device -o device)
 if [ -z $dev -a $udevd_running -eq 1 ]; then
-tag=$(awk -v t=${device%%=*} 'BEGIN { print tolower(t) }')
-dev=/dev/disk/by-$tag/${device#*=}
+dev=$(tag_to_udev_path ${device%%=*} ${device#*=})
 fi
 esac
 
-- 
1.8.4.2



  1   2   3   4   5   6   >