ea75a7f18aa85456207ec4253f712f945dce0f1e
[librecmc/librecmc.git] / obsolete-buildroot / sources / squashfs.patch
1 This is a stupid little patch adding an option to change all uid/gid to
2 root/root in the generated filesystem.  We really need to teach mksquashfs
3 about device tables though...
4
5 --- squashfs1.3r3/squashfs-tools/mksquashfs.c-dist      2004-03-29 20:35:37.000000000 -0600
6 +++ squashfs1.3r3/squashfs-tools/mksquashfs.c   2004-03-29 22:28:51.000000000 -0600
7 @@ -136,6 +136,8 @@
8         stotal_bytes, stotal_inode_bytes, stotal_directory_bytes, sinode_count, sfile_count, ssym_count, sdev_count, sdir_count, sdup_files;
9  int restore = 0;
10  
11 +unsigned int root_owned = 0;
12 +
13  /*flag whether destination file is a block device */
14  int block_device = 0;
15  
16 @@ -421,6 +423,11 @@
17                 return SQUASHFS_INVALID;
18         }
19  
20 +       if (root_owned) {
21 +               buf.st_uid = 0;
22 +               buf.st_gid = 0;
23 +       }
24 +
25         base->mode = SQUASHFS_MODE(buf.st_mode);
26         base->uid = get_uid(&file_type, (squashfs_uid) buf.st_uid);
27         base->inode_type = file_type;
28 @@ -1268,6 +1275,8 @@
29                         root_name = argv[i];
30                 } else if(strcmp(argv[i], "-version") == 0) {
31                         VERSION();
32 +               } else if (strcmp(argv[i], "-root-owned") == 0) {
33 +                       root_owned = TRUE;
34                 } else {
35                         ERROR("%s: invalid option\n\n", argv[0]);
36  printOptions: