Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poplar_recovery_builder: Fix cleanup #3

Merged
merged 1 commit into from May 26, 2017

Conversation

afaerber
Copy link
Contributor

The rootfs tarball was extracted using sudo.
Address a permissions error by using sudo rm.

Signed-off-by: Andreas Färber afaerber@suse.de

The rootfs tarball was extracted using sudo.
Address a permissions error by using sudo rm.

Signed-off-by: Andreas Färber <afaerber@suse.de>
@alexelder
Copy link
Collaborator

Did you find that the top-level mount directory ("binary") was owned by root?
It shouldn't be. It is created by this command:
mkdir -p ${MOUNT} || nope "unable to create mount point "${MOUNT}""

I definitely appreciate the patch, but I'm not sure it's needed. Can you
double-check? Thank you.

@afaerber
Copy link
Contributor Author

afaerber commented May 26, 2017

Yes. I observed a real error, something like "rm: No permission to remove binary", when using an openSUSE tarball such as http://download.opensuse.org/ports/aarch64/tumbleweed/images/openSUSE-Tumbleweed-ARM-JeOS.aarch64-rootfs.aarch64-Current.tbz. a) This failed because it expects .tar.gz (tar -xzf) instead of our .tbz (tar -xjf). The script only checks for a non-zero argument, not for a compatible file type. b) It failed because our tarball directly has bin/ etc. directories, no intermediate binary/ subdir. Besides mount there are multiple places using mkdir -p with ${MOUNT}. From whatever call site exactly there was a binary directory that on openSUSE my user did not have permissions for, and all the extracted files outside binary stayed behind as well as some loop mounts. After adding -C binary to the tar -xjf line everything worked, but not before. Both issues would be nice to address please.

@afaerber
Copy link
Contributor Author

BTW now that you fixed the documentation to mention USB_BOOT (there was some confusing non-linear git push -f apparently...? My pull originally had two commits from Robert prepended, and GitHub defaults to latest rather than master with no contributing.md to explain which one to use), it would be nice to make a binary copy of mbr.gz available for download, so that one does not strictly need to run this script. As I found out, it is necessary to re-flash the MBR after flashing fastboot.bin. Also I noticed that the recovery image is only 2 GB instead of 8 GB - how do you expect users to expand the third rootfs partition to maximum size?

poppy:~ # parted /dev/mmcblk0
GNU Parted 3.2
Using /dev/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: MMC 8WPD3R (sd/mmc)
Disk /dev/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      512B    4194kB  4194kB  primary               type=83
 2      4194kB  138MB   134MB   primary  fat32        boot, lba, type=0c
 3      138MB   2147MB  2009MB  primary  ext4         type=83

@afaerber
Copy link
Contributor Author

@ldts Another question: Does the second partition strictly need to be type 0x0c, or could I change it to EFI 0xef just as well when using as /boot/efi? Who exactly accesses the loader.bin file on it?

@afaerber
Copy link
Contributor Author

Similarly, the first partition does not seem to be formatted (l-loader.bin?), so type 0x83 does not seem correct.

@alexelder alexelder merged commit 822f5b3 into Linaro:master May 26, 2017
@alexelder
Copy link
Collaborator

alexelder commented May 26, 2017 via email

@alexelder
Copy link
Collaborator

alexelder commented May 26, 2017 via email

@alexelder
Copy link
Collaborator

alexelder commented May 26, 2017 via email

@alexelder
Copy link
Collaborator

alexelder commented May 26, 2017 via email

@afaerber afaerber deleted the cleanup-mount branch May 26, 2017 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants