Set root as owner for all files/dirs in the initramfs

This commit is contained in:
jumperfly 2016-11-16 19:25:57 +00:00 committed by Sam Liddell
parent 08a85a5acc
commit 4c7d6fcfa8
2 changed files with 3 additions and 3 deletions

View file

@ -15,7 +15,7 @@ If the partition is detected, the squashfs module will be loaded from /modules/<
This is used as the writeable area of the overlay and consists of three directories which are created if not preset:
* /upper: Used for the 'upperdir' of the overlayfs. This is where all deleted/modified/created files are stored. This is cleared on each boot.
* /work: Used for the 'workdir' of the overlayfs.
* /persistent: Used as an additional 'lowerdir' of the overlayfs. As the 'upperdir' is cleared, this read-only lower dir allows customisations to be made compared to the read-only OS image.
* /persistent: Used as an additional 'lowerdir' of the overlayfs. As the 'upperdir' is cleared, this read-only lower dir allows customisations to be made compared to the read-only OS image. eg. SSH keys.
### The image partition
This must contain a single file, root-squashfs.img which contains the full operating system.

View file

@ -47,7 +47,7 @@ for arch in ${!BUSYBOX_MD5[@]}; do
ln -s busybox $INIT_DIR/bin/$bbcmd
done
cd $INIT_DIR
find . | cpio -H newc -o | gzip > ../init-$PROJECT_VERSION-$arch.gz
find . | cpio -H newc -o --owner=0:0 | gzip > ../init-$PROJECT_VERSION-$arch.gz
cd ../..
# Create debug (start shell before switching root, start shell on error instead of exiting)
@ -56,6 +56,6 @@ for arch in ${!BUSYBOX_MD5[@]}; do
sed -i -r '/# End mounting OS filesystems/a sh' $INIT_DIR/init
sed -i -r 's/exit 1/sh/' $INIT_DIR/init
cd $INIT_DIR
find . | cpio -H newc -o | gzip > ../init-$PROJECT_VERSION-$arch-debug.gz
find . | cpio -H newc --owner=0:0 -o | gzip > ../init-$PROJECT_VERSION-$arch-debug.gz
cd ../..
done