浏览代码

Update all the mkimage scripts to use --numeric-owner as a tar argument to properly preserve ownership

Tianon Gravi 11 年之前
父节点
当前提交
8e43db95f2
共有 4 个文件被更改,包括 5 次插入5 次删除
  1. 1 1
      contrib/mkimage-arch.sh
  2. 1 1
      contrib/mkimage-busybox.sh
  3. 2 2
      contrib/mkimage-debootstrap.sh
  4. 1 1
      contrib/mkimage-unittest.sh

+ 1 - 1
contrib/mkimage-arch.sh

@@ -62,6 +62,6 @@ mknod -m 666 ${DEV}/full c 1 7
 mknod -m 600 ${DEV}/initctl p
 mknod -m 600 ${DEV}/initctl p
 mknod -m 666 ${DEV}/ptmx c 5 2
 mknod -m 666 ${DEV}/ptmx c 5 2
 
 
-tar -C $ROOTFS -c . | docker import - archlinux
+tar --numeric-owner -C $ROOTFS -c . | docker import - archlinux
 docker run -i -t archlinux echo Success.
 docker run -i -t archlinux echo Success.
 rm -rf $ROOTFS
 rm -rf $ROOTFS

+ 1 - 1
contrib/mkimage-busybox.sh

@@ -35,5 +35,5 @@ do
     cp -a /dev/$X dev
     cp -a /dev/$X dev
 done
 done
 
 
-tar -cf- . | docker import - busybox
+tar --numeric-owner -cf- . | docker import - busybox
 docker run -i -u root busybox /bin/echo Success.
 docker run -i -u root busybox /bin/echo Success.

+ 2 - 2
contrib/mkimage-debootstrap.sh

@@ -189,10 +189,10 @@ if [ "$justTar" ]; then
 	touch "$repo"
 	touch "$repo"
 	
 	
 	# fill the tarball
 	# fill the tarball
-	sudo tar -caf "$repo" .
+	sudo tar --numeric-owner -caf "$repo" .
 else
 else
 	# create the image (and tag $repo:$suite)
 	# create the image (and tag $repo:$suite)
-	sudo tar -c . | $docker import - $repo $suite
+	sudo tar --numeric-owner -c . | $docker import - $repo $suite
 	
 	
 	# test the image
 	# test the image
 	$docker run -i -t $repo:$suite echo success
 	$docker run -i -t $repo:$suite echo success

+ 1 - 1
contrib/mkimage-unittest.sh

@@ -44,6 +44,6 @@ do
 done
 done
 
 
 chmod 0755 $ROOTFS # See #486
 chmod 0755 $ROOTFS # See #486
-tar -cf- . | docker import - docker-ut
+tar --numeric-owner -cf- . | docker import - docker-ut
 docker run -i -u root docker-ut /bin/echo Success.
 docker run -i -u root docker-ut /bin/echo Success.
 rm -rf $ROOTFS
 rm -rf $ROOTFS