diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-10-22 12:33:33 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-10-22 12:34:30 +0000 |
commit | 1aecb7a940aa7f6224e384fa3d1becf08c962367 (patch) | |
tree | 1c64e1ecfb2aa70c24583b9f7abac0c3ab626a66 /main/mkinitfs/git.patch | |
parent | b4c235bebdb577ad873b0ae050bb887a6d284deb (diff) | |
download | aports-1aecb7a940aa7f6224e384fa3d1becf08c962367.tar.bz2 aports-1aecb7a940aa7f6224e384fa3d1becf08c962367.tar.xz |
main/mkinitfs: fix cryptroot in initramfs
fix setup of cryptroot in initramfs
Diffstat (limited to 'main/mkinitfs/git.patch')
-rw-r--r-- | main/mkinitfs/git.patch | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/main/mkinitfs/git.patch b/main/mkinitfs/git.patch index d0f183410c..fb94a1769b 100644 --- a/main/mkinitfs/git.patch +++ b/main/mkinitfs/git.patch @@ -223,7 +223,7 @@ index fa74c10..b0e6c22 100644 kernel/drivers/virtio +kernel/drivers/net/virtio_net* diff --git a/initramfs-init.in b/initramfs-init.in -index 934fe92..ca4a5d5 100755 +index 934fe92..0834175 100755 --- a/initramfs-init.in +++ b/initramfs-init.in @@ -7,7 +7,7 @@ sysroot=/sysroot @@ -529,7 +529,7 @@ index 934fe92..ca4a5d5 100755 # load available drivers to get access to modloop media ebegin "Loading boot drivers" -@@ -528,8 +339,6 @@ if [ -f /etc/modules ] ; then +@@ -528,34 +339,36 @@ if [ -f /etc/modules ] ; then modprobe -q $module $args done fi @@ -537,8 +537,16 @@ index 934fe92..ca4a5d5 100755 -scan_drivers eend 0 ++if [ -n "$KOPT_cryptroot" ]; then ++ cryptopts="-c ${KOPT_cryptroot}" ++ if [ -n "$KOPT_cryptdm" ]; then ++ cryptopts="$cryptopts -m ${KOPT_cryptdm}" ++ fi ++fi ++ # check if root=... was set -@@ -538,24 +347,27 @@ if [ -n "$KOPT_root" ]; then + if [ -n "$KOPT_root" ]; then + if [ "$SINGLEMODE" = "yes" ]; then echo "Entering single mode. Type 'exit' to continue booting." sh fi @@ -550,26 +558,20 @@ index 934fe92..ca4a5d5 100755 - start_$i - done + -+ if [ -n "$KOPT_cryptroot" ]; then -+ cryptopts="-c ${KOPT_cryptroot}" -+ if [ -n "$KOPT_cryptdm" ]; then -+ cryptopts="$cryptopts -m ${KOPT_cryptdm}" -+ fi -+ fi ebegin "Mounting root" if [ "$KOPT_overlaytmpfs" = "yes" ]; then - mkdir -p /media/root-ro /media/root-rw $sysroot/media/root-ro $sysroot/media/root-rw - retry_mount -o ro $KOPT_root /media/root-ro 2>/dev/null + mkdir -p /media/root-ro /media/root-rw $sysroot/media/root-ro \ + $sysroot/media/root-rw -+ nlplug-findfs -p /sbin/mdev $KOPT_root \ ++ nlplug-findfs $cryptopts -p /sbin/mdev $KOPT_root \ + && mount -o ro $KOPT_root /media/root-ro mount -t tmpfs root-tmpfs /media/root-rw mkdir -p /media/root-rw/work /media/root-rw/root mount -t overlay -o lowerdir=/media/root-ro,upperdir=/media/root-rw/root,workdir=/media/root-rw/work overlayfs $sysroot else - retry_mount ${KOPT_rootfstype:+-t} ${KOPT_rootfstype} \ -+ nlplug-findfs -p /sbin/mdev $KOPT_root ++ nlplug-findfs $cryptopts -p /sbin/mdev $KOPT_root + mount ${KOPT_rootfstype:+-t} ${KOPT_rootfstype} \ -o ${KOPT_rootflags:-ro} \ - $KOPT_root $sysroot 2>/dev/null @@ -577,7 +579,7 @@ index 934fe92..ca4a5d5 100755 fi eend $? -@@ -571,35 +383,11 @@ if [ -n "$KOPT_root" ]; then +@@ -571,35 +384,11 @@ if [ -n "$KOPT_root" ]; then exec /bin/busybox sh fi @@ -610,13 +612,13 @@ index 934fe92..ca4a5d5 100755 -fi - -retry_mount -o ro $mount_opts $ALPINE_DEV $ALPINE_MNT >/dev/null 2>&1 -+nlplug-findfs -p /sbin/mdev ${KOPT_debug_init:+-d} \ ++nlplug-findfs $cryptopts -p /sbin/mdev ${KOPT_debug_init:+-d} \ + ${KOPT_usbdelay:+-t $(( $KOPT_usbdelay * 1000 ))} \ + -b /tmp/repositories -a /tmp/apkovls eend $? # early console? -@@ -620,27 +408,24 @@ fi +@@ -620,27 +409,24 @@ fi mount -t tmpfs -o $rootflags tmpfs $sysroot @@ -656,7 +658,7 @@ index 934fe92..ca4a5d5 100755 ;; esac -@@ -660,26 +445,16 @@ if [ -f "$ovl" ]; then +@@ -660,26 +446,16 @@ if [ -f "$ovl" ]; then eend $? $errstr || ovlfiles= # hack, incase /root/.ssh was included in apkovl [ -d "$sysroot/root" ] && chmod 700 "$sysroot/root" @@ -687,7 +689,7 @@ index 934fe92..ca4a5d5 100755 rc_add hwclock boot rc_add modules boot -@@ -695,17 +470,24 @@ if [ -f "$sysroot/etc/.default_boot_services" -o ! -f "$ovl" ]; then +@@ -695,17 +471,24 @@ if [ -f "$sysroot/etc/.default_boot_services" -o ! -f "$ovl" ]; then rm -f "$sysroot/etc/.default_boot_services" fi @@ -718,7 +720,7 @@ index 934fe92..ca4a5d5 100755 eend 0 else KOPT_splash="no" -@@ -723,13 +505,13 @@ if [ -f $sysroot/etc/fstab ]; then +@@ -723,13 +506,13 @@ if [ -f $sysroot/etc/fstab ]; then # move the ALPINE_MNT if ALPINE_DEV is specified in users fstab # this is so a generated /etc/apk/repositories will use correct # mount dir @@ -738,7 +740,7 @@ index 934fe92..ca4a5d5 100755 # hack so we get openrc pkgs="$pkgs alpine-base" -@@ -776,11 +558,16 @@ if [ "$KOPT_keep_apk_new" != yes ]; then +@@ -776,11 +559,16 @@ if [ "$KOPT_keep_apk_new" != yes ]; then apkflags="$apkflags --clean-protected" [ -n "$ovlfiles" ] && apkflags="$apkflags --overlay-from-stdin" fi @@ -755,7 +757,7 @@ index 934fe92..ca4a5d5 100755 eend $? # unmount ovl mount if needed -@@ -788,9 +575,11 @@ if [ -n "$ovl_unmount" ]; then +@@ -788,9 +576,11 @@ if [ -n "$ovl_unmount" ]; then umount $ovl_unmount 2>/dev/null fi @@ -770,7 +772,7 @@ index 934fe92..ca4a5d5 100755 fi # generate repositories if none exists. this needs to be done after relocation -@@ -810,10 +599,10 @@ fi +@@ -810,10 +600,10 @@ fi setup_inittab_console $CONSOLE # copy alpine release info |